Skip to content

Commit

Permalink
11331: Check property on instance if id is not set yet
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickdemooij9 authored and mikecp committed Oct 19, 2021
1 parent eb2f152 commit 57445e8
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -933,12 +933,12 @@
}
};

scope.deleteProperty = (properties, { id, label }) => {
const propertyName = label || "";
scope.deleteProperty = (properties, property) => {
const propertyName = property.label || "";

const localizeMany = localizationService.localizeMany(['general_delete']);
const localize = localizationService.localize('contentTypeEditor_confirmDeletePropertyMessage', [propertyName]);
const localize = localizationService.localize('contentTypeEditor_confirmDeletePropertyMessage', [propertyName]);

$q.all([localizeMany, localize]).then(values => {
const translations = values[0];
const message = values[1];
Expand All @@ -948,7 +948,7 @@
content: message,
submitButtonLabelKey: 'actions_delete',
submit: () => {
const index = properties.findIndex(property => property.id === id);
const index = properties.findIndex(p => property.id ? p.id === property.id : p === property);
properties.splice(index, 1);
notifyChanged();

Expand Down

0 comments on commit 57445e8

Please sign in to comment.