diff --git a/dist/i18n/en/functions.json b/dist/i18n/en/functions.json index 984cb37c..568e6cb2 100644 --- a/dist/i18n/en/functions.json +++ b/dist/i18n/en/functions.json @@ -345,6 +345,7 @@ }, "NEW_TEST": "New test", "NO_INTERNET_ACCESS": "Use local Docker images rather than pulling from remote", + "ENRICHED_NODE_SELECTOR": "The node selector of the function, enriched with the project’s and the service’s default node selectors", "POD_TOLERATIONS": { "ALLOW": "Allow function pods to run on spot nodes. Spot nodes might be tainted, using this option will make sure function pods tolerates those taints.", "CONSTRAIN": "Constrain function pods to spot nodes using label selectors.", diff --git a/dist/js/iguazio.dashboard-controls.js b/dist/js/iguazio.dashboard-controls.js index c00a88bc..c314c6a7 100644 --- a/dist/js/iguazio.dashboard-controls.js +++ b/dist/js/iguazio.dashboard-controls.js @@ -3360,6 +3360,7 @@ such restriction. dns1123Subdomain: 253, prefixedQualifiedName: 253, qualifiedName: 63, + qualifiedValue: 63, secretName: 253, wildcardDns1123Subdomain: 253 }, @@ -3488,10 +3489,11 @@ such restriction. }; }, beginEndWith: function beginEndWith(chars) { + var labelPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var convertedPattern = convertToPattern(chars); return { name: 'beginEnd', - label: $i18next.t('common:BEGIN_END_WITH', { + label: labelPrefix + $i18next.t('common:BEGIN_END_WITH', { lng: lng }) + ': ' + convertToLabel(chars), pattern: new RegExp('^([' + convertedPattern + '].*)?[' + convertedPattern + ']$') @@ -3518,9 +3520,10 @@ such restriction. }; }, validCharacters: function validCharacters(chars) { + var labelPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; return { name: 'validCharacters', - label: $i18next.t('common:VALID_CHARACTERS', { + label: labelPrefix + $i18next.t('common:VALID_CHARACTERS', { lng: lng }) + ': ' + convertToLabel(chars), pattern: new RegExp('^[' + convertToPattern(chars) + ']+$') @@ -3585,10 +3588,11 @@ such restriction. }; }, length: function length(options) { + var labelPrefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; var min = Number.isSafeInteger(options.min) ? options.min : 0; var max = Number.isSafeInteger(options.max) ? options.max : ''; if (min || max) { - var label = $i18next.t('common:LENGTH', { + var label = labelPrefix + $i18next.t('common:LENGTH', { lng: lng }) + ' – ' + (min ? 'min: ' + options.min + '\xa0\xa0' : '') + (max ? 'max: ' + options.max : ''); return { @@ -3629,6 +3633,17 @@ such restriction. }], dns1035Label: [generateRule.validCharacters('a-z 0-9 -'), generateRule.beginWith('a-z'), generateRule.endWith('a-z 0-9')], dns1123Label: [generateRule.validCharacters('a-z 0-9 -'), generateRule.beginEndWith('a-z 0-9')], + k8s: { + getValue: function getValue() { + var withPrefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var labelPrefix = withPrefix ? '[' + $i18next.t('common:VALUE', { + lng: lng + }) + '] ' : ''; + return [generateRule.beginEndWith('a-z A-Z 0-9', labelPrefix), generateRule.length({ + max: lengths.k8s.qualifiedValue + }, labelPrefix), generateRule.validCharacters('a-z A-Z 0-9 - _ .', labelPrefix)]; + } + }, prefixedQualifiedName: [{ name: 'nameValidCharacters', label: '[' + $i18next.t('common:NAME', { @@ -3814,32 +3829,7 @@ such restriction. }), pattern: /^(?!kubernetes\.io\/)(?!k8s\.io\/)/ }), - value: [{ - name: 'valueBeginEnd', - label: '[' + $i18next.t('common:VALUE', { - lng: lng - }) + '] ' + $i18next.t('common:BEGIN_END_WITH', { - lng: lng - }) + ': a–z, A–Z, 0–9', - pattern: /^([^/]+\/)?([A-Za-z0-9][^/]*)?[A-Za-z0-9]$/ - }, { - name: 'valueMaxLength', - label: '[' + $i18next.t('common:VALUE', { - lng: lng - }) + '] ' + $i18next.t('common:MAX_LENGTH_CHARACTERS', { - lng: lng, - count: 63 - }), - pattern: /^([^/]+\/)?[^/]{1,63}$/ - }, { - name: 'valueValidCharacters', - label: '[' + $i18next.t('common:VALUE', { - lng: lng - }) + '] ' + $i18next.t('common:VALID_CHARACTERS', { - lng: lng - }) + ': a–z, A–Z, 0–9, –, _, .', - pattern: /^[a-zA-Z0-9\-_.]+$/ - }] + value: commonRules.k8s.getValue(true) }, supportLogs: { contextId: [generateRule.validCharacters('0-9'), { @@ -3936,8 +3926,8 @@ such restriction. name: 'begin', label: $i18next.t('common:BEGIN_WITH', { lng: lng - }) + ': ldaps://, ldap://', - pattern: /^ldaps?:\/\// + }) + ': ldap://', + pattern: /^ldap?:\/\// }] }, tenant: { @@ -3992,7 +3982,11 @@ such restriction. phone: [generateRule.validCharacters('0-9 + -'), generateRule.onlyAtTheBeginning('+'), generateRule.beginWith('0-9 +'), generateRule.endWith('0-9'), generateRule.length({ min: 4, max: lengths.phone - })] + })], + nodeSelectors: { + key: commonRules.prefixedQualifiedName, + value: commonRules.k8s.getValue(false) + } }; return { storage: /^[a-zA-Z0-9]+?:\/\/[a-zA-Z0-9_.-]+?:[a-zA-Z0-9_./-]+?@[a-zA-Z0-9_.-]+?$/, @@ -4343,6 +4337,222 @@ such restriction. })(); "use strict"; +/* +Copyright 2018 Iguazio Systems Ltd. +Licensed under the Apache License, Version 2.0 (the "License") with +an addition restriction as set forth herein. You may not use this +file except in compliance with the License. You may obtain a copy of +the License at http://www.apache.org/licenses/LICENSE-2.0. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing +permissions and limitations under the License. +In addition, you may not use the software for any purposes that are +illegal under applicable law, and the grant of the foregoing license +under the Apache 2.0 license is conditioned upon your compliance with +such restriction. +*/ +(function () { + 'use strict'; + + IgzActionCheckboxAllController.$inject = ["$scope", "$rootScope", "lodash"]; + angular.module('iguazio.dashboard-controls').component('igzActionCheckboxAll', { + bindings: { + itemsCountOriginal: ' 0 && ctrl.checkedItemsCount === ctrl.itemsCount; + } + } +})(); +"use strict"; + +/* +Copyright 2018 Iguazio Systems Ltd. +Licensed under the Apache License, Version 2.0 (the "License") with +an addition restriction as set forth herein. You may not use this +file except in compliance with the License. You may obtain a copy of +the License at http://www.apache.org/licenses/LICENSE-2.0. +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied. See the License for the specific language governing +permissions and limitations under the License. +In addition, you may not use the software for any purposes that are +illegal under applicable law, and the grant of the foregoing license +under the Apache 2.0 license is conditioned upon your compliance with +such restriction. +*/ +(function () { + 'use strict'; + + ActionCheckboxAllService.$inject = ["$rootScope"]; + angular.module('iguazio.dashboard-controls').factory('ActionCheckboxAllService', ActionCheckboxAllService); + function ActionCheckboxAllService($rootScope) { + return { + changeCheckedItemsCount: changeCheckedItemsCount, + setCheckedItemsCount: setCheckedItemsCount + }; + + // + // Public methods + // + + /** + * Sends broadcast with count of changed checked items + * @param {number} changedCheckedItemsCount - number of changed checked items + */ + function changeCheckedItemsCount(changedCheckedItemsCount) { + $rootScope.$broadcast('action-checkbox-all_change-checked-items-count', { + changedCheckedItemsCount: changedCheckedItemsCount + }); + } + + /** + * Sends broadcast with count of checked items + * @param {number} checkedItemsCount + */ + function setCheckedItemsCount(checkedItemsCount) { + $rootScope.$broadcast('action-checkbox-all_set-checked-items-count', checkedItemsCount); + } + } +})(); +"use strict"; + /* Copyright 2018 Iguazio Systems Ltd. Licensed under the Apache License, Version 2.0 (the "License") with @@ -4597,24 +4807,26 @@ such restriction. (function () { 'use strict'; - IgzActionCheckboxAllController.$inject = ["$scope", "$rootScope", "lodash"]; - angular.module('iguazio.dashboard-controls').component('igzActionCheckboxAll', { + IgzActionPanel.$inject = ["$scope", "$rootScope", "$i18next", "i18next", "lodash"]; + angular.module('iguazio.dashboard-controls').component('igzActionPanel', { bindings: { - itemsCountOriginal: ' 0; } /** - * Calls on checkbox check/uncheck - * @param {Object} event - * @param {Object} data + * Called when 'Check all' checkbox is clicked or checked some item. + * @param {Event} event - $broadcast-ed event + * @param {Object} data - $broadcast-ed data + * @param {Object} data.checkedCount - count of checked items */ - function toggleCheckedItem(event, data) { - if (data.checked) { - ctrl.checkedItemsCount++; - } else { - ctrl.checkedItemsCount--; - } - $rootScope.$broadcast('action-checkbox-all_checked-items-count-change', { - checkedCount: ctrl.checkedItemsCount - }); - testAllItemsChecked(); - - // callback function is called to inform about checked items count - if (angular.isFunction(ctrl.onCheckChange)) { - ctrl.onCheckChange({ - checkedCount: ctrl.checkedItemsCount + function onUpdateCheckedItemsCount(event, data) { + checkedItemsCount = data.checkedCount; + if (angular.isFunction(ctrl.onItemsCheckedCount)) { + ctrl.onItemsCheckedCount({ + checkedCount: checkedItemsCount }); } + var visibleActions = lodash.filter(ctrl.actions, ['visible', true]); + ctrl.mainActions = lodash.slice(visibleActions, 0, mainActionsCount); + ctrl.remainingActions = lodash.slice(visibleActions, mainActionsCount, visibleActions.length); } /** - * Updates items count and toggle allItemsChecked flag - */ - function testAllItemsChecked() { - ctrl.allItemsChecked = ctrl.itemsCount > 0 && ctrl.checkedItemsCount === ctrl.itemsCount; - } - } -})(); -"use strict"; - -/* -Copyright 2018 Iguazio Systems Ltd. -Licensed under the Apache License, Version 2.0 (the "License") with -an addition restriction as set forth herein. You may not use this -file except in compliance with the License. You may obtain a copy of -the License at http://www.apache.org/licenses/LICENSE-2.0. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing -permissions and limitations under the License. -In addition, you may not use the software for any purposes that are -illegal under applicable law, and the grant of the foregoing license -under the Apache 2.0 license is conditioned upon your compliance with -such restriction. -*/ -(function () { - 'use strict'; - - ActionCheckboxAllService.$inject = ["$rootScope"]; - angular.module('iguazio.dashboard-controls').factory('ActionCheckboxAllService', ActionCheckboxAllService); - function ActionCheckboxAllService($rootScope) { - return { - changeCheckedItemsCount: changeCheckedItemsCount, - setCheckedItemsCount: setCheckedItemsCount - }; - - // - // Public methods - // - - /** - * Sends broadcast with count of changed checked items - * @param {number} changedCheckedItemsCount - number of changed checked items + * Refreshes actions list */ - function changeCheckedItemsCount(changedCheckedItemsCount) { - $rootScope.$broadcast('action-checkbox-all_change-checked-items-count', { - changedCheckedItemsCount: changedCheckedItemsCount + function refreshActions() { + ctrl.actions = lodash.filter(ctrl.actions, function (action) { + return !lodash.has(action, 'visible') || action.visible; }); - } - - /** - * Sends broadcast with count of checked items - * @param {number} checkedItemsCount - */ - function setCheckedItemsCount(checkedItemsCount) { - $rootScope.$broadcast('action-checkbox-all_set-checked-items-count', checkedItemsCount); + angular.forEach(ctrl.actions, function (action) { + if (!angular.isFunction(action.handler)) { + action.handler = defaultAction; + if (action.id === 'delete' && angular.isUndefined(action.confirm)) { + action.confirm = { + message: $i18next.t('common:DELETE_SELECTED_ITEMS_CONFIRM', { + lng: lng + }), + yesLabel: $i18next.t('common:YES_DELETE', { + lng: lng + }), + noLabel: $i18next.t('common:CANCEL', { + lng: lng + }), + type: 'critical_alert' + }; + } + } + }); + ctrl.mainActions = lodash.slice(ctrl.actions, 0, mainActionsCount); + ctrl.remainingActions = lodash.slice(ctrl.actions, mainActionsCount, ctrl.actions.length); } } })(); @@ -4813,250 +4941,50 @@ such restriction. (function () { 'use strict'; - IgzActionsPanesController.$inject = ["lodash", "ConfigService"]; - angular.module('iguazio.dashboard-controls').component('igzActionsPanes', { + IgzActionMenuController.$inject = ["$element", "$document", "$i18next", "$rootScope", "$scope", "$timeout", "$window", "i18next", "lodash", "ConfigService", "PreventDropdownCutOffService"]; + angular.module('iguazio.dashboard-controls').component('igzActionMenu', { bindings: { - infoPaneDisable: ' 0; - } - - /** - * Called when 'Check all' checkbox is clicked or checked some item. - * @param {Event} event - $broadcast-ed event - * @param {Object} data - $broadcast-ed data - * @param {Object} data.checkedCount - count of checked items - */ - function onUpdateCheckedItemsCount(event, data) { - checkedItemsCount = data.checkedCount; - if (angular.isFunction(ctrl.onItemsCheckedCount)) { - ctrl.onItemsCheckedCount({ - checkedCount: checkedItemsCount - }); - } - var visibleActions = lodash.filter(ctrl.actions, ['visible', true]); - ctrl.mainActions = lodash.slice(visibleActions, 0, mainActionsCount); - ctrl.remainingActions = lodash.slice(visibleActions, mainActionsCount, visibleActions.length); - } - - /** - * Refreshes actions list - */ - function refreshActions() { - ctrl.actions = lodash.filter(ctrl.actions, function (action) { - return !lodash.has(action, 'visible') || action.visible; - }); - angular.forEach(ctrl.actions, function (action) { - if (!angular.isFunction(action.handler)) { - action.handler = defaultAction; - if (action.id === 'delete' && angular.isUndefined(action.confirm)) { - action.confirm = { - message: $i18next.t('common:DELETE_SELECTED_ITEMS_CONFIRM', { - lng: lng - }), - yesLabel: $i18next.t('common:YES_DELETE', { - lng: lng - }), - noLabel: $i18next.t('common:CANCEL', { - lng: lng - }), - type: 'critical_alert' - }; - } - } - }); - ctrl.mainActions = lodash.slice(ctrl.actions, 0, mainActionsCount); - ctrl.remainingActions = lodash.slice(ctrl.actions, mainActionsCount, ctrl.actions.length); - } - } -})(); -"use strict"; - -/* -Copyright 2018 Iguazio Systems Ltd. -Licensed under the Apache License, Version 2.0 (the "License") with -an addition restriction as set forth herein. You may not use this -file except in compliance with the License. You may obtain a copy of -the License at http://www.apache.org/licenses/LICENSE-2.0. -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing -permissions and limitations under the License. -In addition, you may not use the software for any purposes that are -illegal under applicable law, and the grant of the foregoing license -under the Apache 2.0 license is conditioned upon your compliance with -such restriction. -*/ -(function () { - 'use strict'; - - IgzActionMenuController.$inject = ["$element", "$document", "$i18next", "$rootScope", "$scope", "$timeout", "$window", "i18next", "lodash", "ConfigService", "PreventDropdownCutOffService"]; - angular.module('iguazio.dashboard-controls').component('igzActionMenu', { - bindings: { - actions: '<', - shortcuts: '<', - onFireAction: '} ng-model - an array of strings to be set by the component. + * Replacing this array (by reference) will update the state of the options' checkboxes accordingly. + * Mutating it will have no effect (e.g. pushing new items to it, pulling items from it or mutating the items). + * Note: string values in the assigned array model that do not match some option's `value` property will be + * filtered out of the model array. + * @param {Array.} options - an array of objects describing the available options. + * Replacing this array (by reference) will update the option list and re-rendered it in the view. + * Mutating it will have no effect (e.g. pushing new items to it, pulling items from it, or mutating the items). + * Note: string values in the assigned array model that do not match some option's `value` property will be + * filtered out of the model array. + * Note: properties other than `value`, `label` and `disabled` of objects in `options` array are ignored. + * @param {string} options[].value - the string value to be add to/remove from model on checking/un-checking this + * option. + * @param {string} options[].label - the text of the label to display next to the checkbox. + * @param {boolean} [options[].disabled=false] - `true` if this option should be disabled, `false` or omitted + * otherwise. + * @param {string} [options[].id] - if provided this string will be used as the HTML `id` attribute of the + * `