From 01dd63ad29c449bb21be28a70dddf235725d3375 Mon Sep 17 00:00:00 2001 From: alexcoach Date: Thu, 11 Aug 2016 16:08:01 +0300 Subject: [PATCH] GREY-375 product form, survey required --- .../scripts/services/greyscale-project-products.js | 5 ++++- client/app/scripts/directives/modal-form-field.js | 2 +- client/i18n/en.json | 1 + client/i18n/es.json | 1 + client/i18n/fr.json | 1 + client/i18n/ru.json | 1 + 6 files changed, 9 insertions(+), 2 deletions(-) diff --git a/client/app/greyscale.tables/scripts/services/greyscale-project-products.js b/client/app/greyscale.tables/scripts/services/greyscale-project-products.js index c6f0188fc..b06b5c813 100644 --- a/client/app/greyscale.tables/scripts/services/greyscale-project-products.js +++ b/client/app/greyscale.tables/scripts/services/greyscale-project-products.js @@ -46,7 +46,9 @@ angular.module('greyscale.tables') sortable: 'surveyId', dataFormat: 'option', cellTemplate: '{{option.title}} ()', - //dataRequired: true, + dataPlaceholder: tns + 'SELECT_SURVEY', + //dataNoEmptyOption: true, + dataRequired: true, dataSet: { getData: _getSurveys, keyField: 'id', @@ -84,6 +86,7 @@ angular.module('greyscale.tables') title: tns + 'STATUS', dataFormat: 'option', dataNoEmptyOption: true, + dataRequired: true, dataSet: { getData: _getStatus, keyField: 'id', diff --git a/client/app/scripts/directives/modal-form-field.js b/client/app/scripts/directives/modal-form-field.js index cc1a51a42..9e42ba2d7 100644 --- a/client/app/scripts/directives/modal-form-field.js +++ b/client/app/scripts/directives/modal-form-field.js @@ -98,7 +98,7 @@ angular.module('greyscaleApp') 'ng-model="modalFormFieldModel" ng-required="modalFormField.dataRequired" gs-model-validate="modalFormField.dataValidate">'; var hiddenAttr = clmn.dataNoEmptyOption && !clmn.dataPlaceholder ? ' style="display: none" ' : ''; - var disableAttr = clmn.dataNoEmptyOption ? ' disabled ' : ''; + var disableAttr = clmn.dataNoEmptyOption || clmn.dataPlaceholder ? ' disabled ' : ''; var placeholderAttr = clmn.dataPlaceholder ? ' translate="' + clmn.dataPlaceholder + '" ' : ''; field += ''; field += ''; diff --git a/client/i18n/en.json b/client/i18n/en.json index 906d5bada..e6badc262 100644 --- a/client/i18n/en.json +++ b/client/i18n/en.json @@ -397,6 +397,7 @@ "PAUSE_PRODUCT": "Suspend Project", "PLANNING_NOT_FINISH": "Planning not finished yet. Please, set Survey, Subjects, Workflow Steps and Tasks for this Project.", "PRODUCT": "Project", + "SELECT_SURVEY": "Select survey...", "SETTINGS": "Settings", "START_PRODUCT": "Start Project", "STATUS": "Status", diff --git a/client/i18n/es.json b/client/i18n/es.json index bb526fca8..acb1a7d2d 100644 --- a/client/i18n/es.json +++ b/client/i18n/es.json @@ -397,6 +397,7 @@ "PAUSE_PRODUCT": "", "PLANNING_NOT_FINISH": "", "PRODUCT": "", + "SELECT_SURVEY": "", "SETTINGS": "", "START_PRODUCT": "", "STATUS": "", diff --git a/client/i18n/fr.json b/client/i18n/fr.json index bb526fca8..acb1a7d2d 100644 --- a/client/i18n/fr.json +++ b/client/i18n/fr.json @@ -397,6 +397,7 @@ "PAUSE_PRODUCT": "", "PLANNING_NOT_FINISH": "", "PRODUCT": "", + "SELECT_SURVEY": "", "SETTINGS": "", "START_PRODUCT": "", "STATUS": "", diff --git a/client/i18n/ru.json b/client/i18n/ru.json index 8e193a4fb..3364696fe 100644 --- a/client/i18n/ru.json +++ b/client/i18n/ru.json @@ -397,6 +397,7 @@ "PAUSE_PRODUCT": "Приостановить проект", "PLANNING_NOT_FINISH": "Планирование не окончено", "PRODUCT": "Проект", + "SELECT_SURVEY": "", "SETTINGS": "Настройки", "START_PRODUCT": "Запустить проект", "STATUS": "Состояние",