Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default user setting documentation #126

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ They are specified in the property `componentName` when specifying the template.
// ...
}}{% endraw %}
```
Also list in a LookUp-e can be set by [default user settings for particular model](ef2_model-user-settings-service.html#set-the-initial-values-for-particular-model).



{% include callout.html content="Переведено сервисом «Яндекс.Переводчик» <http://translate.yandex.ru>" type="info" %}
{% include callout.html content="Переведено сервисом «Яндекс.Переводчик» <http://translate.yandex.ru>" type="info" %}
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,5 @@ export default EditFormController.extend({
// ...
}}{% endraw %}
```

Также настройки таблицы можно задавать через [настройки](ef2_model-user-settings-service.html#установка-настроек-по-умолчанию-для-конкретных-моделей) для конкретной модели.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перефразировать

Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ It is possible to prevent resizing of individual columns using the [initial conf

If [service user settings](ef2_model-user-settings-service.html) is enabled, when loading the list control to read the saved setting width of columns, and changing column width - the setting is saved.

Table settings can be set by [default user settings for particular model](ef2_model-user-settings-service.html#set-the-initial-values-for-particular-model).


{% include callout.html content="Переведено сервисом «Яндекс.Переводчик» <http://translate.yandex.ru>" type="info" %}
{% include callout.html content="Переведено сервисом «Яндекс.Переводчик» <http://translate.yandex.ru>" type="info" %}
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,5 @@ export default ListFormController.extend({
## Сервис настроек пользователя

Если [cервис настроек пользователя](ef2_model-user-settings-service.html) включён, то при загрузке спискового контрола вычитывается сохранённая настройка ширины столбцов, а при изменении ширины столбцов - настройка сохраняется.

Настройки таблицы можно задавать через [настройки](ef2_model-user-settings-service.html#установка-настроек-по-умолчанию-для-конкретных-моделей) для конкретной модели.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,24 @@ The first option is preferable if you manually set the properties `colsOrder`, `

When you copy settings from "Show setup" string constants are enclosed in double quotation marks ("). Because the current standard requires JSCS with the description of object of framing of the string constants in single quotation marks ('), Copy/Paste more convenient the second option descriptions properties» «componentName as a string.

## Set the initial values for particular model
In addition to the ability to specify settings by component name, check for settings by model name was added.
You can add settings using blueprint `ember g default-user-setting «model-name» [options]`.
Following the results of the generation, a file `/app/default-user-settings/<model-name>.js` will be added
```javascript
export default class UserSetting { }

UserSetting.DEFAULT = {};
```
in which you will need to specify the settings for column order, width, sorting, etc. similar to developerUserSettings, where «componentName» = DEFAULT.

When you set the withIndexDefaultUserSetting parameter, the file `/app/default-user-settings/index.js` will be added, importing all default user settings, and which import will be added in app.js. By default withIndexDefaultUserSetting = false, when you generate settings in first time, you should set it to true. This will allow you to add the correct import of settings and at the same time avoid overwriting existing imports of settings during further generations.

{% include note.html content="
These settings have the lowest priority" %}

{% include note.html content="Currently used only for displaying object-list-view tables. Therefore, it can be applied on flexberry-groupedit, flexberry-objectlistview and flexberry-lookup" %}

## Sort and specify the column widths displayed in the interface table

The user has the option to set the sort order and column widths directly in the interface displayed in the table.
Expand All @@ -219,7 +237,7 @@ If you change the column sort order is reloading the page with the specified col
## Levels of user settings

The current mode is based on the following levels:

* mode settings for current model (actual for object-list-view)
* mode settings specified разработчиком;
* mode settings set by the user in интерфейсе;
* sort mode specified in parameters the URL of the page.
Expand All @@ -236,4 +254,4 @@ config.MapODataServiceDataObjectRoute(new[] { "SomeApp.Objects", ..., "UserSetti



{% include callout.html content="Переведено сервисом «Яндекс.Переводчик» <http://translate.yandex.ru>" type="info" %}
{% include callout.html content="Переведено сервисом «Яндекс.Переводчик» <http://translate.yandex.ru>" type="info" %}
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,23 @@ developerUserSettings: { «componentName»: { } }

При копировании настроек из пункта "Показать установки" строковые константы обрамляются в двойный кавычки ("). Так как текущий стандарт JSCS требует при описании объекта обрамления строковых констант в одинарные кавычки ('), то в режиме Copy/Paste более удобен второй вариант описания свойства «componentName» в виде строки.

## Установка настроек по умолчанию для конкретных моделей
Помимо возможности указать настройки по имени компонента, добавлена проверка наличия настроек по имени модели.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пустая строка после заголовка

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перефразировать

Добавить настройки можно с помощью блюпринта `ember g default-user-setting «model-name» [options]`.
По итогам генерации будет добавлен файл `/app/default-user-settings/<model-name>.js`
```javascript
export default class UserSetting { }

UserSetting.DEFAULT = {};
```
в котором необходимо будет указать настройки порядка столбцов, ширины, сортировки и т.д. аналогично developerUserSettings, где «componentName» = DEFAULT.

При выставлении параметра withIndexDefaultUserSetting к файлу с настройкой добавится файл `/app/default-user-settings/index.js`, импортирующий все настройки, и непосредственно его импорт в app.js. По умолчанию флаг снят, при генерации первой настройки следует выставить. Это позволит добавить корректный импорт настроек и в то же время избежать затирания существующих импортов настроек при дальнейших генерациях.

{% include note.html content="Данные настройки имеют наименьший приоритет" %}

{% include note.html content="На данный момент используются только для оторажения таблиц object-list-view. Следовательно можно применять на flexberry-groupedit, flexberry-objectlistview и flexberry-lookup" %}

## Сортировка и указание ширины столбцов в интерфейсе отображаемой таблицы

Пользователь имеет возможность задавать порядок сортировки и ширину столбцов непосредственно в интерфейсе отображаемой таблицы.
Expand All @@ -219,7 +236,7 @@ developerUserSettings: { «componentName»: { } }
## Уровни пользовательских настроек

Текущий режим настроек формируется на основе следующих уровней:

* режим настройки для отображаемой модели (используется в object-list-view)
* режим настройки заданный разработчиком;
* режим настройки установленный пользователем в интерфейсе;
* режим сортировки, заданный в параметраз URL страницы.
Expand Down