Skip to content

Commit

Permalink
Map name is editable only for new map (#754)
Browse files Browse the repository at this point in the history
  • Loading branch information
eneroslov committed May 31, 2023
1 parent 3bd25ba commit 070acb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions addon/components/flexberry-mapinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,15 @@ let MapInfoComponent = Ember.Component.extend({
*/
name: null,

/**
Flag: indicates whether name of map can be edited.
@property nameIsEditable
@type Boolean
@default true
*/
nameIsEditable: true,

/**
Map description.
Expand Down Expand Up @@ -217,8 +226,10 @@ let MapInfoComponent = Ember.Component.extend({
let service = this.get('service');
let storageClass = this.get('_storageClassName');
let mapId = this.get('mapId');
let mapIsNew = Ember.isNone(service.getFromStorageSingle(storageClass, mapId));
let dialogVisibility = !Ember.isNone(mapId) && service.getFromStorageSingle(storageClass, mapId) !== false;

this.set('nameIsEditable', !mapIsNew);
this.set('visible', dialogVisibility);
this.set('showOnOpen', dialogVisibility);
},
Expand Down
2 changes: 1 addition & 1 deletion addon/templates/components/flexberry-mapinfo.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{flexberry-textbox
class="fluid"
value=name
readonly=true
readonly=nameIsEditable
}}
</div>
<div class="field">
Expand Down

0 comments on commit 070acb9

Please sign in to comment.