<commit_before>import Ember from 'ember';
import layout from '../../../../templates/components/layers-dialogs/group/tab/legend-settings';
import { translationMacro as t } from 'ember-i18n';

/**
 Component for legend settings tab in layer settings.
 */
export default Ember.Component.extend({
  /**
    Reference to component's template.
  */
  layout,

  /**
    Caption to be displayed in checkbox

    @property canBeDisplayedCaption
    @type String
    @default t('components.layers-dialogs.settings.group.tab.legend-settings.legendCanBeDisplayed')
  */
  canBeDisplayedLabel: t('components.layers-dialogs.settings.group.tab.legend-settings.legendCanBeDisplayed'),

  /**
    Style class for checkbox component.

    @property classNames
    @type String 
    @default 'toggle'
  */
  classNames: 'toggle',

  /** 
    Current object with settings

    @property value
    @type Object
    @default undefined
  */
  value: undefined,

  /**
    Current checkbox value.

    @property _canBeDisplayed
    @type Boolean  
    @default true
    @private 
  */
  _canBeDisplayed: undefined,

  /**
    Observer changes settings for legend.

    @method _settingsForChanged
    @private
  */
  _settingsForChanged: Ember.observer(
    '_canBeDisplayed',
    '_url',
    '_version',
    '_format',
    '_layers',
    function() {

      let obj = null;

      if(this.get('_isWmsType')){
        obj = {
          legendCanBeDisplayed: this.get('_canBeDisplayed'),
          url: this.get('_url'),
          version: this.get('_version'),
          format: this.get('_format'),
          layers: this.get('_layers')
        };
      } else {
        obj = {
          legendCanBeDisplayed: this.get('_canBeDisplayed')
        };
      }
      this.set('value', obj);
    }
  ),

  /**
    Flag: indicates whether  layer's type is wms.

    @property _isWmsType
    @type Boolean  
    @default false
    @private 
  */
  _isWmsType: Ember.computed('type', function () {
    let type=this.get('type');

    if(!Ember.isNone(type) && type.indexOf('wms') > -1){
      return true;
    } else {
      return false;
    }
  }),

  /**
    Property containing url.

    @property _url
    @type String
    @default ''
    @private
  */<commit_msg>correction of formating<commit_after>import Ember from 'ember';
import layout from '../../../../templates/components/layers-dialogs/group/tab/legend-settings';
import { translationMacro as t } from 'ember-i18n';

/**
 Component for legend settings tab in layer settings.
 */
export default Ember.Component.extend({
  /**
    Reference to component's template.
  */
  layout,

  /**
    Caption to be displayed in checkbox

    @property canBeDisplayedCaption
    @type String
    @default t('components.layers-dialogs.settings.group.tab.legend-settings.legendCanBeDisplayed')
  */
  canBeDisplayedLabel: t('components.layers-dialogs.settings.group.tab.legend-settings.legendCanBeDisplayed'),

  /**
    Style class for checkbox component.

    @property classNames
    @type String
    @default 'toggle'
  */
  classNames: 'toggle',

  /**
    Current object with settings

    @property value
    @type Object
    @default undefined
  */
  value: undefined,

  /**
    Current checkbox value.

    @property _canBeDisplayed
    @type Boolean
    @default true
    @private
  */
  _canBeDisplayed: undefined,

  /**
    Observer changes settings for legend.

    @method _settingsForChanged
    @private
  */
  _settingsForChanged: Ember.observer(
    '_canBeDisplayed',
    '_url',
    '_version',
    '_format',
    '_layers',
    function() {

      let obj = null;

      if (this.get('_isWmsType')) {
        obj = {
          legendCanBeDisplayed: this.get('_canBeDisplayed'),
          url: this.get('_url'),
          version: this.get('_version'),
          format: this.get('_format'),
          layers: this.get('_layers')
        };
      } else {
        obj = {
          legendCanBeDisplayed: this.get('_canBeDisplayed')
        };
      }

      this.set('value', obj);
    }
  ),

  /**
    Flag: indicates whether  layer's type is wms.

    @property _isWmsType
    @type Boolean
    @default false
    @private
  */
  _isWmsType: Ember.computed('type', function () {
    let type = this.get('type');

    if (!Ember.isNone(type) && type.indexOf('wms') > -1) {
      return true;
    } else {
      return false;
    }
  }),

  /**
    Property containing url.

    @property _url
    @type String
    @default ''
    @private
  */
{'fraction_non_alphanumeric': 0.12786812207618622, 'fraction_numerical': 0.0013366005791935842, 'mean_word_length': 2.432721712538226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2367581', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1351, 'n_words': 313}