import EditFormRoute from 'ember-flexberry/routes/edit-form';
import EditFormRouteOperationsIndicationMixin from 'ember-flexberry/mixins/edit-form-route-operations-indication';

import { Query } from 'ember-flexberry-data';

export default EditFormRoute.extend(EditFormRouteOperationsIndicationMixin, {
  /**
    Name of model projection to be used as record's properties limitation.

    @property modelProjection
    @type String
    @default 'SuggestionE'
   */
  modelProjection: 'SuggestionE',

  /**
  developerUserSettings.
  {
  <componentName>: {
    <settingName>: {
        colsOrder: [ { propName :<colName>, hide: true|false }, ... ],
        sorting: [{ propName: <colName>, direction: 'asc'|'desc' }, ... ],
        colsWidths: [ <colName>:<colWidth>, ... ],
      },
      ...
    },
    ...
  }
  For default userSetting use empty name ('').
  <componentName> may contain any of properties: colsOrder, sorting, colsWidth or being empty.

  @property developerUserSettings
  @type Object
  @default {}
  */
  developerUserSettings: {
    suggestionUserVotesGroupEdit: {
      'DEFAULT': {
        'columnWidths': [
          { 'propName': 'OlvRowToolbar', 'fixed': true, 'width': 65 },
          { 'propName': 'voteType', 'width': 133 },
          { 'propName': 'author', 'width': 348 },
          { 'propName': 'author.eMail', 'width': 531 }
        ],
        'sorting': [{ 'propName': 'author', 'direction': 'asc', 'attributePath': 'author.name' }]
      }
    },
    filesGroupEdit: {
      'DEFAULT': {
        'columnWidths': [
          { 'propName': 'OlvRowToolbar', 'fixed': true, 'width': 65 },
          { 'propName': 'order', 'width': 140 },
          { 'propName': 'file', 'width': 893 }
        ],
        'colsOrder': [{ 'propName': 'file' }, { 'propName': 'order' }],
        'sorting': [{ 'propName': 'order', 'direction': 'desc' }]
      }
    },
    suggestionCommentsGroupEdit: {
      'DEFAULT': {
        'columnWidths': [{ 'propName': 'OlvRowToolbar', 'fixed': true, 'width': 65 }, { 'propName': 'votes', 'fixed': true }],
        'sorting': [
          { 'propName': 'votes', 'direction': 'asc' },
          { 'propName': 'moderated', 'direction': 'desc' },
          { 'propName': 'text', 'direction': 'asc' }
        ],
      }
    }
  },

  /**
    Name of model to be used as form's record type.

    @property modelName
    @type String
    @default 'ember-flexberry-dummy-suggestion'
   */
  modelName: 'ember-flexberry-dummy-suggestion',

  model(params) {
    let userService = Ember.getOwner(this).lookup('service:user');
    let modelName = 'new-platform-flexberry-services-lock';

    let builder = new Query.Builder(this.store)
      .from('new-platform-flexberry-services-lock')
      .selectByProjection('LockL')
      .byId(`'${params.id}'`);

    this.store.query(modelName, builder.build()).then((lock) => {
      if(lock.content.length)
      {
        let lockUser = lock.objectAt(0).get('userName');
        if(lockUser !== userService.getCurrentUserName()) {
          this.set('controller.blockedByUser', lockUser);
        } else {
          this.set('controller.blockedByUser', undefined);
        }
      } else {
        this.set('controller.blockedByUser', undefined);
      }
    });

    return this._super(...arguments);
  }

});

@@ -216,16 +216,43 @@
 y-data';
+%0Aimport Ember from 'ember';
 %0A%0Aexport
@@ -2889,24 +2889,25 @@
 %3E %7B%0A      if
+ 
 (lock.conten
@@ -2915,22 +2915,16 @@
 .length)
-%0A     
  %7B%0A     
@@ -2985,16 +2985,17 @@
       if
+ 
 (lockUse
@@ -3311,13 +3311,12 @@
 s);%0A  %7D%0A
-%0A
 %7D);%0A

Correct mistake