Skip to content

Commit

Permalink
Fix edit attr
Browse files Browse the repository at this point in the history
  • Loading branch information
soupette committed Mar 25, 2019
1 parent cde09a2 commit 618d8af
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,25 @@ export class ModelPage extends React.Component {
handleClickEditAttribute = async (attributeName, type) => {
const { emitEvent } = this.context;
const {
canOpenModal,
history: { push },
setTemporaryAttribute,
} = this.props;
const attributeType = ['integer', 'biginteger', 'float', 'decimal'].includes(type) ? 'number' : type;

setTemporaryAttribute(attributeName, this.isUpdatingTemporaryContentType(), this.getModelName());
if (canOpenModal) {
setTemporaryAttribute(attributeName, this.isUpdatingTemporaryContentType(), this.getModelName());

await this.wait();
await this.wait();

emitEvent('willEditFieldOfContentType');
push({
search: `modalType=attributeForm&attributeType=${attributeType ||
'relation'}&settingType=base&actionType=edit&attributeName=${attributeName}`,
});
emitEvent('willEditFieldOfContentType');
push({
search: `modalType=attributeForm&attributeType=${attributeType ||
'relation'}&settingType=base&actionType=edit&attributeName=${attributeName}`,
});
} else {
this.displayNotificationCTNotSaved();
}
};

handleClickEditModelMainInfos = async () => {
Expand Down

0 comments on commit 618d8af

Please sign in to comment.