IGNITE-9879 Web console: Refactored "Configuration" screen to module with lazy loading.
diff --git a/frontend/app/app.d.ts b/frontend/app/app.d.ts
index 69cc7ab..3f837ee 100644
--- a/frontend/app/app.d.ts
+++ b/frontend/app/app.d.ts
@@ -26,4 +26,4 @@
declare module '*.json' {
const value: any;
export default value;
-}
\ No newline at end of file
+}
diff --git a/frontend/app/app.js b/frontend/app/app.js
index 94f9704..2c42c62 100644
--- a/frontend/app/app.js
+++ b/frontend/app/app.js
@@ -40,7 +40,6 @@
import './modules/user/user.module';
import './modules/branding/branding.module';
import './modules/navbar/navbar.module';
-import './modules/configuration/configuration.module';
import './modules/getting-started/GettingStarted.provider';
import './modules/dialog/dialog.module';
import './modules/ace.module';
@@ -53,23 +52,14 @@
// Directives.
import igniteAutoFocus from './directives/auto-focus.directive';
-import igniteBsAffixUpdate from './directives/bs-affix-update.directive';
-import igniteCentered from './directives/centered/centered.directive';
import igniteCopyToClipboard from './directives/copy-to-clipboard.directive';
import igniteHideOnStateChange from './directives/hide-on-state-change/hide-on-state-change.directive';
-import igniteInformation from './directives/information/information.directive';
import igniteMatch from './directives/match.directive';
import igniteOnClickFocus from './directives/on-click-focus.directive';
import igniteOnEnter from './directives/on-enter.directive';
import igniteOnEnterFocusMove from './directives/on-enter-focus-move.directive';
import igniteOnEscape from './directives/on-escape.directive';
import igniteOnFocusOut from './directives/on-focus-out.directive';
-import igniteRestoreInputFocus from './directives/restore-input-focus.directive';
-import igniteUiAceCSharp from './directives/ui-ace-sharp/ui-ace-sharp.directive';
-import igniteUiAcePojos from './directives/ui-ace-pojos/ui-ace-pojos.directive';
-import igniteUiAcePom from './directives/ui-ace-pom/ui-ace-pom.directive';
-import igniteUiAceDocker from './directives/ui-ace-docker/ui-ace-docker.directive';
-import igniteUiAceTabs from './directives/ui-ace-tabs.directive';
import igniteRetainSelection from './directives/retain-selection.directive';
import btnIgniteLink from './directives/btn-ignite-link';
@@ -90,11 +80,9 @@
import Messages from './services/Messages.service';
import ErrorParser from './services/ErrorParser.service';
import ModelNormalizer from './services/ModelNormalizer.service';
-import Caches from './services/Caches';
import {CSV} from './services/CSV';
import {$exceptionHandler} from './services/exceptionHandler';
-import IGFSs from './services/IGFSs';
-import Models from './services/Models';
+
import {Store} from './services/store';
import AngularStrapTooltip from './services/AngularStrapTooltip.decorator';
@@ -121,11 +109,7 @@
import versionPicker from './components/version-picker';
import userNotifications from './components/user-notifications';
import pageAdmin from './components/page-admin';
-import pageConfigure from './components/page-configure';
-import pageConfigureBasic from './components/page-configure-basic';
-import pageConfigureAdvanced from './components/page-configure-advanced';
import pageQueries from './components/page-queries';
-import pageConfigureOverview from './components/page-configure-overview';
import gridColumnSelector from './components/grid-column-selector';
import gridItemSelected from './components/grid-item-selected';
import gridNoData from './components/grid-no-data';
@@ -165,262 +149,242 @@
import igniteServices from './services';
-import uiAceJava from './directives/ui-ace-java';
-import uiAceSpring from './directives/ui-ace-spring';
-
import baseTemplate from 'views/base.pug';
import * as icons from '../public/images/icons';
-export default angular.module('ignite-console', [
- // Optional AngularJS modules.
- 'ngAnimate',
- 'ngSanitize',
- 'ngMessages',
- // Third party libs.
- 'dndLists',
- 'gridster',
- 'mgcrea.ngStrap',
- 'nvd3',
- 'pascalprecht.translate',
- 'smart-table',
- 'treeControl',
- 'ui.grid',
- 'ui.grid.autoResize',
- 'ui.grid.exporter',
- 'ui.grid.resizeColumns',
- 'ui.grid.saveState',
- 'ui.grid.selection',
- 'ui.router',
- 'ui.router.state.events',
- 'ui.carousel',
- // Base modules.
- 'ignite-console.core',
- 'ignite-console.ace',
- 'ignite-console.Form',
- 'ignite-console.input-dialog',
- 'ignite-console.user',
- 'ignite-console.branding',
- 'ignite-console.agent',
- 'ignite-console.nodes',
- 'ignite-console.demo',
- // States.
- 'ignite-console.states.logout',
- 'ignite-console.states.admin',
- 'ignite-console.states.errors',
- 'ignite-console.states.settings',
- // Common modules.
- 'ignite-console.dialog',
- 'ignite-console.navbar',
- 'ignite-console.configuration',
- 'ignite-console.getting-started',
- 'ignite-console.loading',
- // Ignite configuration module.
- 'ignite-console.config',
- // Components
- webConsoleHeader.name,
- webConsoleFooter.name,
- igniteIcon.name,
- igniteServices.name,
- versionPicker.name,
- userNotifications.name,
- pageAdmin.name,
- pageConfigure.name,
- pageConfigureBasic.name,
- pageConfigureAdvanced.name,
- pageQueries.name,
- pageConfigureOverview.name,
- gridColumnSelector.name,
- gridItemSelected.name,
- gridNoData.name,
- gridExport.name,
- gridShowingRows.name,
- bsSelectMenu.name,
- uiGrid.name,
- uiGridHovering.name,
- uiGridFilters.name,
- uiGridColumnResizer.name,
- protectFromBsSelectRender.name,
- AngularStrapTooltip.name,
- AngularStrapSelect.name,
- listEditable.name,
- panelCollapsible.name,
- clusterSelector.name,
- servicesModule.name,
- connectedClusters.name,
- connectedClustersDialog.name,
- igniteListOfRegisteredUsers.name,
- dialogAdminCreateUser.name,
- pageProfile.name,
- pageLanding.name,
- pagePasswordChanged.name,
- pagePasswordReset.name,
- pageSignup.name,
- pageSignin.name,
- pageForgotPassword.name,
- uiAceJava.name,
- uiAceSpring.name,
- breadcrumbs.name,
- passwordVisibility.name,
- igniteChart.name,
- igniteChartSelector.name,
- statusOutput.name,
- progressLine.name,
- formField.name,
- formSignup.name,
- timedRedirection.name,
- sidebar.name,
- permanentNotifications.name,
- timedRedirection.name,
- signupConfirmation.name
-])
-.service('$exceptionHandler', $exceptionHandler)
-// Directives.
-.directive('igniteAutoFocus', igniteAutoFocus)
-.directive('igniteBsAffixUpdate', igniteBsAffixUpdate)
-.directive('centered', igniteCentered)
-.directive('igniteCopyToClipboard', igniteCopyToClipboard)
-.directive('hideOnStateChange', igniteHideOnStateChange)
-.directive('igniteInformation', igniteInformation)
-.directive('igniteMatch', igniteMatch)
-.directive('igniteOnClickFocus', igniteOnClickFocus)
-.directive('igniteOnEnter', igniteOnEnter)
-.directive('igniteOnEnterFocusMove', igniteOnEnterFocusMove)
-.directive('igniteOnEscape', igniteOnEscape)
-.directive('igniteUiAceSharp', igniteUiAceCSharp)
-.directive('igniteUiAcePojos', igniteUiAcePojos)
-.directive('igniteUiAcePom', igniteUiAcePom)
-.directive('igniteUiAceDocker', igniteUiAceDocker)
-.directive('igniteUiAceTabs', igniteUiAceTabs)
-.directive('igniteRetainSelection', igniteRetainSelection)
-.directive('igniteOnFocusOut', igniteOnFocusOut)
-.directive('igniteRestoreInputFocus', igniteRestoreInputFocus)
-.directive('btnIgniteLinkDashedSuccess', btnIgniteLink)
-.directive('btnIgniteLinkDashedSecondary', btnIgniteLink)
-// Services.
-.service('IgniteErrorPopover', ErrorPopover)
-.service('JavaTypes', JavaTypes)
-.service('SqlTypes', SqlTypes)
-.service('IgniteChartColors', ChartColors)
-.service('IgniteConfirm', IgniteConfirm)
-.service('Confirm', Confirm)
-.service('IgniteConfirmBatch', ConfirmBatch)
-.service('IgniteCopyToClipboard', CopyToClipboard)
-.service('IgniteCountries', Countries)
-.service('IgniteFocus', Focus)
-.service('IgniteInetAddress', InetAddress)
-.service('IgniteMessages', Messages)
-.service('IgniteErrorParser', ErrorParser)
-.service('IgniteModelNormalizer', ModelNormalizer)
-.service('IgniteLegacyTable', LegacyTable)
-.service('IgniteFormUtils', FormUtils)
-.service('IgniteLegacyUtils', LegacyUtils)
-.service('IgniteActivitiesUserDialog', IgniteActivitiesUserDialog)
-.service('Caches', Caches)
-.service('CSV', CSV)
-.service('IGFSs', IGFSs)
-.service('Models', Models)
-.service('Store', Store)
-// Filters.
-.filter('byName', byName)
-.filter('bytes', bytes)
-.filter('defaultName', defaultName)
-.filter('domainsValidation', domainsValidation)
-.filter('duration', duration)
-.filter('hasPojo', hasPojo)
-.filter('uiGridSubcategories', uiGridSubcategories)
-.filter('id8', id8)
-.config(['$translateProvider', '$stateProvider', '$locationProvider', '$urlRouterProvider',
- /**
- * @param {angular.translate.ITranslateProvider} $translateProvider
- * @param {import('@uirouter/angularjs').StateProvider} $stateProvider
- * @param {ng.ILocationProvider} $locationProvider
- * @param {import('@uirouter/angularjs').UrlRouterProvider} $urlRouterProvider
- */
- ($translateProvider, $stateProvider, $locationProvider, $urlRouterProvider) => {
- $translateProvider.translations('en', i18n);
- $translateProvider.preferredLanguage('en');
+export default angular
+ .module('ignite-console', [
+ // Optional AngularJS modules.
+ 'ngAnimate',
+ 'ngSanitize',
+ 'ngMessages',
+ // Third party libs.
+ 'asyncFilter',
+ 'dndLists',
+ 'gridster',
+ 'mgcrea.ngStrap',
+ 'nvd3',
+ 'pascalprecht.translate',
+ 'smart-table',
+ 'treeControl',
+ 'ui.grid',
+ 'ui.grid.autoResize',
+ 'ui.grid.exporter',
+ 'ui.grid.resizeColumns',
+ 'ui.grid.saveState',
+ 'ui.grid.selection',
+ 'ui.router',
+ 'ui.router.state.events',
+ 'ui.carousel',
+ // Base modules.
+ 'ignite-console.core',
+ 'ignite-console.ace',
+ 'ignite-console.Form',
+ 'ignite-console.input-dialog',
+ 'ignite-console.user',
+ 'ignite-console.branding',
+ 'ignite-console.agent',
+ 'ignite-console.nodes',
+ 'ignite-console.demo',
+ // States.
+ 'ignite-console.states.logout',
+ 'ignite-console.states.admin',
+ 'ignite-console.states.errors',
+ 'ignite-console.states.settings',
+ // Common modules.
+ 'ignite-console.dialog',
+ 'ignite-console.navbar',
+ 'ignite-console.getting-started',
+ 'ignite-console.loading',
+ // Ignite configuration module.
+ 'ignite-console.config',
+ // Components
+ webConsoleHeader.name,
+ webConsoleFooter.name,
+ igniteIcon.name,
+ igniteServices.name,
+ versionPicker.name,
+ userNotifications.name,
+ pageAdmin.name,
+ pageQueries.name,
+ gridColumnSelector.name,
+ gridItemSelected.name,
+ gridNoData.name,
+ gridExport.name,
+ gridShowingRows.name,
+ bsSelectMenu.name,
+ uiGrid.name,
+ uiGridHovering.name,
+ uiGridFilters.name,
+ uiGridColumnResizer.name,
+ protectFromBsSelectRender.name,
+ AngularStrapTooltip.name,
+ AngularStrapSelect.name,
+ listEditable.name,
+ panelCollapsible.name,
+ clusterSelector.name,
+ servicesModule.name,
+ connectedClusters.name,
+ connectedClustersDialog.name,
+ igniteListOfRegisteredUsers.name,
+ dialogAdminCreateUser.name,
+ pageProfile.name,
+ pageLanding.name,
+ pagePasswordChanged.name,
+ pagePasswordReset.name,
+ pageSignup.name,
+ pageSignin.name,
+ pageForgotPassword.name,
+ breadcrumbs.name,
+ passwordVisibility.name,
+ igniteChart.name,
+ igniteChartSelector.name,
+ statusOutput.name,
+ progressLine.name,
+ formField.name,
+ formSignup.name,
+ timedRedirection.name,
+ sidebar.name,
+ permanentNotifications.name,
+ timedRedirection.name,
+ signupConfirmation.name
+ ])
+ .service('$exceptionHandler', $exceptionHandler)
+ // Directives.
+ .directive('igniteAutoFocus', igniteAutoFocus)
+ .directive('igniteCopyToClipboard', igniteCopyToClipboard)
+ .directive('hideOnStateChange', igniteHideOnStateChange)
+ .directive('igniteMatch', igniteMatch)
+ .directive('igniteOnClickFocus', igniteOnClickFocus)
+ .directive('igniteOnEnter', igniteOnEnter)
+ .directive('igniteOnEnterFocusMove', igniteOnEnterFocusMove)
+ .directive('igniteOnEscape', igniteOnEscape)
+ .directive('igniteRetainSelection', igniteRetainSelection)
+ .directive('igniteOnFocusOut', igniteOnFocusOut)
+ .directive('btnIgniteLinkDashedSuccess', btnIgniteLink)
+ .directive('btnIgniteLinkDashedSecondary', btnIgniteLink)
+ // Services.
+ .service('IgniteErrorPopover', ErrorPopover)
+ .service('JavaTypes', JavaTypes)
+ .service('SqlTypes', SqlTypes)
+ .service('IgniteChartColors', ChartColors)
+ .service('IgniteConfirm', IgniteConfirm)
+ .service('Confirm', Confirm)
+ .service('IgniteConfirmBatch', ConfirmBatch)
+ .service('IgniteCopyToClipboard', CopyToClipboard)
+ .service('IgniteCountries', Countries)
+ .service('IgniteFocus', Focus)
+ .service('IgniteInetAddress', InetAddress)
+ .service('IgniteMessages', Messages)
+ .service('IgniteErrorParser', ErrorParser)
+ .service('IgniteModelNormalizer', ModelNormalizer)
+ .service('IgniteLegacyTable', LegacyTable)
+ .service('IgniteFormUtils', FormUtils)
+ .service('IgniteLegacyUtils', LegacyUtils)
+ .service('IgniteActivitiesUserDialog', IgniteActivitiesUserDialog)
+ .service('CSV', CSV)
+ .service('Store', Store)
+ // Filters.
+ .filter('byName', byName)
+ .filter('bytes', bytes)
+ .filter('defaultName', defaultName)
+ .filter('domainsValidation', domainsValidation)
+ .filter('duration', duration)
+ .filter('hasPojo', hasPojo)
+ .filter('uiGridSubcategories', uiGridSubcategories)
+ .filter('id8', id8)
+ .config(['$translateProvider', '$stateProvider', '$locationProvider', '$urlRouterProvider',
+ /**
+ * @param {angular.translate.ITranslateProvider} $translateProvider
+ * @param {import('@uirouter/angularjs').StateProvider} $stateProvider
+ * @param {ng.ILocationProvider} $locationProvider
+ * @param {import('@uirouter/angularjs').UrlRouterProvider} $urlRouterProvider
+ */
+ ($translateProvider, $stateProvider, $locationProvider, $urlRouterProvider) => {
+ $translateProvider.translations('en', i18n);
+ $translateProvider.preferredLanguage('en');
- // Set up the states.
- $stateProvider
- .state('base', {
- url: '',
- abstract: true,
- template: baseTemplate
- });
+ // Set up the states.
+ $stateProvider
+ .state('base', {
+ url: '',
+ abstract: true,
+ template: baseTemplate
+ });
- $urlRouterProvider.otherwise('/404');
- $locationProvider.html5Mode(true);
- }])
-.run(['$rootScope', '$state', 'gettingStarted',
- /**
- * @param {ng.IRootScopeService} $root
- * @param {import('@uirouter/angularjs').StateService} $state
- * @param {ReturnType<typeof import('./modules/getting-started/GettingStarted.provider').service>} gettingStarted
- */
- ($root, $state, gettingStarted) => {
- $root._ = _;
- $root.$state = $state;
- $root.gettingStarted = gettingStarted;
- }
-])
-.run(['$rootScope', 'AgentManager',
- /**
- * @param {ng.IRootScopeService} $root
- * @param {import('./modules/agent/AgentManager.service').default} agentMgr
- */
- ($root, agentMgr) => {
- let lastUser;
+ $urlRouterProvider.otherwise('/404');
+ $locationProvider.html5Mode(true);
+ }])
+ .run(['$rootScope', '$state', 'gettingStarted',
+ /**
+ * @param {ng.IRootScopeService} $root
+ * @param {import('@uirouter/angularjs').StateService} $state
+ * @param {ReturnType<typeof import('./modules/getting-started/GettingStarted.provider').service>} gettingStarted
+ */
+ ($root, $state, gettingStarted) => {
+ $root._ = _;
+ $root.$state = $state;
+ $root.gettingStarted = gettingStarted;
+ }
+ ])
+ .run(['$rootScope', 'AgentManager',
+ /**
+ * @param {ng.IRootScopeService} $root
+ * @param {import('./modules/agent/AgentManager.service').default} agentMgr
+ */
+ ($root, agentMgr) => {
+ let lastUser;
- $root.$on('user', (e, user) => {
- if (lastUser)
- return;
+ $root.$on('user', (e, user) => {
+ if (lastUser)
+ return;
- lastUser = user;
+ lastUser = user;
- agentMgr.connect();
- });
- }
-])
-.run(['$transitions',
- /**
- * @param {import('@uirouter/angularjs').TransitionService} $transitions
- */
- ($transitions) => {
- $transitions.onSuccess({ }, (trans) => {
- try {
- const {name, unsaved} = trans.$to();
- const params = trans.params();
+ agentMgr.connect();
+ });
+ }
+ ])
+ .run(['$transitions',
+ /**
+ * @param {import('@uirouter/angularjs').TransitionService} $transitions
+ */
+ ($transitions) => {
+ $transitions.onSuccess({ }, (trans) => {
+ try {
+ const {name, unsaved} = trans.$to();
+ const params = trans.params();
- if (unsaved)
- localStorage.removeItem('lastStateChangeSuccess');
- else
- localStorage.setItem('lastStateChangeSuccess', JSON.stringify({name, params}));
- }
- catch (ignored) {
- // No-op.
- }
- });
- }
-])
-.run(['$rootScope', '$http', '$state', 'IgniteMessages', 'User', 'IgniteNotebookData',
- /**
- * @param {ng.IRootScopeService} $root
- * @param {ng.IHttpService} $http
- * @param {ReturnType<typeof import('./services/Messages.service').default>} Messages
- */
- ($root, $http, $state, Messages, User, Notebook) => { // eslint-disable-line no-shadow
- $root.revertIdentity = () => {
- $http.get('/api/v1/admin/revert/identity')
- .then(() => User.load())
- .then(() => $state.go('base.settings.admin'))
- .then(() => Notebook.load())
- .catch(Messages.showError);
- };
- }
-])
-.run(['IgniteIcon',
- /**
- * @param {import('./components/ignite-icon/service').default} IgniteIcon
- */
- (IgniteIcon) => IgniteIcon.registerIcons(icons)
-]);
+ if (unsaved)
+ localStorage.removeItem('lastStateChangeSuccess');
+ else
+ localStorage.setItem('lastStateChangeSuccess', JSON.stringify({name, params}));
+ }
+ catch (ignored) {
+ // No-op.
+ }
+ });
+ }
+ ])
+ .run(['$rootScope', '$http', '$state', 'IgniteMessages', 'User', 'IgniteNotebookData',
+ /**
+ * @param {ng.IRootScopeService} $root
+ * @param {ng.IHttpService} $http
+ * @param {ReturnType<typeof import('./services/Messages.service').default>} Messages
+ */
+ ($root, $http, $state, Messages, User, Notebook) => { // eslint-disable-line no-shadow
+ $root.revertIdentity = () => {
+ $http.get('/api/v1/admin/revert/identity')
+ .then(() => User.load())
+ .then(() => $state.go('base.settings.admin'))
+ .then(() => Notebook.load())
+ .catch(Messages.showError);
+ };
+ }
+ ])
+ .run(['IgniteIcon',
+ /**
+ * @param {import('./components/ignite-icon/service').default} IgniteIcon
+ */
+ (IgniteIcon) => IgniteIcon.registerIcons(icons)
+ ]);
diff --git a/frontend/app/components/form-field/components/form-field-size/controller.ts b/frontend/app/components/form-field/components/form-field-size/controller.ts
index 84e3cde..fa36507 100644
--- a/frontend/app/components/form-field/components/form-field-size/controller.ts
+++ b/frontend/app/components/form-field/components/form-field-size/controller.ts
@@ -18,22 +18,33 @@
import get from 'lodash/get';
import {IInputErrorNotifier} from '../../../../types';
-export default class PCFormFieldSizeController implements IInputErrorNotifier {
+interface ISizeTypeOption {
+ label: string,
+ value: number
+}
+
+type ISizeType = Array<ISizeTypeOption>;
+
+interface ISizeTypes {
+ [name: string]: ISizeType
+}
+
+export default class PCFormFieldSizeController<T> implements IInputErrorNotifier {
ngModel: ng.INgModelController;
min?: number;
max?: number;
onScaleChange: ng.ICompiledExpression;
innerForm: ng.IFormController;
- inputElement?: HTMLInputElement;
autofocus?: boolean;
id = Math.random();
- sizesMenu?: ig.config.formFieldSize.ISizeTypes[keyof ig.config.formFieldSize.ISizeTypes];
- private _sizeScale: ig.config.formFieldSize.ISizeTypeOption;
+ inputElement?: HTMLInputElement;
+ sizesMenu?: Array<ISizeTypeOption>;
+ private _sizeScale: ISizeTypeOption;
value: number;
static $inject = ['$element', '$attrs'];
- static sizeTypes: ig.config.formFieldSize.ISizeTypes = {
+ static sizeTypes: ISizeTypes = {
bytes: [
{label: 'Kb', value: 1024},
{label: 'Mb', value: 1024 * 1024},
@@ -92,7 +103,7 @@
if ('min' in changes) this.ngModel.$validate();
}
- set sizeScale(value: ig.config.formFieldSize.ISizeTypeOption) {
+ set sizeScale(value: ISizeTypeOption) {
this._sizeScale = value;
if (this.onScaleChange) this.onScaleChange({$event: this.sizeScale});
if (this.ngModel) this.assignValue(this.ngModel.$viewValue);
diff --git a/frontend/app/components/form-field/igniteFormField.directive.ts b/frontend/app/components/form-field/igniteFormField.directive.ts
new file mode 100644
index 0000000..e85ed1a
--- /dev/null
+++ b/frontend/app/components/form-field/igniteFormField.directive.ts
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); 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.
+ */
+import {IInputErrorNotifier} from 'app/types';
+
+type IgniteFormFieldScope < T > = ng.IScope & ({$input: T} | {[name: string]: T});
+
+export class IgniteFormField<T> implements IInputErrorNotifier {
+ static animName = 'ignite-form-field__error-blink';
+ static eventName = 'webkitAnimationEnd oAnimationEnd msAnimationEnd animationend';
+ static $inject = ['$element', '$scope'];
+ onAnimEnd: () => any | null;
+
+ constructor(private $element: JQLite, private $scope: IgniteFormFieldScope<T>) {}
+
+ $postLink() {
+ this.onAnimEnd = () => this.$element.removeClass(IgniteFormField.animName);
+ this.$element.on(IgniteFormField.eventName, this.onAnimEnd);
+ }
+
+ $onDestroy() {
+ this.$element.off(IgniteFormField.eventName, this.onAnimEnd);
+ this.$element = this.onAnimEnd = null;
+ }
+
+ notifyAboutError() {
+ if (!this.$element)
+ return;
+
+ if (this.isTooltipValidation())
+ this.$element.find('.form-field__error [bs-tooltip]').trigger('mouseenter');
+ else
+ this.$element.addClass(IgniteFormField.animName);
+ }
+
+ hideError() {
+ if (!this.$element)
+ return;
+
+ if (this.isTooltipValidation())
+ this.$element.find('.form-field__error [bs-tooltip]').trigger('mouseleave');
+ }
+
+ isTooltipValidation(): boolean {
+ return !this.$element.parents('.theme--ignite-errors-horizontal').length;
+ }
+
+ /**
+ * Exposes control in $scope
+ */
+ exposeControl(control: ng.INgModelController, name = '$input') {
+ this.$scope[name] = control;
+ this.$scope.$on('$destroy', () => this.$scope[name] = null);
+ }
+}
+
+export function directive<T>(): ng.IDirective<IgniteFormFieldScope<T>> {
+ return {
+ restrict: 'C',
+ controller: IgniteFormField,
+ scope: true
+ };
+}
diff --git a/frontend/app/components/form-field/index.js b/frontend/app/components/form-field/index.js
index b1ee753..da49e2e 100644
--- a/frontend/app/components/form-field/index.js
+++ b/frontend/app/components/form-field/index.js
@@ -17,6 +17,7 @@
import angular from 'angular';
import './style.scss';
+import {directive as igniteFormField} from './igniteFormField.directive';
import {directive as showValidationError} from './showValidationError.directive';
import {directive as copyInputValue} from './copyInputValueButton.directive';
@@ -25,5 +26,6 @@
export default angular
.module('ignite-console.form-field', [])
.component('formFieldSize', formFieldSize)
+ .directive('igniteFormField', igniteFormField)
.directive('ngModel', showValidationError)
.directive('copyInputValueButton', copyInputValue);
diff --git a/frontend/app/components/page-admin/index.js b/frontend/app/components/page-admin/index.js
index 69816f6..46822b7 100644
--- a/frontend/app/components/page-admin/index.js
+++ b/frontend/app/components/page-admin/index.js
@@ -22,7 +22,7 @@
import {default as ActivitiesData} from 'app/core/activities/Activities.data';
/**
- * @param {uirouter.UIRouter} $uiRouter
+ * @param {import('@uirouter/angularjs').UIRouter} $uiRouter
* @param {ActivitiesData} ActivitiesData
*/
function registerActivitiesHook($uiRouter, ActivitiesData) {
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/index.js b/frontend/app/components/page-configure-advanced/components/cluster-edit-form/index.js
deleted file mode 100644
index c9b5b01..0000000
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/index.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import angular from 'angular';
-import component from './component';
-export default angular.module('configuration.cluster-edit-form', [])
-.component('clusterEditForm', component);
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/index.js b/frontend/app/components/page-configure-advanced/components/igfs-edit-form/index.js
deleted file mode 100644
index e187cc2..0000000
--- a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/index.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import angular from 'angular';
-import component from './component';
-export default angular.module('configuration.igfs-edit-form', [])
-.component('igfsEditForm', component);
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/controller.js b/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/controller.js
deleted file mode 100644
index 2cfe08a..0000000
--- a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/controller.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import {Subject, merge, combineLatest} from 'rxjs';
-import {tap, map, refCount, pluck, publishReplay, switchMap, distinctUntilChanged} from 'rxjs/operators';
-import naturalCompare from 'natural-compare-lite';
-import {removeClusterItems, advancedSaveCache} from 'app/components/page-configure/store/actionCreators';
-import ConfigureState from 'app/components/page-configure/services/ConfigureState';
-import ConfigSelectors from 'app/components/page-configure/store/selectors';
-import Caches from 'app/services/Caches';
-
-// Controller for Caches screen.
-export default class Controller {
- static $inject = [
- 'ConfigSelectors',
- 'configSelectionManager',
- '$uiRouter',
- '$transitions',
- 'ConfigureState',
- '$state',
- 'IgniteFormUtils',
- 'IgniteVersion',
- 'Caches'
- ];
-
- /**
- * @param {ConfigSelectors} ConfigSelectors
- * @param {object} configSelectionManager
- * @param {uirouter.UIRouter} $uiRouter
- * @param {uirouter.TransitionService} $transitions
- * @param {ConfigureState} ConfigureState
- * @param {uirouter.StateService} $state
- * @param {object} FormUtils
- * @param {object} Version
- * @param {Caches} Caches
- */
- constructor(ConfigSelectors, configSelectionManager, $uiRouter, $transitions, ConfigureState, $state, FormUtils, Version, Caches) {
- Object.assign(this, {configSelectionManager, FormUtils});
- this.$state = $state;
- this.$transitions = $transitions;
- this.$uiRouter = $uiRouter;
- this.ConfigSelectors = ConfigSelectors;
- this.ConfigureState = ConfigureState;
- this.Caches = Caches;
-
- this.visibleRows$ = new Subject();
- this.selectedRows$ = new Subject();
-
- /** @type {Array<uiGrid.IColumnDefOf<ig.config.cache.ShortCache>>} */
- this.cachesColumnDefs = [
- {
- name: 'name',
- displayName: 'Name',
- field: 'name',
- enableHiding: false,
- sort: {direction: 'asc', priority: 0},
- filter: {
- placeholder: 'Filter by name…'
- },
- sortingAlgorithm: naturalCompare,
- minWidth: 165
- },
- {
- name: 'cacheMode',
- displayName: 'Mode',
- field: 'cacheMode',
- multiselectFilterOptions: Caches.cacheModes,
- width: 160
- },
- {
- name: 'atomicityMode',
- displayName: 'Atomicity',
- field: 'atomicityMode',
- multiselectFilterOptions: Caches.atomicityModes,
- width: 160
- },
- {
- name: 'backups',
- displayName: 'Backups',
- field: 'backups',
- width: 130,
- enableFiltering: false,
- cellTemplate: `
- <div class="ui-grid-cell-contents">{{ grid.appScope.$ctrl.Caches.getCacheBackupsCount(row.entity) }}</div>
- `
- }
- ];
- }
-
- $onInit() {
- const cacheID$ = this.$uiRouter.globals.params$.pipe(
- pluck('cacheID'),
- publishReplay(1),
- refCount()
- );
-
- this.shortCaches$ = this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCurrentShortCaches);
- this.shortModels$ = this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCurrentShortModels);
- this.shortIGFSs$ = this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCurrentShortIGFSs);
- this.originalCache$ = cacheID$.pipe(
- distinctUntilChanged(),
- switchMap((id) => {
- return this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCacheToEdit(id));
- })
- );
-
- this.isNew$ = cacheID$.pipe(map((id) => id === 'new'));
- this.itemEditTitle$ = combineLatest(this.isNew$, this.originalCache$, (isNew, cache) => {
- return `${isNew ? 'Create' : 'Edit'} cache ${!isNew && cache.name ? `‘${cache.name}’` : ''}`;
- });
- this.selectionManager = this.configSelectionManager({
- itemID$: cacheID$,
- selectedItemRows$: this.selectedRows$,
- visibleRows$: this.visibleRows$,
- loadedItems$: this.shortCaches$
- });
-
- this.subscription = merge(
- this.originalCache$,
- this.selectionManager.editGoes$.pipe(tap((id) => this.edit(id))),
- this.selectionManager.editLeaves$.pipe(tap((options) => this.$state.go('base.configuration.edit.advanced.caches', null, options)))
- ).subscribe();
-
- this.isBlocked$ = cacheID$;
-
- this.tableActions$ = this.selectionManager.selectedItemIDs$.pipe(map((selectedItems) => [
- {
- action: 'Clone',
- click: () => this.clone(selectedItems),
- available: false
- },
- {
- action: 'Delete',
- click: () => {
- this.remove(selectedItems);
- },
- available: true
- }
- ]));
- }
-
- /**
- * @param {Array<string>} itemIDs
- */
- remove(itemIDs) {
- this.ConfigureState.dispatchAction(
- removeClusterItems(this.$uiRouter.globals.params.clusterID, 'caches', itemIDs, true, true)
- );
- }
-
- $onDestroy() {
- this.subscription.unsubscribe();
- this.visibleRows$.complete();
- this.selectedRows$.complete();
- }
-
- /**
- * @param {string} cacheID
- */
- edit(cacheID) {
- this.$state.go('base.configuration.edit.advanced.caches.cache', {cacheID});
- }
-
- save({cache, download}) {
- this.ConfigureState.dispatchAction(advancedSaveCache(cache, download));
- }
-}
diff --git a/frontend/app/components/page-configure/components/button-import-models/index.js b/frontend/app/components/page-configure/components/button-import-models/index.js
deleted file mode 100644
index b7ef527..0000000
--- a/frontend/app/components/page-configure/components/button-import-models/index.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import angular from 'angular';
-import {component} from './component';
-
-export default angular
-.module('configuration.button-import-models', [])
-.component(component.name, component);
diff --git a/frontend/app/components/page-configure/components/pcValidation.ts b/frontend/app/components/page-configure/components/pcValidation.ts
deleted file mode 100644
index 38c430a..0000000
--- a/frontend/app/components/page-configure/components/pcValidation.ts
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import angular from 'angular';
-import {IInputErrorNotifier} from '../../../types';
-
-export class IgniteFormField implements IInputErrorNotifier {
- static animName = 'ignite-form-field__error-blink';
- static eventName = 'webkitAnimationEnd oAnimationEnd msAnimationEnd animationend';
- static $inject = ['$element', '$scope'];
-
- onAnimEnd?: () => void;
-
- constructor(private $element: JQLite, private $scope: ng.IScope) {}
-
- $postLink() {
- this.onAnimEnd = () => this.$element.removeClass(IgniteFormField.animName);
- this.$element.on(IgniteFormField.eventName, this.onAnimEnd);
- }
-
- $onDestroy() {
- this.$element.off(IgniteFormField.eventName, this.onAnimEnd);
- this.$element = this.onAnimEnd = null;
- }
-
- notifyAboutError() {
- if (!this.$element)
- return;
-
- if (this.isTooltipValidation())
- this.$element.find('.form-field__error [bs-tooltip]').trigger('mouseenter');
- else
- this.$element.addClass(IgniteFormField.animName);
- }
-
- hideError() {
- if (!this.$element)
- return;
-
- if (this.isTooltipValidation())
- this.$element.find('.form-field__error [bs-tooltip]').trigger('mouseleave');
- }
-
- isTooltipValidation(): boolean {
- return !this.$element.parents('.theme--ignite-errors-horizontal').length;
- }
-
- /**
- * Exposes control in $scope
- */
- exposeControl(control: ng.INgModelController, name = '$input') {
- this.$scope[name] = control;
- this.$scope.$on('$destroy', () => this.$scope[name] = null);
- }
-}
-
-export default angular.module('ignite-console.page-configure.validation', [])
- .directive('pcNotInCollection', function() {
- class Controller {
- /** @type {ng.INgModelController} */
- ngModel;
- /** @type {Array} */
- items;
-
- $onInit() {
- this.ngModel.$validators.notInCollection = (item) => {
- if (!this.items)
- return true;
-
- return !this.items.includes(item);
- };
- }
-
- $onChanges() {
- this.ngModel.$validate();
- }
- }
-
- return {
- controller: Controller,
- require: {
- ngModel: 'ngModel'
- },
- bindToController: {
- items: '<pcNotInCollection'
- }
- };
- })
- .directive('pcInCollection', function() {
- class Controller {
- /** @type {ng.INgModelController} */
- ngModel;
- /** @type {Array} */
- items;
- /** @type {string} */
- pluck;
-
- $onInit() {
- this.ngModel.$validators.inCollection = (item) => {
- if (!this.items)
- return false;
-
- const items = this.pluck ? this.items.map((i) => i[this.pluck]) : this.items;
- return Array.isArray(item)
- ? item.every((i) => items.includes(i))
- : items.includes(item);
- };
- }
-
- $onChanges() {
- this.ngModel.$validate();
- }
- }
-
- return {
- controller: Controller,
- require: {
- ngModel: 'ngModel'
- },
- bindToController: {
- items: '<pcInCollection',
- pluck: '@?pcInCollectionPluck'
- }
- };
- })
- .directive('pcPowerOfTwo', function() {
- class Controller {
- /** @type {ng.INgModelController} */
- ngModel;
- $onInit() {
- this.ngModel.$validators.powerOfTwo = (value) => {
- return !value || ((value & -value) === value);
- };
- }
- }
-
- return {
- controller: Controller,
- require: {
- ngModel: 'ngModel'
- },
- bindToController: true
- };
- })
- .directive('bsCollapseTarget', function() {
- return {
- require: {
- bsCollapse: '^^bsCollapse'
- },
- bindToController: true,
- controller: ['$element', '$scope', function($element, $scope) {
- this.open = function() {
- const index = this.bsCollapse.$targets.indexOf($element);
- const isActive = this.bsCollapse.$targets.$active.includes(index);
- if (!isActive) this.bsCollapse.$setActive(index);
- };
- this.$onDestroy = () => this.open = $element = null;
- }]
- };
- })
- .directive('igniteFormField', function() {
- return {
- restrict: 'C',
- controller: IgniteFormField,
- scope: true
- };
- })
- .directive('isValidJavaIdentifier', ['IgniteLegacyUtils', function(LegacyUtils) {
- return {
- link(scope, el, attr, ngModel) {
- ngModel.$validators.isValidJavaIdentifier = (value) => LegacyUtils.VALID_JAVA_IDENTIFIER.test(value);
- },
- require: 'ngModel'
- };
- }])
- .directive('notJavaReservedWord', ['IgniteLegacyUtils', function(LegacyUtils) {
- return {
- link(scope, el, attr, ngModel) {
- ngModel.$validators.notJavaReservedWord = (value) => !LegacyUtils.JAVA_KEYWORDS.includes(value);
- },
- require: 'ngModel'
- };
- }]);
diff --git a/frontend/app/components/page-configure/index.d.ts b/frontend/app/components/page-configure/index.d.ts
deleted file mode 100644
index c0eca6a..0000000
--- a/frontend/app/components/page-configure/index.d.ts
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-/// <reference path="./types/uirouter.d.ts" />
-
-declare namespace ig {
- type menu < T > = Array<{value: T, label: string}>;
-
- namespace config {
- namespace formFieldSize {
- interface ISizeTypeOption {
- label: string,
- value: number
- }
- type ISizeType = Array<ISizeTypeOption>;
- interface ISizeTypes {
- [name: string]: ISizeType
- }
- }
-
- namespace cluster {
- export type DiscoveryKinds = 'Vm'
- | 'Multicast'
- | 'S3'
- | 'Cloud'
- | 'GoogleStorage'
- | 'Jdbc'
- | 'SharedFs'
- | 'ZooKeeper'
- | 'Kubernetes';
-
- export type LoadBalancingKinds = 'RoundRobin'
- | 'Adaptive'
- | 'WeightedRandom'
- | 'Custom';
-
- export type FailoverSPIs = 'JobStealing' | 'Never' | 'Always' | 'Custom';
-
- export interface ShortCluster {
- _id: string,
- name: string,
- discovery: DiscoveryKinds,
- caches: number,
- models: number,
- igfs: number
- }
- }
-
- namespace cache {
- type CacheModes = 'PARTITIONED' | 'REPLICATED' | 'LOCAL';
- type AtomicityModes = 'ATOMIC' | 'TRANSACTIONAL';
- export interface ShortCache {
- _id: string,
- cacheMode: CacheModes,
- atomicityMode: AtomicityModes,
- backups: number
- }
- }
-
- namespace model {
- type QueryMetadataTypes = 'Annotations' | 'Configuration';
- type DomainModelKinds = 'query' | 'store' | 'both';
- export interface KeyField {
- databaseFieldName: string,
- databaseFieldType: string,
- javaFieldName: string,
- javaFieldType: string
- }
- export interface ValueField {
- databaseFieldName: string,
- databaseFieldType: string,
- javaFieldName: string,
- javaFieldType: string
- }
- interface Field {
- name: string,
- className: string
- }
- interface Alias {
- field: string,
- alias: string
- }
- type IndexTypes = 'SORTED' | 'FULLTEXT' | 'GEOSPATIAL';
- export interface IndexField {
- _id: string,
- name?: string,
- direction?: boolean
- }
- export interface Index {
- _id: string,
- name: string,
- indexType: IndexTypes,
- fields: Array<IndexField>
- }
-
- export interface DomainModel {
- _id: string,
- space?: string,
- clusters?: Array<string>,
- caches?: Array<string>,
- queryMetadata?: QueryMetadataTypes,
- kind?: DomainModelKinds,
- tableName?: string,
- keyFieldName?: string,
- valueFieldName?: string,
- databaseSchema?: string,
- databaseTable?: string,
- keyType?: string,
- valueType?: string,
- keyFields?: Array<KeyField>,
- valueFields?: Array<ValueField>,
- queryKeyFields?: Array<string>,
- fields?: Array<Field>,
- aliases?: Array<Alias>,
- indexes?: Array<Index>,
- generatePojo?: boolean
- }
-
- export interface ShortDomainModel {
- _id: string,
- keyType: string,
- valueType: string,
- hasIndex: boolean
- }
- }
-
- namespace igfs {
- type DefaultModes = 'PRIMARY' | 'PROXY' | 'DUAL_SYNC' | 'DUAL_ASYNC';
- export interface ShortIGFS {
- _id: string,
- name: string,
- defaultMode: DefaultModes,
- affinnityGroupSize: number
- }
- }
- }
-}
-
-export as namespace ig
-export = ig
diff --git a/frontend/app/components/page-configure/types/uirouter.d.ts b/frontend/app/components/page-configure/types/uirouter.d.ts
deleted file mode 100644
index 90d8434..0000000
--- a/frontend/app/components/page-configure/types/uirouter.d.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import * as _uirouter from '@uirouter/angularjs'
-export as namespace uirouter
-export = _uirouter
\ No newline at end of file
diff --git a/frontend/app/directives/information/information.directive.js b/frontend/app/components/page-queries/components/queries-notebook/components/ignite-information/information.directive.js
similarity index 100%
rename from frontend/app/directives/information/information.directive.js
rename to frontend/app/components/page-queries/components/queries-notebook/components/ignite-information/information.directive.js
diff --git a/frontend/app/directives/information/information.pug b/frontend/app/components/page-queries/components/queries-notebook/components/ignite-information/information.pug
similarity index 100%
rename from frontend/app/directives/information/information.pug
rename to frontend/app/components/page-queries/components/queries-notebook/components/ignite-information/information.pug
diff --git a/frontend/app/directives/information/information.scss b/frontend/app/components/page-queries/components/queries-notebook/components/ignite-information/information.scss
similarity index 100%
rename from frontend/app/directives/information/information.scss
rename to frontend/app/components/page-queries/components/queries-notebook/components/ignite-information/information.scss
diff --git a/frontend/app/components/page-queries/components/queries-notebook/index.js b/frontend/app/components/page-queries/components/queries-notebook/index.js
index 57aa779..051c7fe 100644
--- a/frontend/app/components/page-queries/components/queries-notebook/index.js
+++ b/frontend/app/components/page-queries/components/queries-notebook/index.js
@@ -20,9 +20,11 @@
import { NotebookCtrl } from './controller';
import NotebookData from '../../notebook.data';
import {component as actions} from './components/query-actions-button/component';
+import {default as igniteInformation} from './components/ignite-information/information.directive';
import './style.scss';
export default angular.module('ignite-console.sql.notebook', [])
+ .directive('igniteInformation', igniteInformation)
.component('queryActionsButton', actions)
.component('queriesNotebook', {
controller: NotebookCtrl,
diff --git a/frontend/app/components/page-queries/index.ts b/frontend/app/components/page-queries/index.ts
index 2e25cb0..81dbcf2 100644
--- a/frontend/app/components/page-queries/index.ts
+++ b/frontend/app/components/page-queries/index.ts
@@ -27,7 +27,7 @@
import {navigationMenuItem, AppStore} from '../../store';
/**
- * @param {uirouter.UIRouter} $uiRouter
+ * @param {import('@uirouter/angularjs').UIRouter} $uiRouter
* @param {ActivitiesData} ActivitiesData
*/
function registerActivitiesHook($uiRouter, ActivitiesData) {
diff --git a/frontend/app/components/page-configure/components/button-download-project/component.js b/frontend/app/configuration/components/button-download-project/component.ts
similarity index 87%
rename from frontend/app/components/page-configure/components/button-download-project/component.js
rename to frontend/app/configuration/components/button-download-project/component.ts
index 235cfca..0aeaf8f 100644
--- a/frontend/app/components/page-configure/components/button-download-project/component.js
+++ b/frontend/app/configuration/components/button-download-project/component.ts
@@ -16,12 +16,15 @@
*/
import template from './template.pug';
+import ConfigurationDownload from '../../services/ConfigurationDownload';
export class ButtonDownloadProject {
static $inject = ['ConfigurationDownload'];
- constructor(ConfigurationDownload) {
- Object.assign(this, {ConfigurationDownload});
- }
+
+ constructor(private ConfigurationDownload: ConfigurationDownload) {}
+
+ cluster: any;
+
download() {
return this.ConfigurationDownload.downloadClusterConfiguration(this.cluster);
}
diff --git a/frontend/app/components/page-configure/components/button-download-project/index.js b/frontend/app/configuration/components/button-download-project/index.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/button-download-project/index.js
rename to frontend/app/configuration/components/button-download-project/index.ts
diff --git a/frontend/app/components/page-configure/components/button-download-project/template.pug b/frontend/app/configuration/components/button-download-project/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/button-download-project/template.pug
rename to frontend/app/configuration/components/button-download-project/template.pug
diff --git a/frontend/app/components/page-configure/components/button-import-models/component.js b/frontend/app/configuration/components/button-import-models/component.ts
similarity index 84%
rename from frontend/app/components/page-configure/components/button-import-models/component.js
rename to frontend/app/configuration/components/button-import-models/component.ts
index 28b7aa0..0127468 100644
--- a/frontend/app/components/page-configure/components/button-import-models/component.js
+++ b/frontend/app/configuration/components/button-import-models/component.ts
@@ -17,14 +17,17 @@
import template from './template.pug';
import './style.scss';
+import ModalImportModels from '../modal-import-models/service';
export class ButtonImportModels {
static $inject = ['ModalImportModels'];
- constructor(ModalImportModels) {
- Object.assign(this, {ModalImportModels});
- }
+
+ constructor(private ModalImportModels: ModalImportModels) {}
+
+ clusterId: string;
+
startImport() {
- return this.ModalImportModels.open(this.clusterID);
+ return this.ModalImportModels.open();
}
}
export const component = {
diff --git a/frontend/app/components/page-configure/components/button-preview-project/index.js b/frontend/app/configuration/components/button-import-models/index.ts
similarity index 89%
rename from frontend/app/components/page-configure/components/button-preview-project/index.js
rename to frontend/app/configuration/components/button-import-models/index.ts
index d5f6191..352f8a7 100644
--- a/frontend/app/components/page-configure/components/button-preview-project/index.js
+++ b/frontend/app/configuration/components/button-import-models/index.ts
@@ -19,5 +19,5 @@
import {component} from './component';
export default angular
-.module('configuration.button-preview-project', [])
-.component(component.name, component);
+ .module('configuration.button-import-models', [])
+ .component(component.name, component);
diff --git a/frontend/app/components/page-configure/components/button-import-models/style.scss b/frontend/app/configuration/components/button-import-models/style.scss
similarity index 100%
rename from frontend/app/components/page-configure/components/button-import-models/style.scss
rename to frontend/app/configuration/components/button-import-models/style.scss
diff --git a/frontend/app/components/page-configure/components/button-import-models/template.pug b/frontend/app/configuration/components/button-import-models/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/button-import-models/template.pug
rename to frontend/app/configuration/components/button-import-models/template.pug
diff --git a/frontend/app/components/page-configure/components/button-preview-project/component.js b/frontend/app/configuration/components/button-preview-project/component.ts
similarity index 87%
rename from frontend/app/components/page-configure/components/button-preview-project/component.js
rename to frontend/app/configuration/components/button-preview-project/component.ts
index 095cb0f..d0b50f0 100644
--- a/frontend/app/components/page-configure/components/button-preview-project/component.js
+++ b/frontend/app/configuration/components/button-preview-project/component.ts
@@ -16,12 +16,15 @@
*/
import template from './template.pug';
+import ModalPreviewProject from '../modal-preview-project/service';
export class ButtonPreviewProject {
static $inject = ['ModalPreviewProject'];
- constructor(ModalPreviewProject) {
- Object.assign(this, {ModalPreviewProject});
- }
+
+ constructor(private ModalPreviewProject: ModalPreviewProject) {}
+
+ cluster: any;
+
preview() {
return this.ModalPreviewProject.open(this.cluster);
}
diff --git a/frontend/app/components/page-configure/components/button-preview-project/index.js b/frontend/app/configuration/components/button-preview-project/index.ts
similarity index 89%
copy from frontend/app/components/page-configure/components/button-preview-project/index.js
copy to frontend/app/configuration/components/button-preview-project/index.ts
index d5f6191..31f76c9 100644
--- a/frontend/app/components/page-configure/components/button-preview-project/index.js
+++ b/frontend/app/configuration/components/button-preview-project/index.ts
@@ -19,5 +19,5 @@
import {component} from './component';
export default angular
-.module('configuration.button-preview-project', [])
-.component(component.name, component);
+ .module('configuration.button-preview-project', [])
+ .component(component.name, component);
diff --git a/frontend/app/components/page-configure/components/button-preview-project/template.pug b/frontend/app/configuration/components/button-preview-project/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/button-preview-project/template.pug
rename to frontend/app/configuration/components/button-preview-project/template.pug
diff --git a/frontend/app/components/page-configure/components/fakeUICanExit.spec.js b/frontend/app/configuration/components/fakeUICanExit.spec.js
similarity index 100%
rename from frontend/app/components/page-configure/components/fakeUICanExit.spec.js
rename to frontend/app/configuration/components/fakeUICanExit.spec.js
diff --git a/frontend/app/components/page-configure/components/fakeUICanExit.js b/frontend/app/configuration/components/fakeUICanExit.ts
similarity index 83%
rename from frontend/app/components/page-configure/components/fakeUICanExit.js
rename to frontend/app/configuration/components/fakeUICanExit.ts
index 246562f..02fb216 100644
--- a/frontend/app/components/page-configure/components/fakeUICanExit.js
+++ b/frontend/app/configuration/components/fakeUICanExit.ts
@@ -15,21 +15,16 @@
* limitations under the License.
*/
+import {TransitionService} from '@uirouter/angularjs';
+
export class FakeUiCanExitController {
static $inject = ['$element', '$transitions'];
static CALLBACK_NAME = 'uiCanExit';
- /** @type {string} Name of state to listen exit from */
- fromState;
+ /** Name of state to listen exit from */
+ fromState: string;
- /**
- * @param {JQLite} $element
- * @param {import('@uirouter/angularjs').TransitionService} $transitions
- */
- constructor($element, $transitions) {
- this.$element = $element;
- this.$transitions = $transitions;
- }
+ constructor(private $element: JQLite, private $transitions: TransitionService) {}
$onInit() {
const data = this.$element.data();
diff --git a/frontend/app/components/page-configure/components/formUICanExitGuard.js b/frontend/app/configuration/components/formUICanExitGuard.ts
similarity index 88%
rename from frontend/app/components/page-configure/components/formUICanExitGuard.js
rename to frontend/app/configuration/components/formUICanExitGuard.ts
index 7875546..0e1b14e 100644
--- a/frontend/app/components/page-configure/components/formUICanExitGuard.js
+++ b/frontend/app/configuration/components/formUICanExitGuard.ts
@@ -20,14 +20,7 @@
class FormUICanExitGuardController {
static $inject = ['$element', 'ConfigChangesGuard'];
- /**
- * @param {JQLite} $element
- * @param {ConfigChangesGuard} ConfigChangesGuard
- */
- constructor($element, ConfigChangesGuard) {
- this.$element = $element;
- this.ConfigChangesGuard = ConfigChangesGuard;
- }
+ constructor(private $element: JQLite, private ConfigChangesGuard: ConfigChangesGuard) {}
$onDestroy() {
this.$element = null;
diff --git a/frontend/app/components/page-configure/components/modal-import-models/component.js b/frontend/app/configuration/components/modal-import-models/component.js
similarity index 99%
rename from frontend/app/components/page-configure/components/modal-import-models/component.js
rename to frontend/app/configuration/components/modal-import-models/component.js
index 7181b54..098bb67 100644
--- a/frontend/app/components/page-configure/components/modal-import-models/component.js
+++ b/frontend/app/configuration/components/modal-import-models/component.js
@@ -30,9 +30,9 @@
// eslint-disable-next-line
import {UIRouter} from '@uirouter/angularjs'
import {default as IgniteConfirmBatch} from 'app/services/ConfirmBatch.service';
-import {default as ConfigSelectors} from 'app/components/page-configure/store/selectors';
-import {default as ConfigEffects} from 'app/components/page-configure/store/effects';
-import {default as ConfigureState} from 'app/components/page-configure/services/ConfigureState';
+import {default as ConfigSelectors} from '../../store/selectors';
+import {default as ConfigEffects} from '../../store/effects';
+import {default as ConfigureState} from '../../services/ConfigureState';
// eslint-disable-next-line
import {default as AgentManager} from 'app/modules/agent/AgentModal.service'
import {default as SqlTypes} from 'app/services/SqlTypes.service';
diff --git a/frontend/app/components/page-configure/components/modal-import-models/index.js b/frontend/app/configuration/components/modal-import-models/index.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-import-models/index.js
rename to frontend/app/configuration/components/modal-import-models/index.ts
diff --git a/frontend/app/components/page-configure/components/modal-import-models/selected-items-amount-indicator/component.js b/frontend/app/configuration/components/modal-import-models/selected-items-amount-indicator/component.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-import-models/selected-items-amount-indicator/component.js
rename to frontend/app/configuration/components/modal-import-models/selected-items-amount-indicator/component.ts
diff --git a/frontend/app/components/page-configure/components/modal-import-models/selected-items-amount-indicator/style.scss b/frontend/app/configuration/components/modal-import-models/selected-items-amount-indicator/style.scss
similarity index 97%
rename from frontend/app/components/page-configure/components/modal-import-models/selected-items-amount-indicator/style.scss
rename to frontend/app/configuration/components/modal-import-models/selected-items-amount-indicator/style.scss
index c5c2a05..6960ddb 100644
--- a/frontend/app/components/page-configure/components/modal-import-models/selected-items-amount-indicator/style.scss
+++ b/frontend/app/configuration/components/modal-import-models/selected-items-amount-indicator/style.scss
@@ -16,7 +16,6 @@
*/
selected-items-amount-indicator {
- font-family: Roboto;
font-size: 14px;
font-style: italic;
color: #757575;
diff --git a/frontend/app/components/page-configure/components/modal-import-models/selected-items-amount-indicator/template.pug b/frontend/app/configuration/components/modal-import-models/selected-items-amount-indicator/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-import-models/selected-items-amount-indicator/template.pug
rename to frontend/app/configuration/components/modal-import-models/selected-items-amount-indicator/template.pug
diff --git a/frontend/app/components/page-configure/components/modal-import-models/service.js b/frontend/app/configuration/components/modal-import-models/service.ts
similarity index 82%
rename from frontend/app/components/page-configure/components/modal-import-models/service.js
rename to frontend/app/configuration/components/modal-import-models/service.ts
index a76ec13..891b905 100644
--- a/frontend/app/components/page-configure/components/modal-import-models/service.js
+++ b/frontend/app/configuration/components/modal-import-models/service.ts
@@ -15,17 +15,22 @@
* limitations under the License.
*/
+import {UIRouter, StateDeclaration, StateService} from '@uirouter/angularjs';
+import AgentManager from 'app/modules/agent/AgentManager.service';
+
export default class ModalImportModels {
static $inject = ['$modal', '$q', '$uiRouter', 'AgentManager'];
- deferred;
+ deferred: ng.IDeferred<true>;
+ private _state: StateDeclaration;
+ private _modal: mgcrea.ngStrap.modal.IModal;
- constructor($modal, $q, $uiRouter, AgentManager) {
- this.$modal = $modal;
- this.$q = $q;
- this.$uiRouter = $uiRouter;
- this.AgentManager = AgentManager;
- }
+ constructor(
+ private $modal: mgcrea.ngStrap.modal.IModalService,
+ private $q: ng.IQService,
+ private $uiRouter: UIRouter,
+ private AgentManager: AgentManager
+ ) {}
_goToDynamicState() {
if (this.deferred)
@@ -65,7 +70,7 @@
cluster-id='$ctrl.$state.params.clusterID'
></modal-import-models>
`,
- controller: ['$state', function($state) {
+ controller: ['$state', function($state: StateService) {
this.$state = $state;
this.onHide = () => {
diff --git a/frontend/app/components/page-configure/components/modal-import-models/step-indicator/component.js b/frontend/app/configuration/components/modal-import-models/step-indicator/component.ts
similarity index 87%
rename from frontend/app/components/page-configure/components/modal-import-models/step-indicator/component.js
rename to frontend/app/configuration/components/modal-import-models/step-indicator/component.ts
index c37662c..8bc6898 100644
--- a/frontend/app/components/page-configure/components/modal-import-models/step-indicator/component.js
+++ b/frontend/app/configuration/components/modal-import-models/step-indicator/component.ts
@@ -18,8 +18,12 @@
import template from './template.pug';
import './style.scss';
-export class ModalImportModelsStepIndicator {
- isVisited(index) {
+export class ModalImportModelsStepIndicator<T> {
+ steps: Array<{value: T, label: string}>;
+
+ currentStep: T;
+
+ isVisited(index: number) {
return index <= this.steps.findIndex((step) => step.value === this.currentStep);
}
}
diff --git a/frontend/app/components/page-configure/components/modal-import-models/step-indicator/style.scss b/frontend/app/configuration/components/modal-import-models/step-indicator/style.scss
similarity index 98%
rename from frontend/app/components/page-configure/components/modal-import-models/step-indicator/style.scss
rename to frontend/app/configuration/components/modal-import-models/step-indicator/style.scss
index e841272..677b0f6 100644
--- a/frontend/app/components/page-configure/components/modal-import-models/step-indicator/style.scss
+++ b/frontend/app/configuration/components/modal-import-models/step-indicator/style.scss
@@ -27,7 +27,6 @@
$spline-height: 1px;
display: block;
- font-family: Roboto;
.step-indicator__steps {
display: flex;
diff --git a/frontend/app/components/page-configure/components/modal-import-models/step-indicator/template.pug b/frontend/app/configuration/components/modal-import-models/step-indicator/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-import-models/step-indicator/template.pug
rename to frontend/app/configuration/components/modal-import-models/step-indicator/template.pug
diff --git a/frontend/app/components/page-configure/components/modal-import-models/style.scss b/frontend/app/configuration/components/modal-import-models/style.scss
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-import-models/style.scss
rename to frontend/app/configuration/components/modal-import-models/style.scss
diff --git a/frontend/app/components/page-configure/components/modal-import-models/tables-action-cell/component.js b/frontend/app/configuration/components/modal-import-models/tables-action-cell/component.ts
similarity index 86%
rename from frontend/app/components/page-configure/components/modal-import-models/tables-action-cell/component.js
rename to frontend/app/configuration/components/modal-import-models/tables-action-cell/component.ts
index 17d4dc1..4fe2771 100644
--- a/frontend/app/components/page-configure/components/modal-import-models/tables-action-cell/component.js
+++ b/frontend/app/configuration/components/modal-import-models/tables-action-cell/component.ts
@@ -17,17 +17,22 @@
import template from './template.pug';
import './style.scss';
+import {Menu} from 'app/types';
const IMPORT_DM_NEW_CACHE = 1;
export class TablesActionCell {
static $inject = ['$element'];
- constructor($element) {
- Object.assign(this, {$element});
- }
+ constructor(private $element: JQLite) {}
- onClick(e) {
+ onEditStart?: ng.ICompiledExpression;
+ onCacheSelect?: ng.ICompiledExpression;
+ table: any;
+ caches: Menu<string>;
+ importActions: any;
+
+ onClick(e: JQueryEventObject) {
e.stopPropagation();
}
diff --git a/frontend/app/components/page-configure/components/modal-import-models/tables-action-cell/style.scss b/frontend/app/configuration/components/modal-import-models/tables-action-cell/style.scss
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-import-models/tables-action-cell/style.scss
rename to frontend/app/configuration/components/modal-import-models/tables-action-cell/style.scss
diff --git a/frontend/app/components/page-configure/components/modal-import-models/tables-action-cell/template.pug b/frontend/app/configuration/components/modal-import-models/tables-action-cell/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-import-models/tables-action-cell/template.pug
rename to frontend/app/configuration/components/modal-import-models/tables-action-cell/template.pug
diff --git a/frontend/app/components/page-configure/components/modal-import-models/template.tpl.pug b/frontend/app/configuration/components/modal-import-models/template.tpl.pug
similarity index 99%
rename from frontend/app/components/page-configure/components/modal-import-models/template.tpl.pug
rename to frontend/app/configuration/components/modal-import-models/template.tpl.pug
index 8aef347..ff3bafe 100644
--- a/frontend/app/components/page-configure/components/modal-import-models/template.tpl.pug
+++ b/frontend/app/configuration/components/modal-import-models/template.tpl.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
mixin td-ellipses-lbl(w, lbl)
td.td-ellipsis(width=`${w}` style=`min-width: ${w}; max-width: ${w}`)
diff --git a/frontend/app/components/page-configure/components/modal-preview-project/component.js b/frontend/app/configuration/components/modal-preview-project/component.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-preview-project/component.js
rename to frontend/app/configuration/components/modal-preview-project/component.ts
diff --git a/frontend/app/components/page-configure/components/modal-preview-project/controller.js b/frontend/app/configuration/components/modal-preview-project/controller.ts
similarity index 75%
rename from frontend/app/components/page-configure/components/modal-preview-project/controller.js
rename to frontend/app/configuration/components/modal-preview-project/controller.ts
index 1480fc1..8923128 100644
--- a/frontend/app/components/page-configure/components/modal-preview-project/controller.js
+++ b/frontend/app/configuration/components/modal-preview-project/controller.ts
@@ -17,6 +17,17 @@
import JSZip from 'jszip';
+import PageConfigure from '../../services/PageConfigure';
+import ConfigurationResourceFactory from '../../services/ConfigurationResource';
+import SummaryZipperFactory from '../../services/SummaryZipper';
+import IgniteVersion from 'app/services/Version.service';
+import ConfigurationDownload from '../../services/ConfigurationDownload';
+import IgniteLoadingFactory from 'app/modules/loading/loading.service';
+import MessagesFactory from 'app/services/Messages.service';
+import {Cluster, ShortCluster} from '../../types';
+
+type CluserLike = Cluster | ShortCluster;
+
export default class ModalPreviewProjectController {
static $inject = [
'PageConfigure',
@@ -29,9 +40,21 @@
'IgniteMessages'
];
- constructor(PageConfigure, IgniteConfigurationResource, summaryZipper, IgniteVersion, $scope, ConfigurationDownload, IgniteLoading, IgniteMessages) {
- Object.assign(this, {PageConfigure, IgniteConfigurationResource, summaryZipper, IgniteVersion, $scope, ConfigurationDownload, IgniteLoading, IgniteMessages});
- }
+ constructor(
+ private PageConfigure: PageConfigure,
+ private IgniteConfigurationResource: ReturnType<typeof ConfigurationResourceFactory>,
+ private summaryZipper: ReturnType<typeof SummaryZipperFactory>,
+ private IgniteVersion: IgniteVersion,
+ private $scope: ng.IScope,
+ private ConfigurationDownload: ConfigurationDownload,
+ private IgniteLoading: ReturnType<typeof IgniteLoadingFactory>,
+ private IgniteMessages: ReturnType<typeof MessagesFactory>
+ ) {}
+
+ onHide: ng.ICompiledExpression;
+ cluster: CluserLike;
+ isDemo: boolean;
+ fileText: string;
$onInit() {
this.treeOptions = {
@@ -62,7 +85,7 @@
});
}
- doStuff(cluster, isDemo) {
+ doStuff(cluster: CluserLike, isDemo: boolean) {
this.IgniteLoading.start('projectStructurePreview');
return this.PageConfigure.getClusterConfiguration({clusterID: cluster._id, isDemo})
.then((data) => {
@@ -116,7 +139,7 @@
})
.catch((e) => {
this.IgniteMessages.showError('Failed to generate project preview: ', e);
- this.onHide();
+ this.onHide({});
});
}
diff --git a/frontend/app/components/page-configure/components/modal-preview-project/index.js b/frontend/app/configuration/components/modal-preview-project/index.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-preview-project/index.js
rename to frontend/app/configuration/components/modal-preview-project/index.ts
diff --git a/frontend/app/components/page-configure/components/modal-preview-project/service.js b/frontend/app/configuration/components/modal-preview-project/service.ts
similarity index 87%
rename from frontend/app/components/page-configure/components/modal-preview-project/service.js
rename to frontend/app/configuration/components/modal-preview-project/service.ts
index 83cd4f4..57d21dc 100644
--- a/frontend/app/components/page-configure/components/modal-preview-project/service.js
+++ b/frontend/app/configuration/components/modal-preview-project/service.ts
@@ -15,18 +15,16 @@
* limitations under the License.
*/
+import {ShortCluster} from '../../types';
+
export default class ModalPreviewProject {
static $inject = ['$modal'];
- /**
- * @param {mgcrea.ngStrap.modal.IModalService} $modal
- */
- constructor($modal) {
- this.$modal = $modal;
- }
- /**
- * @param {ig.config.cluster.ShortCluster} cluster
- */
- open(cluster) {
+
+ modalInstance: mgcrea.ngStrap.modal.IModal;
+
+ constructor(private $modal: mgcrea.ngStrap.modal.IModalService) {}
+
+ open(cluster: ShortCluster) {
this.modalInstance = this.$modal({
locals: {
cluster
diff --git a/frontend/app/components/page-configure/components/modal-preview-project/style.scss b/frontend/app/configuration/components/modal-preview-project/style.scss
similarity index 94%
rename from frontend/app/components/page-configure/components/modal-preview-project/style.scss
rename to frontend/app/configuration/components/modal-preview-project/style.scss
index 33d2fcf..390e624 100644
--- a/frontend/app/components/page-configure/components/modal-preview-project/style.scss
+++ b/frontend/app/configuration/components/modal-preview-project/style.scss
@@ -21,7 +21,7 @@
}
.modal-preview-project-structure {
- @import '../../../../../public/stylesheets/variables.scss';
+ @import "public/stylesheets/variables.scss";
.modal-dialog {
width: 900px;
@@ -43,7 +43,6 @@
}
treecontrol {
white-space: nowrap;
- font-family: Roboto;
font-size: 12px;
color: #393939;
diff --git a/frontend/app/components/page-configure/components/modal-preview-project/template.pug b/frontend/app/configuration/components/modal-preview-project/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/modal-preview-project/template.pug
rename to frontend/app/configuration/components/modal-preview-project/template.pug
diff --git a/frontend/app/components/page-configure-advanced/component.js b/frontend/app/configuration/components/page-configure-advanced/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/component.js
rename to frontend/app/configuration/components/page-configure-advanced/component.ts
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/component.js b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/component.js
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/component.ts
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/controller.js b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/controller.ts
similarity index 83%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/controller.js
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/controller.ts
index c1beec6..5980613 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/controller.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/controller.ts
@@ -18,24 +18,33 @@
import cloneDeep from 'lodash/cloneDeep';
import get from 'lodash/get';
import {tap} from 'rxjs/operators';
+import {Menu} from 'app/types';
+
+import LegacyConfirmFactory from 'app/services/Confirm.service';
+import Version from 'app/services/Version.service';
+import Caches from '../../../../services/Caches';
+import FormUtilsFactory from 'app/services/FormUtils.service';
export default class CacheEditFormController {
- /** @type {ig.menu<string>} */
- modelsMenu;
- /** @type {ig.menu<string>} */
- igfssMenu;
- /**
- * IGFS IDs to validate against.
- * @type {Array<string>}
- */
- igfsIDs;
- /** @type {ng.ICompiledExpression} */
- onSave;
+ modelsMenu: Menu<string>;
+
+ igfssMenu: Menu<string>;
+
+ /** IGFS IDs to validate against. */
+ igfsIDs: string[];
+
+ onSave: ng.ICompiledExpression;
static $inject = ['IgniteConfirm', 'IgniteVersion', '$scope', 'Caches', 'IgniteFormUtils'];
- constructor(IgniteConfirm, IgniteVersion, $scope, Caches, IgniteFormUtils) {
- Object.assign(this, {IgniteConfirm, IgniteVersion, $scope, Caches, IgniteFormUtils});
- }
+
+ constructor(
+ private IgniteConfirm: ReturnType<typeof LegacyConfirmFactory>,
+ private IgniteVersion: Version,
+ private $scope: ng.IScope,
+ private Caches: Caches,
+ private IgniteFormUtils: ReturnType<typeof FormUtilsFactory>
+ ) {}
+
$onInit() {
this.available = this.IgniteVersion.available.bind(this.IgniteVersion);
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/index.ts
similarity index 87%
copy from frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js
copy to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/index.ts
index 900efcd..5e0ac6e 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/index.ts
@@ -17,5 +17,7 @@
import angular from 'angular';
import component from './component';
-export default angular.module('configuration.cache-edit-form', [])
-.component('cacheEditForm', component);
+
+export default angular
+ .module('configuration.cache-edit-form', [])
+ .component('cacheEditForm', component);
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/style.scss b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/style.scss
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/style.scss
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/style.scss
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/template.tpl.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/template.tpl.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/template.tpl.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/template.tpl.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/affinity.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/affinity.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/affinity.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/affinity.pug
index 68ee4d5..291d36d 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/affinity.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/affinity.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'affinity'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/concurrency.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/concurrency.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/concurrency.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/concurrency.pug
index bb355f0..425c2e5 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/concurrency.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/concurrency.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'concurrency'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/general.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/general.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/general.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/general.pug
index ba5d5ad..00a544f 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/general.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/general.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'general'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/memory.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/memory.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/memory.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/memory.pug
index 64c008e..f4403a7 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/memory.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/memory.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'memory'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-client.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-client.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-client.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-client.pug
index ed0e38a..a769d1c 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-client.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-client.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'clientNearCache'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-server.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-server.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-server.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-server.pug
index 3d2043a..d0da1d9 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-server.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/near-cache-server.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'serverNearCache'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/node-filter.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/node-filter.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/node-filter.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/node-filter.pug
index 32afac1..0aa5b83 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/node-filter.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/node-filter.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'nodeFilter'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/query.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/query.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/query.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/query.pug
index 8fedfc0..b0fe00b 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/query.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/query.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'query'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/rebalance.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/rebalance.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/rebalance.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/rebalance.pug
index feb7699..efe0e5f 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/rebalance.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/rebalance.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'rebalance'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/statistics.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/statistics.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/statistics.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/statistics.pug
index a6c55ab..0270e91 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/statistics.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/statistics.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'statistics'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/store.pug b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/store.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/store.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/store.pug
index 903ea08..e9a14e4 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/templates/store.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cache-edit-form/templates/store.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'store'
-var model = '$ctrl.clonedCache'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/component.js b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/component.js
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/component.ts
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/controller.spec.js b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/controller.spec.js
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/controller.spec.js
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/controller.spec.js
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/controller.js b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/controller.ts
similarity index 82%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/controller.js
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/controller.ts
index 7400b43..f1afd3c 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/controller.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/controller.ts
@@ -20,25 +20,32 @@
import isEqual from 'lodash/isEqual';
import _ from 'lodash';
import {tap} from 'rxjs/operators';
+import {ShortCache} from '../../../../types';
+import {Menu} from 'app/types';
+import Clusters from '../../../../services/Clusters';
+import LegacyUtils from 'app/services/LegacyUtils.service';
+import IgniteEventGroups from '../../../../generator/generator/defaults/Event-groups.service';
+import LegacyConfirm from 'app/services/Confirm.service';
+import Version from 'app/services/Version.service';
+import FormUtils from 'app/services/FormUtils.service';
export default class ClusterEditFormController {
- /** @type {Array<ig.config.cache.ShortCache>} */
- caches;
- /** @type {ig.menu<string>} */
- cachesMenu;
- /** @type {ig.menu<string>} */
- servicesCachesMenu;
- /** @type {ng.ICompiledExpression} */
- onSave;
+ caches: ShortCache[];
+ cachesMenu: Menu<string>;
+ servicesCachesMenu: Menu<string>;
+ onSave: ng.ICompiledExpression;
static $inject = ['IgniteLegacyUtils', 'IgniteEventGroups', 'IgniteConfirm', 'IgniteVersion', '$scope', 'Clusters', 'IgniteFormUtils'];
- /**
- * @param {import('app/services/Clusters').default} Clusters
- */
- constructor(IgniteLegacyUtils, IgniteEventGroups, IgniteConfirm, IgniteVersion, $scope, Clusters, IgniteFormUtils) {
- Object.assign(this, {IgniteLegacyUtils, IgniteEventGroups, IgniteConfirm, IgniteVersion, $scope, IgniteFormUtils});
- this.Clusters = Clusters;
- }
+
+ constructor(
+ private IgniteLegacyUtils: ReturnType<typeof LegacyUtils>,
+ private IgniteEventGroups: IgniteEventGroups,
+ private IgniteConfirm: ReturnType<typeof LegacyConfirm>,
+ private IgniteVersion: Version,
+ private $scope: ng.IScope,
+ private Clusters: Clusters,
+ private IgniteFormUtils: ReturnType<typeof FormUtils>
+ ) {}
$onDestroy() {
this.subscription.unsubscribe();
@@ -123,10 +130,10 @@
* The form should accept incoming cluster value if:
* 1. It has different _id ("new" to real id).
* 2. Different caches or models (imported from DB).
- * @param {Object} a Incoming value.
- * @param {Object} b Current value.
+ * @param a Incoming value.
+ * @param b Current value.
*/
- shouldOverwriteValue(a, b) {
+ shouldOverwriteValue<T>(a: T, b: T) {
return get(a, '_id') !== get(b, '_id') ||
!isEqual(get(a, 'caches'), get(b, 'caches')) ||
!isEqual(get(a, 'models'), get(b, 'models'));
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/index.ts
similarity index 87%
copy from frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js
copy to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/index.ts
index 900efcd..9ca47fa 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/index.ts
@@ -17,5 +17,6 @@
import angular from 'angular';
import component from './component';
-export default angular.module('configuration.cache-edit-form', [])
-.component('cacheEditForm', component);
+export default angular
+ .module('configuration.cluster-edit-form', [])
+ .component('clusterEditForm', component);
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/style.scss b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/style.scss
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/style.scss
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/style.scss
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/template.tpl.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/atomic.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/atomic.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/atomic.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/atomic.pug
index 9f5f138..d227c27 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/atomic.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/atomic.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'atomics'
-var model = '$ctrl.clonedCluster.atomicConfiguration'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/attributes.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/attributes.pug
similarity index 97%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/attributes.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/attributes.pug
index f704bc9..17a20f2 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/attributes.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/attributes.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'attributes'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/binary.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/binary.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/binary.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/binary.pug
index a20a3fd..aa74620 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/binary.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/binary.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'binary'
-var model = '$ctrl.clonedCluster.binaryConfiguration'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/cache-key-cfg.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/cache-key-cfg.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/cache-key-cfg.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/cache-key-cfg.pug
index a17e52a..04da3db 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/cache-key-cfg.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/cache-key-cfg.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'cacheKeyCfg'
-var model = '$ctrl.clonedCluster.cacheKeyConfiguration'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint.pug
index 760f996..1fbec3a 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'checkpoint'
-var model = '$ctrl.clonedCluster.checkpointSpi'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/fs.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/fs.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/fs.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/fs.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/jdbc.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/jdbc.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/jdbc.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/jdbc.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/s3.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/s3.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/s3.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/checkpoint/s3.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/client-connector.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/client-connector.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/client-connector.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/client-connector.pug
index 00c3563..d427665 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/client-connector.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/client-connector.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'clientConnector'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision.pug
index e3cacd3..c0e02be 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'collision'
-var model = '$ctrl.clonedCluster.collision'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision/custom.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision/custom.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision/custom.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision/custom.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision/fifo-queue.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision/fifo-queue.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision/fifo-queue.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision/fifo-queue.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision/job-stealing.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision/job-stealing.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision/job-stealing.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision/job-stealing.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision/priority-queue.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision/priority-queue.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/collision/priority-queue.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/collision/priority-queue.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug
index cdf473a..6a3de5b 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/communication.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'communication'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug
index fd52e5c..c04505d 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/connector.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'connector'
-var model = '$ctrl.clonedCluster.connector'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
index 8f9a33e..a7f0891 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/data-storage.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'dataStorageConfiguration'
-var model = '$ctrl.clonedCluster.dataStorageConfiguration'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/deployment.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/deployment.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/deployment.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/deployment.pug
index 1d93886..f7273ec 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/deployment.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/deployment.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'deployment'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/discovery.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/discovery.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/discovery.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/discovery.pug
index 0f777f9..0ff6313 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/discovery.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/discovery.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'discovery'
-var model = '$ctrl.clonedCluster.discovery'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/events.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/events.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/events.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/events.pug
index 9967af4..e422462 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/events.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/events.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'events'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
index 27797ed..2626778 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/failover.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var model = '$ctrl.clonedCluster'
-var form = 'failoverSpi'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general.pug
index 26a949a..227dee0 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'general'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/cloud.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/cloud.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/cloud.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/cloud.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/google.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/google.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/google.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/google.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/jdbc.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/jdbc.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/jdbc.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/jdbc.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/kubernetes.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/kubernetes.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/kubernetes.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/kubernetes.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/multicast.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/multicast.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/multicast.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/multicast.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/s3.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/s3.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/s3.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/s3.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/shared.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/vm.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/bounded-exponential-backoff.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/bounded-exponential-backoff.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/bounded-exponential-backoff.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/bounded-exponential-backoff.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/custom.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/custom.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/custom.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/custom.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/exponential-backoff.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/exponential-backoff.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/exponential-backoff.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/exponential-backoff.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/forever.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/forever.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/forever.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/forever.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/n-times.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/n-times.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/n-times.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/n-times.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/one-time.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/one-time.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/one-time.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/one-time.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/until-elapsed.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/until-elapsed.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/until-elapsed.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/general/discovery/zookeeper/retrypolicy/until-elapsed.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/hadoop.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/hadoop.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/hadoop.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/hadoop.pug
index 082f7bd..58bb21c 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/hadoop.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/hadoop.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'hadoop'
-var model = '$ctrl.clonedCluster.hadoopConfiguration'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/load-balancing.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/load-balancing.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/load-balancing.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/load-balancing.pug
index e96b016..240a2dd 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/load-balancing.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/load-balancing.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var model = '$ctrl.clonedCluster'
-var form = 'loadBalancing'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger.pug
index c30448c..231f50c 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'logger'
-var model = '$ctrl.clonedCluster.logger'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger/custom.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger/custom.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger/custom.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger/custom.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger/log4j.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger/log4j.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger/log4j.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger/log4j.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger/log4j2.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger/log4j2.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/logger/log4j2.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/logger/log4j2.pug
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/marshaller.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/marshaller.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/marshaller.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/marshaller.pug
index 23393b8..da2effd 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/marshaller.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/marshaller.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'marshaller'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/memory.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/memory.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/memory.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/memory.pug
index 7712cb7..cfdeb98 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/memory.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/memory.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'memoryConfiguration'
-var model = '$ctrl.clonedCluster.memoryConfiguration'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/metrics.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/metrics.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/metrics.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/metrics.pug
index f99efbb..cfc957e 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/metrics.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/metrics.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'metrics'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug
index d0e5d9f..9494e0d 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/misc.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'misc'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/mvcc.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/mvcc.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/mvcc.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/mvcc.pug
index 2799520..213b524 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/mvcc.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/mvcc.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'mvcc'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug
index 3f1bca5..6c06fc8 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/odbc.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'odbcConfiguration'
-var model = '$ctrl.clonedCluster.odbc'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/persistence.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/persistence.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/persistence.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/persistence.pug
index a15707a..a8ddd97 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/persistence.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/persistence.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'persistenceConfiguration'
-var model = '$ctrl.clonedCluster.persistenceStoreConfiguration'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/service.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/service.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/service.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/service.pug
index 6a2f8a6..9289d8d 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/service.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/service.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'serviceConfiguration'
-var model = '$ctrl.clonedCluster.serviceConfigurations'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/sql-connector.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/sql-connector.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/sql-connector.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/sql-connector.pug
index 3b2ca27..e8cd21b 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/sql-connector.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/sql-connector.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'query'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/ssl.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/ssl.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/ssl.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/ssl.pug
index f979124..a062425 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/ssl.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/ssl.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'sslConfiguration'
-var cluster = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/swap.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/swap.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/swap.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/swap.pug
index d39dae6..cd19366 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/swap.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/swap.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'swap'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/thread.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/thread.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/thread.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/thread.pug
index 76633f3..f26f3b9 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/thread.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/thread.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'pools'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/time.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/time.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/time.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/time.pug
index 7cfff3c..ec582ec 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/time.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/time.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'time'
-var model = '$ctrl.clonedCluster'
diff --git a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/transactions.pug b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/transactions.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/transactions.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/transactions.pug
index 48c8391..f69aa51 100644
--- a/frontend/app/components/page-configure-advanced/components/cluster-edit-form/templates/transactions.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/cluster-edit-form/templates/transactions.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'transactions'
-var model = '$ctrl.clonedCluster.transactionConfiguration'
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/component.js b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/component.js
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/component.ts
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/controller.js b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/controller.ts
similarity index 81%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/controller.js
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/controller.ts
index b787ce8..15c9d8c 100644
--- a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/controller.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/controller.ts
@@ -18,14 +18,24 @@
import cloneDeep from 'lodash/cloneDeep';
import get from 'lodash/get';
+import LegacyConfirmFactory from 'app/services/Confirm.service';
+import Version from 'app/services/Version.service';
+import FormUtilsFactory from 'app/services/FormUtils.service';
+import IGFSs from '../../../../services/IGFSs';
+
export default class IgfsEditFormController {
- /** @type {ng.ICompiledExpression} */
- onSave;
+ onSave: ng.ICompiledExpression;
static $inject = ['IgniteConfirm', 'IgniteVersion', '$scope', 'IGFSs', 'IgniteFormUtils'];
- constructor( IgniteConfirm, IgniteVersion, $scope, IGFSs, IgniteFormUtils) {
- Object.assign(this, { IgniteConfirm, IgniteVersion, $scope, IGFSs, IgniteFormUtils});
- }
+
+ constructor(
+ private IgniteConfirm: ReturnType<typeof LegacyConfirmFactory>,
+ private IgniteVersion: Version,
+ private $scope: ng.IScope,
+ private IGFSs: IGFSs,
+ private IgniteFormUtils: ReturnType<typeof FormUtilsFactory>
+ ) {}
+
$onInit() {
this.available = this.IgniteVersion.available.bind(this.IgniteVersion);
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/index.ts
similarity index 87%
rename from frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/index.ts
index 900efcd..ad3db52 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/index.ts
@@ -17,5 +17,6 @@
import angular from 'angular';
import component from './component';
-export default angular.module('configuration.cache-edit-form', [])
-.component('cacheEditForm', component);
+export default angular
+ .module('configuration.igfs-edit-form', [])
+ .component('igfsEditForm', component);
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/style.scss b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/style.scss
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/style.scss
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/style.scss
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/template.tpl.pug b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/template.tpl.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/template.tpl.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/template.tpl.pug
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/dual.pug b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/dual.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/dual.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/dual.pug
index 67839e8..c384d61 100644
--- a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/dual.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/dual.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'dualMode'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/fragmentizer.pug b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/fragmentizer.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/fragmentizer.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/fragmentizer.pug
index d1fa76a..047ece5 100644
--- a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/fragmentizer.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/fragmentizer.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'fragmentizer'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/general.pug b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/general.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/general.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/general.pug
index 777c123..84c2a62 100644
--- a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/general.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/general.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'general'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/ipc.pug b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/ipc.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/ipc.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/ipc.pug
index efae60c..2dafb71 100644
--- a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/ipc.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/ipc.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'ipc'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/misc.pug b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/misc.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/misc.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/misc.pug
index cf68e72..185b349 100644
--- a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/misc.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/misc.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'misc'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/secondary.pug b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/secondary.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/secondary.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/secondary.pug
index 4d779f1..7d42a04 100644
--- a/frontend/app/components/page-configure-advanced/components/igfs-edit-form/templates/secondary.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/igfs-edit-form/templates/secondary.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'secondaryFileSystem'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/model-edit-form/component.js b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/component.js
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/model-edit-form/component.js
rename to frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/component.js
diff --git a/frontend/app/components/page-configure-advanced/components/model-edit-form/controller.js b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/controller.ts
similarity index 80%
rename from frontend/app/components/page-configure-advanced/components/model-edit-form/controller.js
rename to frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/controller.ts
index 2b53d97..ba6ab89 100644
--- a/frontend/app/components/page-configure-advanced/components/model-edit-form/controller.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/controller.ts
@@ -19,36 +19,36 @@
import _ from 'lodash';
import get from 'lodash/get';
-import {default as Models} from 'app/services/Models';
-import {default as ModalImportModels} from 'app/components/page-configure/components/modal-import-models/service';
+import {default as Models} from '../../../../services/Models';
+import {default as ModalImportModels} from '../../../../components/modal-import-models/service';
import {default as IgniteVersion} from 'app/services/Version.service';
import {Confirm} from 'app/services/Confirm.service';
+import {DomainModel} from '../../../../types';
+import ErrorPopover from 'app/services/ErrorPopover.service';
+import LegacyUtilsFactory from 'app/services/LegacyUtils.service';
+import ConfigChangesGuard from '../../../../services/ConfigChangesGuard';
+import FormUtils from 'app/services/FormUtils.service';
-/** @type {ng.IComponentController} */
export default class ModelEditFormController {
- /** @type {ig.config.model.DomainModel} */
- model;
- /** @type {ng.ICompiledExpression} */
- onSave;
+ model: DomainModel;
+ onSave: ng.ICompiledExpression;
static $inject = ['ModalImportModels', 'IgniteErrorPopover', 'IgniteLegacyUtils', 'Confirm', 'ConfigChangesGuard', 'IgniteVersion', '$scope', 'Models', 'IgniteFormUtils'];
- /**
- * @param {ModalImportModels} ModalImportModels
- * @param {Confirm} Confirm
- * @param {ng.IScope} $scope
- * @param {Models} Models
- * @param {IgniteVersion} IgniteVersion
- */
- constructor(ModalImportModels, ErrorPopover, LegacyUtils, Confirm, ConfigChangesGuard, IgniteVersion, $scope, Models, IgniteFormUtils) {
- Object.assign(this, {ErrorPopover, LegacyUtils, ConfigChangesGuard, IgniteFormUtils});
- this.ModalImportModels = ModalImportModels;
- this.Confirm = Confirm;
- this.$scope = $scope;
- this.Models = Models;
- this.IgniteVersion = IgniteVersion;
- this.javaBuiltInClassesBase = LegacyUtils.javaBuiltInClasses;
- }
+ constructor(
+ private ModalImportModels: ModalImportModels,
+ private ErrorPopover: ErrorPopover,
+ private LegacyUtils: ReturnType<typeof LegacyUtilsFactory>,
+ private Confirm: Confirm,
+ private ConfigChangesGuard: ConfigChangesGuard,
+ private IgniteVersion: IgniteVersion,
+ private $scope: ng.IScope,
+ private Models: Models,
+ private IgniteFormUtils: ReturnType<typeof FormUtils>
+ ) {}
+
+ javaBuiltInClassesBase = this.LegacyUtils.javaBuiltInClasses;
+
$onInit() {
this.available = this.IgniteVersion.available.bind(this.IgniteVersion);
@@ -67,10 +67,9 @@
/**
* Create list of fields to show in index fields dropdown.
- * @param {string} prefix
- * @param {Array<string>} cur Current queryKeyFields
+ * @param cur Current queryKeyFields
*/
- fields(prefix, cur) {
+ fields(prefix: string, cur: string[]) {
const fields = this.$scope.backupItem
? _.map(this.$scope.backupItem.fields, (field) => ({value: field.name, label: field.name}))
: [];
@@ -90,10 +89,7 @@
return this.ModalImportModels.open();
}
- /**
- * @param {ig.config.model.DomainModel} item
- */
- checkQueryConfiguration(item) {
+ checkQueryConfiguration(item: DomainModel) {
if (item.queryMetadata === 'Configuration' && this.LegacyUtils.domainForQueryConfigured(item)) {
if (_.isEmpty(item.fields))
return this.ErrorPopover.show('queryFields', 'Query fields should not be empty', this.$scope.ui, 'query');
@@ -115,10 +111,7 @@
return true;
}
- /**
- * @param {ig.config.model.DomainModel} item
- */
- checkStoreConfiguration(item) {
+ checkStoreConfiguration(item: DomainModel) {
if (this.LegacyUtils.domainForStoreConfigured(item)) {
if (this.LegacyUtils.isEmptyString(item.databaseSchema))
return this.ErrorPopover.show('databaseSchemaInput', 'Database schema should not be empty', this.$scope.ui, 'store');
@@ -141,9 +134,8 @@
/**
* Check domain model logical consistency.
- * @param {ig.config.model.DomainModel} item
*/
- validate(item) {
+ validate(item: DomainModel) {
if (!this.checkQueryConfiguration(item))
return false;
@@ -173,10 +165,7 @@
this.cachesMenu = (changes.caches.currentValue || []).map((c) => ({label: c.name, value: c._id}));
}
- /**
- * @param {ig.config.model.DomainModel} model
- */
- onQueryFieldsChange(model) {
+ onQueryFieldsChange(model: DomainModel) {
this.$scope.backupItem = this.Models.removeInvalidFields(model);
}
@@ -194,7 +183,7 @@
this.onSave({$event: {model: cloneDeep(this.$scope.backupItem), download}});
}
- reset = (forReal) => forReal ? this.$scope.backupItem = cloneDeep(this.model) : void 0;
+ reset = (forReal: boolean) => forReal ? this.$scope.backupItem = cloneDeep(this.model) : void 0;
confirmAndReset() {
return this.Confirm.confirm('Are you sure you want to undo all changes for current model?').then(() => true)
diff --git a/frontend/app/components/page-configure-advanced/components/model-edit-form/index.js b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/index.js
similarity index 88%
rename from frontend/app/components/page-configure-advanced/components/model-edit-form/index.js
rename to frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/index.js
index e4d2195..f81b893 100644
--- a/frontend/app/components/page-configure-advanced/components/model-edit-form/index.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/index.js
@@ -17,5 +17,6 @@
import angular from 'angular';
import component from './component';
-export default angular.module('configuration.model-edit-form', [])
-.component('modelEditForm', component);
+export default angular
+ .module('configuration.model-edit-form', [])
+ .component('modelEditForm', component);
diff --git a/frontend/app/components/page-configure-advanced/components/model-edit-form/style.scss b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/style.scss
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/model-edit-form/style.scss
rename to frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/style.scss
diff --git a/frontend/app/components/page-configure-advanced/components/model-edit-form/template.tpl.pug b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/template.tpl.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/model-edit-form/template.tpl.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/template.tpl.pug
diff --git a/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/general.pug b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/general.pug
similarity index 98%
rename from frontend/app/components/page-configure-advanced/components/model-edit-form/templates/general.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/general.pug
index 589760e..0481da2 100644
--- a/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/general.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/general.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'general'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/query.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/query.pug
index ec9f1d4..2dbb565 100644
--- a/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/query.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/query.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'query'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/store.pug b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/store.pug
similarity index 99%
rename from frontend/app/components/page-configure-advanced/components/model-edit-form/templates/store.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/store.pug
index 0e1a44d..a9f9893 100644
--- a/frontend/app/components/page-configure-advanced/components/model-edit-form/templates/store.pug
+++ b/frontend/app/configuration/components/page-configure-advanced/components/model-edit-form/templates/store.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
-var form = 'store'
-var model = 'backupItem'
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/component.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/component.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/component.ts
diff --git a/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/controller.ts b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/controller.ts
new file mode 100644
index 0000000..f16b14a
--- /dev/null
+++ b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/controller.ts
@@ -0,0 +1,167 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); 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.
+ */
+
+import {Subject, merge, combineLatest} from 'rxjs';
+import {tap, map, refCount, pluck, publishReplay, switchMap, distinctUntilChanged} from 'rxjs/operators';
+import {UIRouter, TransitionService, StateService} from '@uirouter/angularjs';
+import naturalCompare from 'natural-compare-lite';
+import {removeClusterItems, advancedSaveCache} from '../../../../store/actionCreators';
+import ConfigureState from '../../../../services/ConfigureState';
+import ConfigSelectors from '../../../../store/selectors';
+import Caches from '../../../../services/Caches';
+import Version from 'app/services/Version.service';
+import {ShortCache} from '../../../../types';
+import {IColumnDefOf} from 'ui-grid';
+
+// Controller for Caches screen.
+export default class Controller {
+ static $inject = [
+ 'ConfigSelectors',
+ 'configSelectionManager',
+ '$uiRouter',
+ '$transitions',
+ 'ConfigureState',
+ '$state',
+ 'IgniteVersion',
+ 'Caches'
+ ];
+
+ constructor(
+ private ConfigSelectors,
+ private configSelectionManager,
+ private $uiRouter: UIRouter,
+ private $transitions: TransitionService,
+ private ConfigureState: ConfigureState,
+ private $state: StateService,
+ private Version: Version,
+ private Caches: Caches
+ ) {}
+
+ visibleRows$ = new Subject();
+ selectedRows$ = new Subject();
+
+ cachesColumnDefs: Array<IColumnDefOf<ShortCache>> = [
+ {
+ name: 'name',
+ displayName: 'Name',
+ field: 'name',
+ enableHiding: false,
+ sort: {direction: 'asc', priority: 0},
+ filter: {
+ placeholder: 'Filter by name…'
+ },
+ sortingAlgorithm: naturalCompare,
+ minWidth: 165
+ },
+ {
+ name: 'cacheMode',
+ displayName: 'Mode',
+ field: 'cacheMode',
+ multiselectFilterOptions: this.Caches.cacheModes,
+ width: 160
+ },
+ {
+ name: 'atomicityMode',
+ displayName: 'Atomicity',
+ field: 'atomicityMode',
+ multiselectFilterOptions: this.Caches.atomicityModes,
+ width: 160
+ },
+ {
+ name: 'backups',
+ displayName: 'Backups',
+ field: 'backups',
+ width: 130,
+ enableFiltering: false,
+ cellTemplate: `
+ <div class="ui-grid-cell-contents">{{ grid.appScope.$ctrl.Caches.getCacheBackupsCount(row.entity) }}</div>
+ `
+ }
+ ];
+
+ $onInit() {
+ const cacheID$ = this.$uiRouter.globals.params$.pipe(
+ pluck('cacheID'),
+ publishReplay(1),
+ refCount()
+ );
+
+ this.shortCaches$ = this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCurrentShortCaches);
+ this.shortModels$ = this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCurrentShortModels);
+ this.shortIGFSs$ = this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCurrentShortIGFSs);
+ this.originalCache$ = cacheID$.pipe(
+ distinctUntilChanged(),
+ switchMap((id) => {
+ return this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCacheToEdit(id));
+ })
+ );
+
+ this.isNew$ = cacheID$.pipe(map((id) => id === 'new'));
+ this.itemEditTitle$ = combineLatest(this.isNew$, this.originalCache$, (isNew, cache) => {
+ return `${isNew ? 'Create' : 'Edit'} cache ${!isNew && cache.name ? `‘${cache.name}’` : ''}`;
+ });
+ this.selectionManager = this.configSelectionManager({
+ itemID$: cacheID$,
+ selectedItemRows$: this.selectedRows$,
+ visibleRows$: this.visibleRows$,
+ loadedItems$: this.shortCaches$
+ });
+
+ this.subscription = merge(
+ this.originalCache$,
+ this.selectionManager.editGoes$.pipe(tap((id) => this.edit(id))),
+ this.selectionManager.editLeaves$.pipe(tap((options) => this.$state.go('base.configuration.edit.advanced.caches', null, options)))
+ ).subscribe();
+
+ this.isBlocked$ = cacheID$;
+
+ this.tableActions$ = this.selectionManager.selectedItemIDs$.pipe(map((selectedItems) => [
+ {
+ action: 'Clone',
+ click: () => this.clone(selectedItems),
+ available: false
+ },
+ {
+ action: 'Delete',
+ click: () => {
+ this.remove(selectedItems);
+ },
+ available: true
+ }
+ ]));
+ }
+
+ remove(itemIDs: Array<string>) {
+ this.ConfigureState.dispatchAction(
+ removeClusterItems(this.$uiRouter.globals.params.clusterID, 'caches', itemIDs, true, true)
+ );
+ }
+
+ $onDestroy() {
+ this.subscription.unsubscribe();
+ this.visibleRows$.complete();
+ this.selectedRows$.complete();
+ }
+
+ edit(cacheID: string) {
+ this.$state.go('base.configuration.edit.advanced.caches.cache', {cacheID});
+ }
+
+ save({cache, download}) {
+ this.ConfigureState.dispatchAction(advancedSaveCache(cache, download));
+ }
+}
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/index.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/index.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/index.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/index.ts
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/template.pug b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/template.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-caches/template.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-caches/template.pug
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/component.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/component.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/component.ts
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.ts
similarity index 75%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.ts
index 2aae041..dfbc38b 100644
--- a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/controller.ts
@@ -15,25 +15,21 @@
* limitations under the License.
*/
-import {default as ConfigSelectors} from 'app/components/page-configure/store/selectors';
-import {default as ConfigureState} from 'app/components/page-configure/services/ConfigureState';
-import {advancedSaveCluster} from 'app/components/page-configure/store/actionCreators';
+import {default as ConfigSelectors} from '../../../../store/selectors';
+import {default as ConfigureState} from '../../../../services/ConfigureState';
+import {advancedSaveCluster} from '../../../../store/actionCreators';
import {take, pluck, switchMap, map, filter, distinctUntilChanged, publishReplay, refCount} from 'rxjs/operators';
+import {UIRouter} from '@uirouter/angularjs';
// Controller for Clusters screen.
export default class PageConfigureAdvancedCluster {
static $inject = ['$uiRouter', 'ConfigSelectors', 'ConfigureState'];
- /**
- * @param {uirouter.UIRouter} $uiRouter
- * @param {ConfigSelectors} ConfigSelectors
- * @param {ConfigureState} ConfigureState
- */
- constructor($uiRouter, ConfigSelectors, ConfigureState) {
- this.$uiRouter = $uiRouter;
- this.ConfigSelectors = ConfigSelectors;
- this.ConfigureState = ConfigureState;
- }
+ constructor(
+ private $uiRouter: UIRouter,
+ private ConfigSelectors: ConfigSelectors,
+ private ConfigureState: ConfigureState
+ ) {}
$onInit() {
const clusterID$ = this.$uiRouter.globals.params$.pipe(
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/index.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/index.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/index.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/index.ts
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/template.pug b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/template.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-cluster/template.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-cluster/template.pug
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/component.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/component.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/component.ts
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.ts
similarity index 81%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.ts
index 0e6345b..742791e 100644
--- a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/controller.ts
@@ -19,39 +19,41 @@
import {tap, map, distinctUntilChanged, pluck, publishReplay, refCount, switchMap} from 'rxjs/operators';
import naturalCompare from 'natural-compare-lite';
import get from 'lodash/get';
-import {removeClusterItems, advancedSaveIGFS} from 'app/components/page-configure/store/actionCreators';
-import ConfigureState from 'app/components/page-configure/services/ConfigureState';
-import ConfigSelectors from 'app/components/page-configure/store/selectors';
-import IGFSs from 'app/services/IGFSs';
+import {removeClusterItems, advancedSaveIGFS} from '../../../../store/actionCreators';
+import ConfigureState from '../../../../services/ConfigureState';
+import ConfigSelectors from '../../../../store/selectors';
+import IGFSs from '../../../../services/IGFSs';
+import {UIRouter, StateService} from '@uirouter/angularjs';
+import ConfigSelectionManager from '../../../../services/ConfigSelectionManager';
+import {ShortIGFS} from '../../../../types';
+import {IColumnDefOf} from 'ui-grid';
export default class PageConfigureAdvancedIGFS {
static $inject = ['ConfigSelectors', 'ConfigureState', '$uiRouter', 'IGFSs', '$state', 'configSelectionManager'];
- /**
- * @param {ConfigSelectors} ConfigSelectors
- * @param {ConfigureState} ConfigureState
- * @param {uirouter.UIRouter} $uiRouter
- * @param {IGFSs} IGFSs
- * @param {uirouter.StateService} $state
- */
- constructor(ConfigSelectors, ConfigureState, $uiRouter, IGFSs, $state, configSelectionManager) {
- this.ConfigSelectors = ConfigSelectors;
- this.ConfigureState = ConfigureState;
- this.$uiRouter = $uiRouter;
- this.IGFSs = IGFSs;
- this.$state = $state;
- this.configSelectionManager = configSelectionManager;
- }
+ constructor(
+ private ConfigSelectors: ConfigSelectors,
+ private ConfigureState: ConfigureState,
+ private $uiRouter: UIRouter,
+ private IGFSs: IGFSs,
+ private $state: StateService,
+ private configSelectionManager: ReturnType<typeof ConfigSelectionManager>
+ ) {}
+
+ columnDefs: Array<IColumnDefOf<ShortIGFS>>;
+
+ shortItems$: Observable<ShortIGFS>;
+
$onDestroy() {
this.subscription.unsubscribe();
this.visibleRows$.complete();
this.selectedRows$.complete();
}
+
$onInit() {
this.visibleRows$ = new Subject();
this.selectedRows$ = new Subject();
- /** @type {Array<uiGrid.IColumnDefOf<ig.config.igfs.ShortIGFS>>} */
this.columnDefs = [
{
name: 'name',
@@ -83,7 +85,6 @@
this.itemID$ = this.$uiRouter.globals.params$.pipe(pluck('igfsID'));
- /** @type {Observable<ig.config.igfs.ShortIGFS>} */
this.shortItems$ = this.ConfigureState.state$.pipe(
this.ConfigSelectors.selectCurrentShortIGFSs,
map((items = []) => items.map((i) => ({
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/index.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/index.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/index.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/index.ts
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/template.pug b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/template.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-igfs/template.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-igfs/template.pug
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/component.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/component.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/component.ts
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/controller.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/controller.ts
similarity index 78%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/controller.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/controller.ts
index c2e30cf..84d6891 100644
--- a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/controller.js
+++ b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/controller.ts
@@ -24,43 +24,46 @@
import keyCellTemplate from './keyCell.template.pug';
import valueCellTemplate from './valueCell.template.pug';
-import {removeClusterItems, advancedSaveModel} from 'app/components/page-configure/store/actionCreators';
+import {removeClusterItems, advancedSaveModel} from '../../../../store/actionCreators';
-import {default as ConfigSelectors} from 'app/components/page-configure/store/selectors';
-import {default as ConfigureState} from 'app/components/page-configure/services/ConfigureState';
-import {default as Models} from 'app/services/Models';
+import {default as ConfigSelectors} from '../../../../store/selectors';
+import {default as ConfigureState} from '../../../../services/ConfigureState';
+import {default as Models} from '../../../../services/Models';
+
+import {UIRouter, StateService} from '@uirouter/angularjs';
+import {ShortDomainModel, DomainModel, ShortCache} from '../../../../types';
+import {IColumnDefOf} from 'ui-grid';
+import ConfigSelectionManager from '../../../../services/ConfigSelectionManager';
export default class PageConfigureAdvancedModels {
static $inject = ['ConfigSelectors', 'ConfigureState', '$uiRouter', 'Models', '$state', 'configSelectionManager'];
- /**
- * @param {ConfigSelectors} ConfigSelectors
- * @param {ConfigureState} ConfigureState
- * @param {Models} Models
- * @param {uirouter.UIRouter} $uiRouter
- * @param {uirouter.StateService} $state
- */
- constructor(ConfigSelectors, ConfigureState, $uiRouter, Models, $state, configSelectionManager) {
- this.$state = $state;
- this.$uiRouter = $uiRouter;
- this.configSelectionManager = configSelectionManager;
- this.ConfigSelectors = ConfigSelectors;
- this.ConfigureState = ConfigureState;
- this.Models = Models;
- }
+ constructor(
+ private ConfigSelectors: ConfigSelectors,
+ private ConfigureState: ConfigureState,
+ private $uiRouter: UIRouter,
+ private Models: Models,
+ private $state: StateService,
+ private configSelectionManager: ReturnType<typeof ConfigSelectionManager>
+ ) {}
+ visibleRows$: Subject<Array<ShortDomainModel>>;
+ selectedRows$: Subject<Array<ShortDomainModel>>;
+ columnDefs: Array<IColumnDefOf<ShortDomainModel>>;
+ itemID$: Observable<string>;
+ shortItems$: Observable<Array<ShortDomainModel>>;
+ shortCaches$: Observable<Array<ShortCache>>;
+ originalItem$: Observable<DomainModel>;
+
$onDestroy() {
this.subscription.unsubscribe();
this.visibleRows$.complete();
this.selectedRows$.complete();
}
$onInit() {
- /** @type {Subject<Array<ig.config.model.ShortDomainModel>>} */
this.visibleRows$ = new Subject();
- /** @type {Subject<Array<ig.config.model.ShortDomainModel>>} */
this.selectedRows$ = new Subject();
- /** @type {Array<uiGrid.IColumnDefOf<ig.config.model.ShortDomainModel>>} */
this.columnDefs = [
{
name: 'hasIndex',
@@ -98,10 +101,8 @@
}
];
- /** @type {Observable<string>} */
this.itemID$ = this.$uiRouter.globals.params$.pipe(pluck('modelID'));
- /** @type {Observable<Array<ig.config.model.ShortDomainModel>>} */
this.shortItems$ = this.ConfigureState.state$.pipe(
this.ConfigSelectors.selectCurrentShortModels,
tap((shortModels = []) => {
@@ -114,7 +115,6 @@
this.shortCaches$ = this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCurrentShortCaches);
- /** @type {Observable<ig.config.model.DomainModel>} */
this.originalItem$ = this.itemID$.pipe(
distinctUntilChanged(),
switchMap((id) => {
@@ -168,10 +168,7 @@
this.ConfigureState.dispatchAction(advancedSaveModel(model, download));
}
- /**
- * @param {Array<string>} itemIDs
- */
- remove(itemIDs) {
+ remove(itemIDs: Array<string>) {
this.ConfigureState.dispatchAction(
removeClusterItems(this.$uiRouter.globals.params.clusterID, 'models', itemIDs, true, true)
);
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/hasIndex.template.pug b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/hasIndex.template.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/hasIndex.template.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/hasIndex.template.pug
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/index.js b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/index.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/index.js
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/index.ts
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/keyCell.template.pug b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/keyCell.template.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/keyCell.template.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/keyCell.template.pug
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/style.scss b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/style.scss
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/style.scss
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/style.scss
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/template.pug b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/template.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/template.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/template.pug
diff --git a/frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/valueCell.template.pug b/frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/valueCell.template.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/components/page-configure-advanced-models/valueCell.template.pug
rename to frontend/app/configuration/components/page-configure-advanced/components/page-configure-advanced-models/valueCell.template.pug
diff --git a/frontend/app/components/page-configure-advanced/controller.js b/frontend/app/configuration/components/page-configure-advanced/controller.ts
similarity index 95%
rename from frontend/app/components/page-configure-advanced/controller.js
rename to frontend/app/configuration/components/page-configure-advanced/controller.ts
index ebd7f99..2efab10 100644
--- a/frontend/app/components/page-configure-advanced/controller.js
+++ b/frontend/app/configuration/components/page-configure-advanced/controller.ts
@@ -23,6 +23,8 @@
{ text: 'IGFS', sref: 'base.configuration.edit.advanced.igfs' }
];
+ menuItems: Array<{text: string, sref: string}>
+
$onInit() {
this.menuItems = this.constructor.menuItems;
}
diff --git a/frontend/app/components/page-configure-advanced/index.js b/frontend/app/configuration/components/page-configure-advanced/index.ts
similarity index 100%
rename from frontend/app/components/page-configure-advanced/index.js
rename to frontend/app/configuration/components/page-configure-advanced/index.ts
diff --git a/frontend/app/components/page-configure-advanced/style.scss b/frontend/app/configuration/components/page-configure-advanced/style.scss
similarity index 97%
rename from frontend/app/components/page-configure-advanced/style.scss
rename to frontend/app/configuration/components/page-configure-advanced/style.scss
index 40cd713..1b9c2ff 100644
--- a/frontend/app/components/page-configure-advanced/style.scss
+++ b/frontend/app/configuration/components/page-configure-advanced/style.scss
@@ -16,7 +16,7 @@
*/
page-configure-advanced {
- @import '../../../public/stylesheets/variables.scss';
+ @import "public/stylesheets/variables.scss";
$nav-height: 46px;
@@ -96,7 +96,6 @@
}
.pca-panel {
- font-family: Roboto;
border-radius: 0 0 4px 4px;
background-color: #ffffff;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
diff --git a/frontend/app/components/page-configure-advanced/template.pug b/frontend/app/configuration/components/page-configure-advanced/template.pug
similarity index 100%
rename from frontend/app/components/page-configure-advanced/template.pug
rename to frontend/app/configuration/components/page-configure-advanced/template.pug
diff --git a/frontend/app/components/page-configure-basic/component.js b/frontend/app/configuration/components/page-configure-basic/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-basic/component.js
rename to frontend/app/configuration/components/page-configure-basic/component.ts
diff --git a/frontend/app/components/page-configure-basic/controller.spec.js b/frontend/app/configuration/components/page-configure-basic/controller.spec.js
similarity index 100%
rename from frontend/app/components/page-configure-basic/controller.spec.js
rename to frontend/app/configuration/components/page-configure-basic/controller.spec.js
diff --git a/frontend/app/components/page-configure-basic/controller.js b/frontend/app/configuration/components/page-configure-basic/controller.ts
similarity index 82%
rename from frontend/app/components/page-configure-basic/controller.js
rename to frontend/app/configuration/components/page-configure-basic/controller.ts
index 14b3a69..24b16bb 100644
--- a/frontend/app/components/page-configure-basic/controller.js
+++ b/frontend/app/configuration/components/page-configure-basic/controller.ts
@@ -25,50 +25,38 @@
removeClusterItems,
basicSave,
basicSaveAndDownload
-} from 'app/components/page-configure/store/actionCreators';
+} from '../../store/actionCreators';
import {Confirm} from 'app/services/Confirm.service';
-import ConfigureState from 'app/components/page-configure/services/ConfigureState';
-import ConfigSelectors from 'app/components/page-configure/store/selectors';
-import Caches from 'app/services/Caches';
-import Clusters from 'app/services/Clusters';
+import ConfigureState from '../../services/ConfigureState';
+import ConfigSelectors from '../../store/selectors';
+import Caches from '../../services/Caches';
+import Clusters from '../../services/Clusters';
import IgniteVersion from 'app/services/Version.service';
-import {default as ConfigChangesGuard} from 'app/components/page-configure/services/ConfigChangesGuard';
+import {default as ConfigChangesGuard} from '../../services/ConfigChangesGuard';
+import {UIRouter} from '@uirouter/angularjs';
+import FormUtils from 'app/services/FormUtils.service';
export default class PageConfigureBasicController {
- /** @type {ng.IFormController} */
- form;
+ form: ng.IFormController;
static $inject = [
'Confirm', '$uiRouter', 'ConfigureState', 'ConfigSelectors', 'Clusters', 'Caches', 'IgniteVersion', '$element', 'ConfigChangesGuard', 'IgniteFormUtils', '$scope'
];
- /**
- * @param {Confirm} Confirm
- * @param {uirouter.UIRouter} $uiRouter
- * @param {ConfigureState} ConfigureState
- * @param {ConfigSelectors} ConfigSelectors
- * @param {Clusters} Clusters
- * @param {Caches} Caches
- * @param {IgniteVersion} IgniteVersion
- * @param {JQLite} $element
- * @param {ConfigChangesGuard} ConfigChangesGuard
- * @param {object} IgniteFormUtils
- * @param {ng.IScope} $scope
- */
- constructor(Confirm, $uiRouter, ConfigureState, ConfigSelectors, Clusters, Caches, IgniteVersion, $element, ConfigChangesGuard, IgniteFormUtils, $scope) {
- Object.assign(this, {IgniteFormUtils});
- this.ConfigChangesGuard = ConfigChangesGuard;
- this.$uiRouter = $uiRouter;
- this.$scope = $scope;
- this.$element = $element;
- this.Caches = Caches;
- this.Clusters = Clusters;
- this.Confirm = Confirm;
- this.ConfigureState = ConfigureState;
- this.ConfigSelectors = ConfigSelectors;
- this.IgniteVersion = IgniteVersion;
- }
+ constructor(
+ private Confirm: Confirm,
+ private $uiRouter: UIRouter,
+ private ConfigureState: ConfigureState,
+ private ConfigSelectors: ConfigSelectors,
+ private Clusters: Clusters,
+ private Caches: Caches,
+ private IgniteVersion: IgniteVersion,
+ private $element: JQLite,
+ private ConfigChangesGuard: ReturnType<typeof ConfigChangesGuard>,
+ private IgniteFormUtils: ReturnType<typeof FormUtils>,
+ private $scope: ng.IScope
+ ) {}
$onDestroy() {
this.subscription.unsubscribe();
diff --git a/frontend/app/components/page-configure-basic/index.js b/frontend/app/configuration/components/page-configure-basic/index.ts
similarity index 100%
rename from frontend/app/components/page-configure-basic/index.js
rename to frontend/app/configuration/components/page-configure-basic/index.ts
diff --git a/frontend/app/components/page-configure-basic/reducer.spec.js b/frontend/app/configuration/components/page-configure-basic/reducer.spec.js
similarity index 100%
rename from frontend/app/components/page-configure-basic/reducer.spec.js
rename to frontend/app/configuration/components/page-configure-basic/reducer.spec.js
diff --git a/frontend/app/components/page-configure-basic/reducer.js b/frontend/app/configuration/components/page-configure-basic/reducer.ts
similarity index 100%
rename from frontend/app/components/page-configure-basic/reducer.js
rename to frontend/app/configuration/components/page-configure-basic/reducer.ts
diff --git a/frontend/app/components/page-configure-basic/style.scss b/frontend/app/configuration/components/page-configure-basic/style.scss
similarity index 100%
rename from frontend/app/components/page-configure-basic/style.scss
rename to frontend/app/configuration/components/page-configure-basic/style.scss
diff --git a/frontend/app/components/page-configure-basic/template.pug b/frontend/app/configuration/components/page-configure-basic/template.pug
similarity index 99%
rename from frontend/app/components/page-configure-basic/template.pug
rename to frontend/app/configuration/components/page-configure-basic/template.pug
index 996ddcc..6852443 100644
--- a/frontend/app/components/page-configure-basic/template.pug
+++ b/frontend/app/configuration/components/page-configure-basic/template.pug
@@ -15,6 +15,7 @@
limitations under the License.
include /app/helpers/jade/mixins
+include /app/configuration/mixins
include ./../page-configure-advanced/components/cluster-edit-form/templates/general/discovery/cloud
include ./../page-configure-advanced/components/cluster-edit-form/templates/general/discovery/google
include ./../page-configure-advanced/components/cluster-edit-form/templates/general/discovery/jdbc
diff --git a/frontend/app/components/page-configure-overview/component.js b/frontend/app/configuration/components/page-configure-overview/component.ts
similarity index 100%
rename from frontend/app/components/page-configure-overview/component.js
rename to frontend/app/configuration/components/page-configure-overview/component.ts
diff --git a/frontend/app/components/page-configure-overview/components/pco-grid-column-categories/directive.js b/frontend/app/configuration/components/page-configure-overview/components/pco-grid-column-categories/directive.ts
similarity index 89%
rename from frontend/app/components/page-configure-overview/components/pco-grid-column-categories/directive.js
rename to frontend/app/configuration/components/page-configure-overview/components/pco-grid-column-categories/directive.ts
index ff03e7f..4db0791 100644
--- a/frontend/app/components/page-configure-overview/components/pco-grid-column-categories/directive.js
+++ b/frontend/app/configuration/components/page-configure-overview/components/pco-grid-column-categories/directive.ts
@@ -19,21 +19,18 @@
import map from 'lodash/map';
import uniqBy from 'lodash/uniqBy';
import headerTemplate from 'app/primitives/ui-grid-header/index.tpl.pug';
+import {IGridColumn, IUiGridConstants} from 'ui-grid';
const visibilityChanged = (a, b) => {
return !isEqual(map(a, 'visible'), map(b, 'visible'));
};
-/** @type {(cd: uiGrid.IGridColumn) => boolean} */
-const notSelectionColumn = (cc) => cc.colDef.name !== 'selectionRowHeaderCol';
+const notSelectionColumn = (cc: IGridColumn): boolean => cc.colDef.name !== 'selectionRowHeaderCol';
/**
* Generates categories for uiGrid columns
- *
- * @type {ng.IDirectiveFactory}
- * @param {uiGrid.IUiGridConstants} uiGridConstants
*/
-export default function directive(uiGridConstants) {
+export default function directive(uiGridConstants: IUiGridConstants) {
return {
require: '^uiGrid',
link: {
diff --git a/frontend/app/components/page-configure-overview/controller.js b/frontend/app/configuration/components/page-configure-overview/controller.ts
similarity index 74%
rename from frontend/app/components/page-configure-overview/controller.js
rename to frontend/app/configuration/components/page-configure-overview/controller.ts
index e170112..f4c1e11 100644
--- a/frontend/app/components/page-configure-overview/controller.js
+++ b/frontend/app/configuration/components/page-configure-overview/controller.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import {Subject} from 'rxjs';
+import {Subject, Observable} from 'rxjs';
import {map} from 'rxjs/operators';
import naturalCompare from 'natural-compare-lite';
@@ -29,13 +29,17 @@
</div>
`;
-import {default as ConfigureState} from 'app/components/page-configure/services/ConfigureState';
-import {default as ConfigSelectors} from 'app/components/page-configure/store/selectors';
-import {default as Clusters} from 'app/services/Clusters';
-import {default as ModalPreviewProject} from 'app/components/page-configure/components/modal-preview-project/service';
-import {default as ConfigurationDownload} from 'app/components/page-configure/services/ConfigurationDownload';
+import {default as ConfigureState} from '../../services/ConfigureState';
+import {default as ConfigSelectors} from '../../store/selectors';
+import {default as Clusters} from '../../services/Clusters';
+import {default as ModalPreviewProject} from '../../components/modal-preview-project/service';
+import {default as ConfigurationDownload} from '../../services/ConfigurationDownload';
-import {confirmClustersRemoval} from '../page-configure/store/actionCreators';
+import {confirmClustersRemoval} from '../../store/actionCreators';
+
+import {UIRouter} from '@uirouter/angularjs';
+import {ShortCluster} from '../../types';
+import {IColumnDefOf} from 'ui-grid';
export default class PageConfigureOverviewController {
static $inject = [
@@ -47,44 +51,38 @@
'ConfigurationDownload'
];
- /**
- * @param {uirouter.UIRouter} $uiRouter
- * @param {ModalPreviewProject} ModalPreviewProject
- * @param {Clusters} Clusters
- * @param {ConfigureState} ConfigureState
- * @param {ConfigSelectors} ConfigSelectors
- * @param {ConfigurationDownload} ConfigurationDownload
- */
- constructor($uiRouter, ModalPreviewProject, Clusters, ConfigureState, ConfigSelectors, ConfigurationDownload) {
- this.$uiRouter = $uiRouter;
- this.ModalPreviewProject = ModalPreviewProject;
- this.Clusters = Clusters;
- this.ConfigureState = ConfigureState;
- this.ConfigSelectors = ConfigSelectors;
- this.ConfigurationDownload = ConfigurationDownload;
- }
+ constructor(
+ private $uiRouter: UIRouter,
+ private ModalPreviewProject: ModalPreviewProject,
+ private Clusters: Clusters,
+ private ConfigureState: ConfigureState,
+ private ConfigSelectors: ConfigSelectors,
+ private ConfigurationDownload: ConfigurationDownload
+ ) {}
+
+ shortClusters$: Observable<Array<ShortCluster>>;
+ clustersColumnDefs: Array<IColumnDefOf<ShortCluster>>;
+ selectedRows$: Subject<Array<ShortCluster>>;
+ selectedRowsIDs$: Observable<Array<string>>;
$onDestroy() {
this.selectedRows$.complete();
}
- /** @param {Array<ig.config.cluster.ShortCluster>} clusters */
- removeClusters(clusters) {
+ removeClusters(clusters: Array<ShortCluster>) {
this.ConfigureState.dispatchAction(confirmClustersRemoval(clusters.map((c) => c._id)));
// TODO: Implement storing selected rows in store to share this data between other components.
this.selectedRows$.next([]);
}
- /** @param {ig.config.cluster.ShortCluster} cluster */
- editCluster(cluster) {
+ editCluster(cluster: ShortCluster) {
return this.$uiRouter.stateService.go('^.edit', {clusterID: cluster._id});
}
$onInit() {
this.shortClusters$ = this.ConfigureState.state$.pipe(this.ConfigSelectors.selectShortClustersValue());
- /** @type {Array<uiGrid.IColumnDefOf<ig.config.cluster.ShortCluster>>} */
this.clustersColumnDefs = [
{
name: 'name',
@@ -138,7 +136,6 @@
}
];
- /** @type {Subject<Array<ig.config.cluster.ShortCluster>>} */
this.selectedRows$ = new Subject();
this.selectedRowsIDs$ = this.selectedRows$.pipe(map((selectedClusters) => selectedClusters.map((cluster) => cluster._id)));
diff --git a/frontend/app/components/page-configure-overview/index.js b/frontend/app/configuration/components/page-configure-overview/index.ts
similarity index 100%
rename from frontend/app/components/page-configure-overview/index.js
rename to frontend/app/configuration/components/page-configure-overview/index.ts
diff --git a/frontend/app/components/page-configure-overview/style.scss b/frontend/app/configuration/components/page-configure-overview/style.scss
similarity index 100%
rename from frontend/app/components/page-configure-overview/style.scss
rename to frontend/app/configuration/components/page-configure-overview/style.scss
diff --git a/frontend/app/components/page-configure-overview/template.pug b/frontend/app/configuration/components/page-configure-overview/template.pug
similarity index 100%
rename from frontend/app/components/page-configure-overview/template.pug
rename to frontend/app/configuration/components/page-configure-overview/template.pug
diff --git a/frontend/app/components/page-configure/component.js b/frontend/app/configuration/components/page-configure/component.ts
similarity index 100%
rename from frontend/app/components/page-configure/component.js
rename to frontend/app/configuration/components/page-configure/component.ts
diff --git a/frontend/app/components/page-configure/controller.js b/frontend/app/configuration/components/page-configure/controller.ts
similarity index 73%
rename from frontend/app/components/page-configure/controller.js
rename to frontend/app/configuration/components/page-configure/controller.ts
index 7a83aa6..f270bb6 100644
--- a/frontend/app/components/page-configure/controller.js
+++ b/frontend/app/configuration/components/page-configure/controller.ts
@@ -18,25 +18,24 @@
import get from 'lodash/get';
import {Observable, combineLatest} from 'rxjs';
import {pluck, switchMap, map} from 'rxjs/operators';
-import {default as ConfigureState} from './services/ConfigureState';
-import {default as ConfigSelectors} from './store/selectors';
+import {default as ConfigureState} from '../../services/ConfigureState';
+import {default as ConfigSelectors} from '../../store/selectors';
+import {UIRouter} from '@uirouter/angularjs';
export default class PageConfigureController {
static $inject = ['$uiRouter', 'ConfigureState', 'ConfigSelectors'];
- /**
- * @param {uirouter.UIRouter} $uiRouter
- * @param {ConfigureState} ConfigureState
- * @param {ConfigSelectors} ConfigSelectors
- */
- constructor($uiRouter, ConfigureState, ConfigSelectors) {
- this.$uiRouter = $uiRouter;
- this.ConfigureState = ConfigureState;
- this.ConfigSelectors = ConfigSelectors;
- }
+ constructor(
+ private $uiRouter: UIRouter,
+ private ConfigureState: ConfigureState,
+ private ConfigSelectors: ConfigSelectors
+ ) {}
+
+ clusterID$: Observable<string>;
+ clusterName$: Observable<string>;
+ tooltipsVisible = true;
$onInit() {
- /** @type {Observable<string>} */
this.clusterID$ = this.$uiRouter.globals.params$.pipe(pluck('clusterID'));
const cluster$ = this.clusterID$.pipe(switchMap((id) => this.ConfigureState.state$.pipe(this.ConfigSelectors.selectCluster(id))));
@@ -46,8 +45,6 @@
this.clusterName$ = combineLatest(cluster$, isNew$, (cluster, isNew) => {
return `${isNew ? 'Create' : 'Edit'} cluster configuration ${isNew ? '' : `‘${get(cluster, 'name')}’`}`;
});
-
- this.tooltipsVisible = true;
}
$onDestroy() {}
diff --git a/frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js b/frontend/app/configuration/components/page-configure/index.ts
similarity index 85%
copy from frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js
copy to frontend/app/configuration/components/page-configure/index.ts
index 900efcd..60ae726 100644
--- a/frontend/app/components/page-configure-advanced/components/cache-edit-form/index.js
+++ b/frontend/app/configuration/components/page-configure/index.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import angular from 'angular';
import component from './component';
-export default angular.module('configuration.cache-edit-form', [])
-.component('cacheEditForm', component);
+
+export default angular.module('ignite-console.configuration.page-configure', [])
+ .component('pageConfigure', component);
diff --git a/frontend/app/components/page-configure/style.scss b/frontend/app/configuration/components/page-configure/style.scss
similarity index 99%
rename from frontend/app/components/page-configure/style.scss
rename to frontend/app/configuration/components/page-configure/style.scss
index 9e9661c..335f95b 100644
--- a/frontend/app/components/page-configure/style.scss
+++ b/frontend/app/configuration/components/page-configure/style.scss
@@ -16,7 +16,6 @@
*/
page-configure {
- font-family: Roboto;
flex: 1 0 auto;
display: flex;
flex-direction: column;
@@ -273,7 +272,6 @@
}
}
.pc-page-header {
- font-family: Roboto;
font-size: 24px;
line-height: 36px;
color: #393939;
diff --git a/frontend/app/components/page-configure/template.pug b/frontend/app/configuration/components/page-configure/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/template.pug
rename to frontend/app/configuration/components/page-configure/template.pug
diff --git a/frontend/app/components/page-configure/components/pc-items-table/component.js b/frontend/app/configuration/components/pc-items-table/component.js
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-items-table/component.js
rename to frontend/app/configuration/components/pc-items-table/component.js
diff --git a/frontend/app/components/page-configure/components/pc-items-table/controller.js b/frontend/app/configuration/components/pc-items-table/controller.js
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-items-table/controller.js
rename to frontend/app/configuration/components/pc-items-table/controller.js
diff --git a/frontend/app/components/page-configure/components/pc-items-table/decorator.js b/frontend/app/configuration/components/pc-items-table/decorator.js
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-items-table/decorator.js
rename to frontend/app/configuration/components/pc-items-table/decorator.js
diff --git a/frontend/app/components/page-configure/components/pc-items-table/index.js b/frontend/app/configuration/components/pc-items-table/index.js
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-items-table/index.js
rename to frontend/app/configuration/components/pc-items-table/index.js
diff --git a/frontend/app/components/page-configure/components/pc-items-table/style.scss b/frontend/app/configuration/components/pc-items-table/style.scss
similarity index 96%
rename from frontend/app/components/page-configure/components/pc-items-table/style.scss
rename to frontend/app/configuration/components/pc-items-table/style.scss
index 2147714..7100e72 100644
--- a/frontend/app/components/page-configure/components/pc-items-table/style.scss
+++ b/frontend/app/configuration/components/pc-items-table/style.scss
@@ -16,7 +16,7 @@
*/
pc-items-table {
- @import "./../../../../../public/stylesheets/variables.scss";
+ @import "public/stylesheets/variables.scss";
display: block;
diff --git a/frontend/app/components/page-configure/components/pc-items-table/template.pug b/frontend/app/configuration/components/pc-items-table/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-items-table/template.pug
rename to frontend/app/configuration/components/pc-items-table/template.pug
diff --git a/frontend/app/components/page-configure/components/pc-split-button/component.js b/frontend/app/configuration/components/pc-split-button/component.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-split-button/component.js
rename to frontend/app/configuration/components/pc-split-button/component.ts
diff --git a/frontend/app/components/page-configure/components/pc-split-button/controller.js b/frontend/app/configuration/components/pc-split-button/controller.ts
similarity index 74%
rename from frontend/app/components/page-configure/components/pc-split-button/controller.js
rename to frontend/app/configuration/components/pc-split-button/controller.ts
index 8aa9495..cee73f8 100644
--- a/frontend/app/components/page-configure/components/pc-split-button/controller.js
+++ b/frontend/app/configuration/components/pc-split-button/controller.ts
@@ -15,29 +15,18 @@
* limitations under the License.
*/
-/**
- * @typedef {{icon: string, text: string, click: ng.ICompiledExpression}} ActionMenuItem
- */
-
-/**
- * @typedef {Array<ActionMenuItem>} ActionsMenu
- */
+type ActionMenuItem = {icon: string, text: string, click: ng.ICompiledExpression};
+type ActionsMenu = ActionMenuItem[];
/**
* Groups multiple buttons into a single button with all but first buttons in a dropdown
*/
export default class SplitButton {
- /** @type {ActionsMenu} */
- actions = [];
+ actions: ActionsMenu = [];
static $inject = ['$element'];
- /**
- * @param {JQLite} $element Component root element
- */
- constructor($element, $transclude) {
- this.$element = $element;
- }
+ constructor(private $element: JQLite) {}
$onInit() {
this.$element[0].classList.add('btn-ignite-group');
diff --git a/frontend/app/components/page-configure/components/pc-split-button/index.js b/frontend/app/configuration/components/pc-split-button/index.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-split-button/index.js
rename to frontend/app/configuration/components/pc-split-button/index.ts
diff --git a/frontend/app/components/page-configure/components/pc-split-button/template.pug b/frontend/app/configuration/components/pc-split-button/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-split-button/template.pug
rename to frontend/app/configuration/components/pc-split-button/template.pug
diff --git a/frontend/app/components/page-configure/components/pc-ui-grid-filters/directive.js b/frontend/app/configuration/components/pc-ui-grid-filters/directive.ts
similarity index 94%
rename from frontend/app/components/page-configure/components/pc-ui-grid-filters/directive.js
rename to frontend/app/configuration/components/pc-ui-grid-filters/directive.ts
index 3d4617c..d8330b6 100644
--- a/frontend/app/components/page-configure/components/pc-ui-grid-filters/directive.js
+++ b/frontend/app/configuration/components/pc-ui-grid-filters/directive.ts
@@ -17,8 +17,9 @@
import template from './template.pug';
import './style.scss';
+import {IUiGridConstants} from 'ui-grid';
-export default function pcUiGridFilters(uiGridConstants) {
+export default function pcUiGridFilters(uiGridConstants: IUiGridConstants) {
return {
require: 'uiGrid',
link: {
@@ -58,7 +59,7 @@
});
}
}
- };
+ } as ng.IDirective;
}
pcUiGridFilters.$inject = ['uiGridConstants'];
diff --git a/frontend/app/components/page-configure/components/pc-ui-grid-filters/index.js b/frontend/app/configuration/components/pc-ui-grid-filters/index.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-ui-grid-filters/index.js
rename to frontend/app/configuration/components/pc-ui-grid-filters/index.ts
diff --git a/frontend/app/components/page-configure/components/pc-ui-grid-filters/style.scss b/frontend/app/configuration/components/pc-ui-grid-filters/style.scss
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-ui-grid-filters/style.scss
rename to frontend/app/configuration/components/pc-ui-grid-filters/style.scss
diff --git a/frontend/app/components/page-configure/components/pc-ui-grid-filters/template.pug b/frontend/app/configuration/components/pc-ui-grid-filters/template.pug
similarity index 100%
rename from frontend/app/components/page-configure/components/pc-ui-grid-filters/template.pug
rename to frontend/app/configuration/components/pc-ui-grid-filters/template.pug
diff --git a/frontend/app/components/page-configure/components/pcIsInCollection.js b/frontend/app/configuration/components/pcIsInCollection.ts
similarity index 93%
rename from frontend/app/components/page-configure/components/pcIsInCollection.js
rename to frontend/app/configuration/components/pcIsInCollection.ts
index 50ea4a4..f348f3d 100644
--- a/frontend/app/components/page-configure/components/pcIsInCollection.js
+++ b/frontend/app/configuration/components/pcIsInCollection.ts
@@ -15,7 +15,10 @@
* limitations under the License.
*/
-class Controller {
+class Controller<T> {
+ ngModel: ng.INgModelController;
+ items: T[];
+
$onInit() {
this.ngModel.$validators.isInCollection = (item) => {
if (!item || !this.items)
diff --git a/frontend/app/configuration/components/pcValidation.ts b/frontend/app/configuration/components/pcValidation.ts
new file mode 100644
index 0000000..b67dd30
--- /dev/null
+++ b/frontend/app/configuration/components/pcValidation.ts
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); 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.
+ */
+
+import LegacyUtilsFactory from 'app/services/LegacyUtils.service';
+
+export default angular.module('ignite-console.page-configure.validation', [])
+ .directive('pcNotInCollection', function() {
+ class Controller<T> {
+ ngModel: ng.INgModelController;
+ items: T[];
+
+ $onInit() {
+ this.ngModel.$validators.notInCollection = (item: T) => {
+ if (!this.items)
+ return true;
+
+ return !this.items.includes(item);
+ };
+ }
+
+ $onChanges() {
+ this.ngModel.$validate();
+ }
+ }
+
+ return {
+ controller: Controller,
+ require: {
+ ngModel: 'ngModel'
+ },
+ bindToController: {
+ items: '<pcNotInCollection'
+ }
+ };
+ })
+ .directive('pcInCollection', function() {
+ class Controller<T> {
+ ngModel: ng.INgModelController;
+ items: T[];
+ pluck?: string;
+
+ $onInit() {
+ this.ngModel.$validators.inCollection = (item: T) => {
+ if (!this.items)
+ return false;
+
+ const items = this.pluck ? this.items.map((i) => i[this.pluck]) : this.items;
+ return Array.isArray(item)
+ ? item.every((i) => items.includes(i))
+ : items.includes(item);
+ };
+ }
+
+ $onChanges() {
+ this.ngModel.$validate();
+ }
+ }
+
+ return {
+ controller: Controller,
+ require: {
+ ngModel: 'ngModel'
+ },
+ bindToController: {
+ items: '<pcInCollection',
+ pluck: '@?pcInCollectionPluck'
+ }
+ };
+ })
+ .directive('pcPowerOfTwo', function() {
+ class Controller {
+ ngModel: ng.INgModelController;
+ $onInit() {
+ this.ngModel.$validators.powerOfTwo = (value: number) => {
+ return !value || ((value & -value) === value);
+ };
+ }
+ }
+
+ return {
+ controller: Controller,
+ require: {
+ ngModel: 'ngModel'
+ },
+ bindToController: true
+ };
+ })
+ .directive('isValidJavaIdentifier', ['IgniteLegacyUtils', function(LegacyUtils: ReturnType<typeof LegacyUtilsFactory>) {
+ return {
+ link(scope, el, attr, ngModel: ng.INgModelController) {
+ ngModel.$validators.isValidJavaIdentifier = (value: string) => LegacyUtils.VALID_JAVA_IDENTIFIER.test(value);
+ },
+ require: 'ngModel'
+ };
+ }])
+ .directive('notJavaReservedWord', ['IgniteLegacyUtils', function(LegacyUtils: ReturnType<typeof LegacyUtilsFactory>) {
+ return {
+ link(scope, el, attr, ngModel: ng.INgModelController) {
+ ngModel.$validators.notJavaReservedWord = (value: string) => !LegacyUtils.JAVA_KEYWORDS.includes(value);
+ },
+ require: 'ngModel'
+ };
+ }]);
diff --git a/frontend/app/components/page-configure/components/preview-panel/directive.js b/frontend/app/configuration/components/preview-panel/directive.ts
similarity index 97%
rename from frontend/app/components/page-configure/components/preview-panel/directive.js
rename to frontend/app/configuration/components/preview-panel/directive.ts
index b7519ce..0845df9 100644
--- a/frontend/app/components/page-configure/components/preview-panel/directive.js
+++ b/frontend/app/configuration/components/preview-panel/directive.ts
@@ -18,11 +18,9 @@
import ace from 'brace';
import _ from 'lodash';
-/**
- * @param {ng.IIntervalService} $interval
- * @param {ng.ITimeoutService} $timeout
- */
-export default function previewPanelDirective($interval, $timeout) {
+previewPanelDirective.$inject = ['$interval', '$timeout'];
+
+export default function previewPanelDirective($interval: ng.IIntervalService, $timeout: ng.ITimeoutService) {
let animation = {editor: null, stage: 0, start: 0, stop: 0};
let prevContent = [];
@@ -242,5 +240,3 @@
require: ['?igniteUiAceTabs', '?^igniteUiAceTabs']
};
}
-
-previewPanelDirective.$inject = ['$interval', '$timeout'];
diff --git a/frontend/app/components/page-configure/components/preview-panel/index.js b/frontend/app/configuration/components/preview-panel/index.ts
similarity index 100%
rename from frontend/app/components/page-configure/components/preview-panel/index.js
rename to frontend/app/configuration/components/preview-panel/index.ts
diff --git a/frontend/app/directives/ui-ace-java/index.js b/frontend/app/configuration/components/ui-ace-java/index.ts
similarity index 95%
rename from frontend/app/directives/ui-ace-java/index.js
rename to frontend/app/configuration/components/ui-ace-java/index.ts
index 2efdf32..3d0b9b6 100644
--- a/frontend/app/directives/ui-ace-java/index.js
+++ b/frontend/app/configuration/components/ui-ace-java/index.ts
@@ -21,6 +21,6 @@
export default angular.module('ignite-console.ui-ace-java', [
'ignite-console.services',
- 'ignite-console.configuration'
+ 'ignite-console.configuration.generator'
])
.directive('igniteUiAceJava', UiAceJavaDirective);
diff --git a/frontend/app/directives/ui-ace-java/ui-ace-java.controller.js b/frontend/app/configuration/components/ui-ace-java/ui-ace-java.controller.ts
similarity index 100%
rename from frontend/app/directives/ui-ace-java/ui-ace-java.controller.js
rename to frontend/app/configuration/components/ui-ace-java/ui-ace-java.controller.ts
diff --git a/frontend/app/directives/ui-ace-java/ui-ace-java.directive.js b/frontend/app/configuration/components/ui-ace-java/ui-ace-java.directive.ts
similarity index 100%
rename from frontend/app/directives/ui-ace-java/ui-ace-java.directive.js
rename to frontend/app/configuration/components/ui-ace-java/ui-ace-java.directive.ts
diff --git a/frontend/app/directives/ui-ace-java/ui-ace-java.pug b/frontend/app/configuration/components/ui-ace-java/ui-ace-java.pug
similarity index 100%
rename from frontend/app/directives/ui-ace-java/ui-ace-java.pug
rename to frontend/app/configuration/components/ui-ace-java/ui-ace-java.pug
diff --git a/frontend/app/directives/ui-ace-spring/index.js b/frontend/app/configuration/components/ui-ace-spring/index.ts
similarity index 95%
rename from frontend/app/directives/ui-ace-spring/index.js
rename to frontend/app/configuration/components/ui-ace-spring/index.ts
index 8bb75dc..938dd6f 100644
--- a/frontend/app/directives/ui-ace-spring/index.js
+++ b/frontend/app/configuration/components/ui-ace-spring/index.ts
@@ -21,6 +21,6 @@
export default angular.module('ignite-console.ui-ace-spring', [
'ignite-console.services',
- 'ignite-console.configuration'
+ 'ignite-console.configuration.generator'
])
.directive('igniteUiAceSpring', UiAceSpringDirective);
diff --git a/frontend/app/directives/ui-ace-spring/ui-ace-spring.controller.js b/frontend/app/configuration/components/ui-ace-spring/ui-ace-spring.controller.ts
similarity index 100%
rename from frontend/app/directives/ui-ace-spring/ui-ace-spring.controller.js
rename to frontend/app/configuration/components/ui-ace-spring/ui-ace-spring.controller.ts
diff --git a/frontend/app/directives/ui-ace-spring/ui-ace-spring.directive.js b/frontend/app/configuration/components/ui-ace-spring/ui-ace-spring.directive.ts
similarity index 100%
rename from frontend/app/directives/ui-ace-spring/ui-ace-spring.directive.js
rename to frontend/app/configuration/components/ui-ace-spring/ui-ace-spring.directive.ts
diff --git a/frontend/app/directives/ui-ace-spring/ui-ace-spring.pug b/frontend/app/configuration/components/ui-ace-spring/ui-ace-spring.pug
similarity index 100%
rename from frontend/app/directives/ui-ace-spring/ui-ace-spring.pug
rename to frontend/app/configuration/components/ui-ace-spring/ui-ace-spring.pug
diff --git a/frontend/app/directives/ui-ace-tabs.directive.js b/frontend/app/configuration/components/ui-ace-tabs.directive.ts
similarity index 100%
rename from frontend/app/directives/ui-ace-tabs.directive.js
rename to frontend/app/configuration/components/ui-ace-tabs.directive.ts
diff --git a/frontend/app/directives/ui-ace.controller.js b/frontend/app/configuration/components/ui-ace.controller.js
similarity index 100%
rename from frontend/app/directives/ui-ace.controller.js
rename to frontend/app/configuration/components/ui-ace.controller.js
diff --git a/frontend/app/components/page-configure/defaultNames.js b/frontend/app/configuration/defaultNames.ts
similarity index 100%
rename from frontend/app/components/page-configure/defaultNames.js
rename to frontend/app/configuration/defaultNames.ts
diff --git a/frontend/app/configuration/generator/JavaTypesNonEnum.service.spec.ts b/frontend/app/configuration/generator/JavaTypesNonEnum.service.spec.ts
new file mode 100644
index 0000000..065392e
--- /dev/null
+++ b/frontend/app/configuration/generator/JavaTypesNonEnum.service.spec.ts
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); 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.
+ */
+
+import {JavaTypesNonEnum} from './JavaTypesNonEnum.service';
+
+import ClusterDflts from './generator/defaults/Cluster.service';
+import CacheDflts from './generator/defaults/Cache.service';
+import IgfsDflts from './generator/defaults/IGFS.service';
+import JavaTypes from 'app/services/JavaTypes.service';
+
+const instance = new JavaTypesNonEnum(new ClusterDflts(), new CacheDflts(), new IgfsDflts(), new JavaTypes());
+
+import { assert } from 'chai';
+
+suite('JavaTypesNonEnum', () => {
+ test('nonEnum', () => {
+ assert.equal(instance.nonEnum('org.apache.ignite.cache.CacheMode'), false);
+ assert.equal(instance.nonEnum('org.apache.ignite.transactions.TransactionConcurrency'), false);
+ assert.equal(instance.nonEnum('org.apache.ignite.cache.CacheWriteSynchronizationMode'), false);
+ assert.equal(instance.nonEnum('org.apache.ignite.igfs.IgfsIpcEndpointType'), false);
+ assert.equal(instance.nonEnum('java.io.Serializable'), true);
+ assert.equal(instance.nonEnum('BigDecimal'), true);
+ });
+});
diff --git a/frontend/app/configuration/generator/JavaTypesNonEnum.service.ts b/frontend/app/configuration/generator/JavaTypesNonEnum.service.ts
new file mode 100644
index 0000000..aa08ae2
--- /dev/null
+++ b/frontend/app/configuration/generator/JavaTypesNonEnum.service.ts
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); 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.
+ */
+
+import uniq from 'lodash/uniq';
+import map from 'lodash/map';
+import reduce from 'lodash/reduce';
+import isObject from 'lodash/isObject';
+import merge from 'lodash/merge';
+import includes from 'lodash/includes';
+
+export class JavaTypesNonEnum {
+ static $inject = ['IgniteClusterDefaults', 'IgniteCacheDefaults', 'IgniteIGFSDefaults', 'JavaTypes'];
+
+ enumClasses: any;
+ shortEnumClasses: any;
+
+ constructor(clusterDflts, cacheDflts, igfsDflts, JavaTypes) {
+ this.enumClasses = uniq(this._enumClassesAcc(merge(clusterDflts, cacheDflts, igfsDflts), []));
+ this.shortEnumClasses = map(this.enumClasses, (cls) => JavaTypes.shortClassName(cls));
+ }
+
+ /**
+ * Check if class name is non enum class in Ignite configuration.
+ *
+ * @param clsName
+ * @return {boolean}
+ */
+ nonEnum(clsName: string): boolean {
+ return !includes(this.shortEnumClasses, clsName) && !includes(this.enumClasses, clsName);
+ }
+
+ /**
+ * Collects recursive enum classes.
+ *
+ * @param root Root object.
+ * @param classes Collected classes.
+ */
+ private _enumClassesAcc(root, classes): Array<string> {
+ return reduce(root, (acc, val, key) => {
+ if (key === 'clsName')
+ acc.push(val);
+ else if (isObject(val))
+ this._enumClassesAcc(val, acc);
+
+ return acc;
+ }, classes);
+ }
+}
diff --git a/frontend/app/modules/configuration/configuration.module.js b/frontend/app/configuration/generator/configuration.module.js
similarity index 61%
rename from frontend/app/modules/configuration/configuration.module.js
rename to frontend/app/configuration/generator/configuration.module.js
index 844c87f..cc04095 100644
--- a/frontend/app/modules/configuration/configuration.module.js
+++ b/frontend/app/configuration/generator/configuration.module.js
@@ -15,8 +15,7 @@
* limitations under the License.
*/
-import angular from 'angular';
-
+import {JavaTypesNonEnum} from './JavaTypesNonEnum.service';
import IgniteClusterDefaults from './generator/defaults/Cluster.service';
import IgniteClusterPlatformDefaults from './generator/defaults/Cluster.platform.service';
import IgniteCacheDefaults from './generator/defaults/Cache.service';
@@ -38,23 +37,22 @@
// Ignite events groups.
-angular
-.module('ignite-console.configuration', [
-
-])
-.service('IgniteConfigurationGenerator', function() { return IgniteConfigurationGenerator;})
-.service('IgnitePlatformGenerator', IgnitePlatformGenerator)
-.service('SpringTransformer', function() { return IgniteSpringTransformer;})
-.service('JavaTransformer', function() { return IgniteJavaTransformer;})
-.service('IgniteSharpTransformer', SharpTransformer)
-.service('IgniteEventGroups', IgniteEventGroups)
-.service('IgniteClusterDefaults', IgniteClusterDefaults)
-.service('IgniteClusterPlatformDefaults', IgniteClusterPlatformDefaults)
-.service('IgniteCacheDefaults', IgniteCacheDefaults)
-.service('IgniteCachePlatformDefaults', IgniteCachePlatformDefaults)
-.service('IgniteIGFSDefaults', IgniteIGFSDefaults)
-.service('IgnitePropertiesGenerator', IgniteGeneratorProperties)
-.service('IgniteReadmeGenerator', IgniteReadmeGenerator)
-.service('IgniteDockerGenerator', IgniteDockerGenerator)
-.service('IgniteMavenGenerator', IgniteMavenGenerator)
-.service('IgniteCustomGenerator', IgniteCustomGenerator);
+export default angular
+ .module('ignite-console.configuration.generator', [])
+ .service('JavaTypesNonEnum', JavaTypesNonEnum)
+ .service('IgniteConfigurationGenerator', function() { return IgniteConfigurationGenerator;})
+ .service('IgnitePlatformGenerator', IgnitePlatformGenerator)
+ .service('SpringTransformer', function() { return IgniteSpringTransformer;})
+ .service('JavaTransformer', function() { return IgniteJavaTransformer;})
+ .service('IgniteSharpTransformer', SharpTransformer)
+ .service('IgniteEventGroups', IgniteEventGroups)
+ .service('IgniteClusterDefaults', IgniteClusterDefaults)
+ .service('IgniteClusterPlatformDefaults', IgniteClusterPlatformDefaults)
+ .service('IgniteCacheDefaults', IgniteCacheDefaults)
+ .service('IgniteCachePlatformDefaults', IgniteCachePlatformDefaults)
+ .service('IgniteIGFSDefaults', IgniteIGFSDefaults)
+ .service('IgnitePropertiesGenerator', IgniteGeneratorProperties)
+ .service('IgniteReadmeGenerator', IgniteReadmeGenerator)
+ .service('IgniteDockerGenerator', IgniteDockerGenerator)
+ .service('IgniteMavenGenerator', IgniteMavenGenerator)
+ .service('IgniteCustomGenerator', IgniteCustomGenerator);
diff --git a/frontend/app/modules/configuration/generator/AbstractTransformer.js b/frontend/app/configuration/generator/generator/AbstractTransformer.js
similarity index 98%
rename from frontend/app/modules/configuration/generator/AbstractTransformer.js
rename to frontend/app/configuration/generator/generator/AbstractTransformer.js
index ab69bb8..73b0a08 100644
--- a/frontend/app/modules/configuration/generator/AbstractTransformer.js
+++ b/frontend/app/configuration/generator/generator/AbstractTransformer.js
@@ -24,6 +24,7 @@
import IgniteIGFSDefaults from './defaults/IGFS.service';
import JavaTypes from '../../../services/JavaTypes.service';
+import {JavaTypesNonEnum} from '../JavaTypesNonEnum.service';
const clusterDflts = new IgniteClusterDefaults();
const cacheDflts = new IgniteCacheDefaults();
@@ -31,7 +32,8 @@
export default class AbstractTransformer {
static generator = IgniteConfigurationGenerator;
- static javaTypes = new JavaTypes(clusterDflts, cacheDflts, igfsDflts);
+ static javaTypes = new JavaTypes();
+ static javaTypesNonEnum = new JavaTypesNonEnum(clusterDflts, cacheDflts, igfsDflts, new JavaTypes());
// Append comment with time stamp.
static mainComment(sb, ...lines) {
diff --git a/frontend/app/modules/configuration/generator/Beans.js b/frontend/app/configuration/generator/generator/Beans.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/Beans.js
rename to frontend/app/configuration/generator/generator/Beans.js
diff --git a/frontend/app/modules/configuration/generator/ConfigurationGenerator.js b/frontend/app/configuration/generator/generator/ConfigurationGenerator.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/ConfigurationGenerator.js
rename to frontend/app/configuration/generator/generator/ConfigurationGenerator.js
diff --git a/frontend/app/modules/configuration/generator/Custom.service.js b/frontend/app/configuration/generator/generator/Custom.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/Custom.service.js
rename to frontend/app/configuration/generator/generator/Custom.service.js
diff --git a/frontend/app/modules/configuration/generator/Docker.service.js b/frontend/app/configuration/generator/generator/Docker.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/Docker.service.js
rename to frontend/app/configuration/generator/generator/Docker.service.js
diff --git a/frontend/app/modules/configuration/generator/Docker.service.spec.js b/frontend/app/configuration/generator/generator/Docker.service.spec.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/Docker.service.spec.js
rename to frontend/app/configuration/generator/generator/Docker.service.spec.js
diff --git a/frontend/app/modules/configuration/generator/JavaTransformer.service.js b/frontend/app/configuration/generator/generator/JavaTransformer.service.js
similarity index 99%
rename from frontend/app/modules/configuration/generator/JavaTransformer.service.js
rename to frontend/app/configuration/generator/generator/JavaTransformer.service.js
index ee31246..9ea1e7f 100644
--- a/frontend/app/modules/configuration/generator/JavaTransformer.service.js
+++ b/frontend/app/configuration/generator/generator/JavaTransformer.service.js
@@ -377,7 +377,7 @@
}
static _isBean(clsName) {
- return this.javaTypes.nonBuiltInClass(clsName) && this.javaTypes.nonEnum(clsName) && _.includes(clsName, '.');
+ return this.javaTypes.nonBuiltInClass(clsName) && this.javaTypesNonEnum.nonEnum(clsName) && _.includes(clsName, '.');
}
static _toObject(clsName, val) {
@@ -419,7 +419,7 @@
return this._newBean(item);
}
- if (this.javaTypes.nonEnum(clsName))
+ if (this.javaTypesNonEnum.nonEnum(clsName))
return item;
return `${this.javaTypes.shortClassName(clsName)}.${item}`;
@@ -811,7 +811,7 @@
break;
default:
- if (!this.javaTypes.nonEnum(prop.clsName))
+ if (!this.javaTypesNonEnum.nonEnum(prop.clsName))
imports.push(prop.clsName);
}
});
diff --git a/frontend/test/unit/JavaTransformer.test.js b/frontend/app/configuration/generator/generator/JavaTransformer.spec.js
similarity index 86%
rename from frontend/test/unit/JavaTransformer.test.js
rename to frontend/app/configuration/generator/generator/JavaTransformer.spec.js
index 214377f..aa75f8d 100644
--- a/frontend/test/unit/JavaTransformer.test.js
+++ b/frontend/app/configuration/generator/generator/JavaTransformer.spec.js
@@ -15,12 +15,10 @@
* limitations under the License.
*/
-import JavaTypes from '../../app/services/JavaTypes.service';
+import JavaTypes from 'app/services/JavaTypes.service';
-import generator from '../../app/modules/configuration/generator/ConfigurationGenerator';
-import transformer from '../../app/modules/configuration/generator/JavaTransformer.service';
-
-import { suite, test } from 'mocha';
+import generator from './ConfigurationGenerator';
+import transformer from './JavaTransformer.service';
suite.skip('JavaTransformerTestsSuite', () => {
test('AtomicConfiguration', () => {
diff --git a/frontend/app/modules/configuration/generator/Maven.service.js b/frontend/app/configuration/generator/generator/Maven.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/Maven.service.js
rename to frontend/app/configuration/generator/generator/Maven.service.js
diff --git a/frontend/app/modules/configuration/generator/PlatformGenerator.js b/frontend/app/configuration/generator/generator/PlatformGenerator.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/PlatformGenerator.js
rename to frontend/app/configuration/generator/generator/PlatformGenerator.js
diff --git a/frontend/app/modules/configuration/generator/Properties.service.js b/frontend/app/configuration/generator/generator/Properties.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/Properties.service.js
rename to frontend/app/configuration/generator/generator/Properties.service.js
diff --git a/frontend/app/modules/configuration/generator/Readme.service.js b/frontend/app/configuration/generator/generator/Readme.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/Readme.service.js
rename to frontend/app/configuration/generator/generator/Readme.service.js
diff --git a/frontend/app/modules/configuration/generator/SharpTransformer.service.js b/frontend/app/configuration/generator/generator/SharpTransformer.service.js
similarity index 96%
rename from frontend/app/modules/configuration/generator/SharpTransformer.service.js
rename to frontend/app/configuration/generator/generator/SharpTransformer.service.js
index 6e6bffe..e7d5d7b 100644
--- a/frontend/app/modules/configuration/generator/SharpTransformer.service.js
+++ b/frontend/app/configuration/generator/generator/SharpTransformer.service.js
@@ -26,6 +26,7 @@
import IGFSDefaults from './defaults/IGFS.service';
import JavaTypes from '../../../services/JavaTypes.service';
+import {JavaTypesNonEnum} from '../JavaTypesNonEnum.service';
const generator = new ConfigurationGenerator();
@@ -33,7 +34,8 @@
const cacheDflts = new CacheDefaults();
const igfsDflts = new IGFSDefaults();
-const javaTypes = new JavaTypes(clusterDflts, cacheDflts, igfsDflts);
+const javaTypes = new JavaTypes();
+const javaTypesNonEnum = new JavaTypesNonEnum(clusterDflts, cacheDflts, igfsDflts, javaTypes);
export default class SharpTransformer extends AbstractTransformer {
static generator = generator;
@@ -120,7 +122,7 @@
//
// return this._newBean(item);
default:
- if (javaTypes.nonEnum(shortClsName))
+ if (javaTypesNonEnum.nonEnum(shortClsName))
return item;
return `${shortClsName}.${item}`;
diff --git a/frontend/test/unit/SharpTransformer.test.js b/frontend/app/configuration/generator/generator/SharpTransformer.spec.js
similarity index 88%
rename from frontend/test/unit/SharpTransformer.test.js
rename to frontend/app/configuration/generator/generator/SharpTransformer.spec.js
index 3fb9265..57725d4 100644
--- a/frontend/test/unit/SharpTransformer.test.js
+++ b/frontend/app/configuration/generator/generator/SharpTransformer.spec.js
@@ -15,10 +15,8 @@
* limitations under the License.
*/
-import generator from '../../app/modules/configuration/generator/PlatformGenerator';
-import transformer from '../../app/modules/configuration/generator/SharpTransformer.service';
-
-import { suite, test } from 'mocha';
+import generator from './PlatformGenerator';
+import transformer from './SharpTransformer.service';
suite.skip('SharpTransformerTestsSuite', () => {
test('AtomicConfiguration', () => {
diff --git a/frontend/app/modules/configuration/generator/SpringTransformer.service.js b/frontend/app/configuration/generator/generator/SpringTransformer.service.js
similarity index 99%
rename from frontend/app/modules/configuration/generator/SpringTransformer.service.js
rename to frontend/app/configuration/generator/generator/SpringTransformer.service.js
index 3d2bac1..21efd11 100644
--- a/frontend/app/modules/configuration/generator/SpringTransformer.service.js
+++ b/frontend/app/configuration/generator/generator/SpringTransformer.service.js
@@ -108,7 +108,7 @@
}
static _isBean(clsName) {
- return this.javaTypes.nonBuiltInClass(clsName) && this.javaTypes.nonEnum(clsName) && _.includes(clsName, '.');
+ return this.javaTypes.nonBuiltInClass(clsName) && this.javaTypesNonEnum.nonEnum(clsName) && _.includes(clsName, '.');
}
static _setCollection(sb, prop) {
diff --git a/frontend/test/unit/SpringTransformer.test.js b/frontend/app/configuration/generator/generator/SpringTransformer.spec.js
similarity index 85%
rename from frontend/test/unit/SpringTransformer.test.js
rename to frontend/app/configuration/generator/generator/SpringTransformer.spec.js
index 9567115..2a08219 100644
--- a/frontend/test/unit/SpringTransformer.test.js
+++ b/frontend/app/configuration/generator/generator/SpringTransformer.spec.js
@@ -15,12 +15,9 @@
* limitations under the License.
*/
-import JavaTypes from '../../app/services/JavaTypes.service';
-
-import generator from '../../app/modules/configuration/generator/ConfigurationGenerator';
-import transformer from '../../app/modules/configuration/generator/SpringTransformer.service';
-
-import { suite, test } from 'mocha';
+import JavaTypes from 'app/services/JavaTypes.service';
+import generator from './ConfigurationGenerator';
+import transformer from './SpringTransformer.service';
suite.skip('SpringTransformerTestsSuite', () => {
test('AtomicConfiguration', () => {
diff --git a/frontend/app/modules/configuration/generator/StringBuilder.js b/frontend/app/configuration/generator/generator/StringBuilder.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/StringBuilder.js
rename to frontend/app/configuration/generator/generator/StringBuilder.js
diff --git a/frontend/app/modules/configuration/generator/defaults/Cache.platform.service.js b/frontend/app/configuration/generator/generator/defaults/Cache.platform.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/defaults/Cache.platform.service.js
rename to frontend/app/configuration/generator/generator/defaults/Cache.platform.service.js
diff --git a/frontend/app/modules/configuration/generator/defaults/Cache.service.js b/frontend/app/configuration/generator/generator/defaults/Cache.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/defaults/Cache.service.js
rename to frontend/app/configuration/generator/generator/defaults/Cache.service.js
diff --git a/frontend/app/modules/configuration/generator/defaults/Cluster.platform.service.js b/frontend/app/configuration/generator/generator/defaults/Cluster.platform.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/defaults/Cluster.platform.service.js
rename to frontend/app/configuration/generator/generator/defaults/Cluster.platform.service.js
diff --git a/frontend/app/modules/configuration/generator/defaults/Cluster.service.js b/frontend/app/configuration/generator/generator/defaults/Cluster.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/defaults/Cluster.service.js
rename to frontend/app/configuration/generator/generator/defaults/Cluster.service.js
diff --git a/frontend/app/modules/configuration/generator/defaults/Event-groups.service.js b/frontend/app/configuration/generator/generator/defaults/Event-groups.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/defaults/Event-groups.service.js
rename to frontend/app/configuration/generator/generator/defaults/Event-groups.service.js
diff --git a/frontend/app/modules/configuration/generator/defaults/IGFS.service.js b/frontend/app/configuration/generator/generator/defaults/IGFS.service.js
similarity index 100%
rename from frontend/app/modules/configuration/generator/defaults/IGFS.service.js
rename to frontend/app/configuration/generator/generator/defaults/IGFS.service.js
diff --git a/frontend/app/components/page-configure/icons/configuration.icon.svg b/frontend/app/configuration/icons/configuration.icon.svg
similarity index 100%
rename from frontend/app/components/page-configure/icons/configuration.icon.svg
rename to frontend/app/configuration/icons/configuration.icon.svg
diff --git a/frontend/app/configuration/index.lazy.ts b/frontend/app/configuration/index.lazy.ts
new file mode 100644
index 0000000..79324a5
--- /dev/null
+++ b/frontend/app/configuration/index.lazy.ts
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); 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.
+ */
+
+import {UIRouter, LazyLoadResult} from '@uirouter/angularjs';
+import {default as configurationIcon} from './icons/configuration.icon.svg';
+import {default as IconsService} from '../components/ignite-icon/service';
+import {navigationMenuItem, AppStore} from '../store';
+
+export default angular
+ .module('ignite-console.configuration-lazy', [])
+ .run(['$uiRouter', '$injector', function($uiRouter: UIRouter, $injector: ng.auto.IInjectorService) {
+ $uiRouter.stateRegistry.register({
+ name: 'base.configuration.**',
+ url: '/configuration',
+ async lazyLoad($transition$) {
+ const module = await import(/* webpackChunkName: "configuration" */'./index');
+ $injector.loadNewModules([module.default.name]);
+ return [] as LazyLoadResult;
+ }
+ });
+ }])
+ .run(['IgniteIcon', (icons: IconsService) => { icons.registerIcons({configuration: configurationIcon}); }])
+ .run(['Store', (store: AppStore) => {
+ store.dispatch(navigationMenuItem({
+ activeSref: 'base.configuration.**',
+ icon: 'configuration',
+ label: 'Configuration',
+ order: 1,
+ sref: 'base.configuration.overview'
+ }));
+ }])
+ .config(['DefaultStateProvider', (DefaultState) => {
+ DefaultState.setRedirectTo(() => 'base.configuration.overview');
+ }]);
diff --git a/frontend/app/components/page-configure/index.ts b/frontend/app/configuration/index.ts
similarity index 81%
rename from frontend/app/components/page-configure/index.ts
rename to frontend/app/configuration/index.ts
index a2f76e1..51ba059 100644
--- a/frontend/app/components/page-configure/index.ts
+++ b/frontend/app/configuration/index.ts
@@ -15,13 +15,14 @@
* limitations under the License.
*/
-import angular from 'angular';
-
-import 'angular1-async-filter';
-import {UIRouterRx} from '@uirouter/rx';
import uiValidate from 'angular-ui-validate';
+import {UIRouterRx} from '@uirouter/rx';
+import {UIRouter} from '@uirouter/angularjs';
-import component from './component';
+import {withLatestFrom, tap, filter, scan} from 'rxjs/operators';
+
+import generatorModule from './generator/configuration.module';
+
import ConfigureState from './services/ConfigureState';
import PageConfigure from './services/PageConfigure';
import ConfigurationDownload from './services/ConfigurationDownload';
@@ -31,6 +32,15 @@
import ConfigurationResource from './services/ConfigurationResource';
import selectors from './store/selectors';
import effects from './store/effects';
+import Clusters from './services/Clusters';
+import Caches from './services/Caches';
+import IGFSs from './services/IGFSs';
+import Models from './services/Models';
+
+import pageConfigure from './components/page-configure';
+import pageConfigureBasic from './components/page-configure-basic';
+import pageConfigureAdvanced from './components/page-configure-advanced';
+import pageConfigureOverview from './components/page-configure-overview';
import projectStructurePreview from './components/modal-preview-project';
import itemsTable from './components/pc-items-table';
@@ -45,15 +55,12 @@
import buttonPreviewProject from './components/button-preview-project';
import previewPanel from './components/preview-panel';
import pcSplitButton from './components/pc-split-button';
+import uiAceTabs from './components/ui-ace-tabs.directive';
-import {errorState} from './transitionHooks/errorState';
-import {default as ActivitiesData} from 'app/core/activities/Activities.data';
+import uiAceJava from './components/ui-ace-java';
+import uiAceSpring from './components/ui-ace-spring';
-import {withLatestFrom, tap, filter, scan} from 'rxjs/operators';
-
-import {navigationMenuItem, AppStore} from '../../store';
-import {default as configurationIcon} from './icons/configuration.icon.svg';
-import {default as IconsService} from '../ignite-icon/service';
+import {registerStates} from './states';
import {
editReducer2,
@@ -73,27 +80,27 @@
igfssActionTypes,
shortIGFSsActionTypes,
refsReducer
-} from './reducer';
+} from './store/reducer';
-import {registerStates} from './states';
+import {errorState} from './transitionHooks/errorState';
+import {default as ActivitiesData} from '../core/activities/Activities.data';
-/**
- * @param {uirouter.UIRouter} $uiRouter
- * @param {ActivitiesData} ActivitiesData
- */
-function registerActivitiesHook($uiRouter, ActivitiesData) {
+registerActivitiesHook.$inject = ['$uiRouter', 'IgniteActivitiesData'];
+function registerActivitiesHook($uiRouter: UIRouter, ActivitiesData: ActivitiesData) {
$uiRouter.transitionService.onSuccess({to: 'base.configuration.**'}, (transition) => {
ActivitiesData.post({group: 'configuration', action: transition.targetState().name()});
});
}
-registerActivitiesHook.$inject = ['$uiRouter', 'IgniteActivitiesData'];
-
export default angular
- .module('ignite-console.page-configure', [
- 'ui.router',
- 'asyncFilter',
+ .module('ignite-console.configuration', [
uiValidate,
+ 'asyncFilter',
+ generatorModule.name,
+ pageConfigure.name,
+ pageConfigureBasic.name,
+ pageConfigureAdvanced.name,
+ pageConfigureOverview.name,
pcUiGridFilters.name,
projectStructurePreview.name,
itemsTable.name,
@@ -103,16 +110,14 @@
buttonDownloadProject.name,
buttonPreviewProject.name,
previewPanel.name,
- pcSplitButton.name
+ pcSplitButton.name,
+ uiAceJava.name,
+ uiAceSpring.name
])
.config(registerStates)
- .config(['DefaultStateProvider', (DefaultState) => {
- DefaultState.setRedirectTo(() => 'base.configuration.overview');
- }])
.run(registerActivitiesHook)
- .run(['ConfigEffects', 'ConfigureState', '$uiRouter', 'Store', 'IgniteIcon', (ConfigEffects, ConfigureState, $uiRouter, store: AppStore, icons: IconsService) => {
- icons.registerIcons({configuration: configurationIcon});
-
+ .run(errorState)
+ .run(['ConfigEffects', 'ConfigureState', '$uiRouter', (ConfigEffects, ConfigureState, $uiRouter) => {
$uiRouter.plugin(UIRouterRx);
ConfigureState.addReducer(refsReducer({
@@ -161,19 +166,7 @@
)
.subscribe();
ConfigEffects.connect();
-
- store.dispatch(navigationMenuItem({
- activeSref: 'base.configuration.**',
- icon: 'configuration',
- label: 'Configuration',
- order: 1,
- sref: 'base.configuration.overview'
- }));
}])
- .component('pageConfigure', component)
- .directive('pcIsInCollection', isInCollection)
- .directive('fakeUiCanExit', fakeUiCanExit)
- .directive('formUiCanExitGuard', formUICanExitGuard)
.factory('configSelectionManager', ConfigSelectionManager)
.service('IgniteSummaryZipper', SummaryZipper)
.service('IgniteConfigurationResource', ConfigurationResource)
@@ -183,4 +176,11 @@
.service('PageConfigure', PageConfigure)
.service('ConfigureState', ConfigureState)
.service('ConfigurationDownload', ConfigurationDownload)
- .run(errorState);
+ .service('Clusters', Clusters)
+ .service('Caches', Caches)
+ .service('IGFSs', IGFSs)
+ .service('Models', Models)
+ .directive('pcIsInCollection', isInCollection)
+ .directive('fakeUiCanExit', fakeUiCanExit)
+ .directive('formUiCanExitGuard', formUICanExitGuard)
+ .directive('igniteUiAceTabs', uiAceTabs);
diff --git a/frontend/app/configuration/mixins.pug b/frontend/app/configuration/mixins.pug
new file mode 100644
index 0000000..75c96aa
--- /dev/null
+++ b/frontend/app/configuration/mixins.pug
@@ -0,0 +1,400 @@
+//-
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); 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.
+
+include /app/primitives/btn-group/index
+include /app/primitives/datepicker/index
+include /app/primitives/timepicker/index
+include /app/primitives/dropdown/index
+include /app/primitives/switcher/index
+include /app/primitives/form-field/index
+
+//- Function that convert enabled state to corresponding disabled state.
+-var enabledToDisabled = function (enabled) {
+- return (enabled === false || enabled === true) ? !enabled : '!(' + enabled + ')';
+-}
+
+//- Mixin for XML and Java preview.
+mixin preview-xml-java(master, generator, detail)
+ ignite-ui-ace-tabs
+ .preview-panel(ng-init='mode = "spring"')
+ .preview-legend
+ a(ng-class='{active: mode === "spring"}' ng-click='mode = "spring"') Spring
+ a(ng-class='{active: mode === "java"}' ng-click='mode = "java"') Java
+ //a(ng-class='{active: mode === "app.config"}' ng-click='mode = "app.config"') app.config
+ .preview-content(ng-switch='mode')
+ ignite-ui-ace-spring(ng-switch-when='spring' data-master=master data-generator=generator ng-model='$parent.data' data-detail=detail)
+ ignite-ui-ace-java(ng-switch-when='java' data-master=master data-generator=generator ng-model='$parent.data' data-detail=detail)
+ .preview-content-empty(ng-if='!data')
+ label All Defaults
+
+mixin form-field__java-class({ label, model, name, disabled, required, tip, placeholder, validationActive })
+ -var errLbl = label.substring(0, label.length - 1)
+
+ +form-field__text({
+ label,
+ model,
+ name,
+ disabled,
+ required,
+ placeholder: placeholder || 'Enter fully qualified class name',
+ tip
+ })(
+ data-java-identifier='true'
+ data-java-package-specified='true'
+ data-java-keywords='true'
+ data-java-built-in-class='true'
+ data-validation-active=validationActive ? `{{ ${validationActive} }}` : `'always'`
+ )&attributes(attributes)
+ if block
+ block
+
+ +form-field__error({ error: 'javaBuiltInClass', message: `${ errLbl } should not be the Java built-in class!` })
+ +form-field__error({ error: 'javaKeywords', message: `${ errLbl } could not contains reserved Java keyword!` })
+ +form-field__error({ error: 'javaPackageSpecified', message: `${ errLbl } does not have package specified!` })
+ +form-field__error({ error: 'javaIdentifier', message: `${ errLbl } is invalid Java identifier!` })
+
+//- Mixin for text field with enabled condition with options.
+mixin form-field__java-class--typeahead({ label, model, name, options, disabled, required, placeholder, tip, validationActive })
+ -var errLbl = label.substring(0, label.length - 1)
+
+ +form-field__typeahead({
+ label,
+ model,
+ name,
+ disabled,
+ required,
+ placeholder,
+ options,
+ tip
+ })&attributes(attributes)(
+ data-java-identifier='true'
+ data-java-package-specified='allow-built-in'
+ data-java-keywords='true'
+ data-validation-active=validationActive ? `{{ ${validationActive} }}` : `'always'`
+ )
+ +form-field__error({ error: 'javaKeywords', message: `${ errLbl } could not contains reserved Java keyword!` })
+ +form-field__error({ error: 'javaPackageSpecified', message: `${ errLbl } does not have package specified!` })
+ +form-field__error({ error: 'javaIdentifier', message: `${ errLbl } is invalid Java identifier!` })
+
+mixin form-field__java-package({ label, model, name, disabled, required, tip, tipOpts, placeholder })
+ +form-field__text({
+ label,
+ model,
+ name,
+ disabled,
+ required,
+ tip,
+ tipOpts,
+ placeholder
+ })(
+ data-java-keywords='true'
+ data-java-package-name='package-only'
+ )&attributes(attributes)
+ if block
+ block
+
+ +form-field__error({ error: 'javaPackageName', message: 'Package name is invalid!' })
+ +form-field__error({ error: 'javaKeywords', message: 'Package name could not contains reserved java keyword!' })
+
+//- Mixin for text field with IP address check.
+mixin form-field__ip-address({ label, model, name, enabled, placeholder, tip })
+ +form-field__text({
+ label,
+ model,
+ name,
+ disabled: enabledToDisabled(enabled),
+ placeholder,
+ tip
+ })(data-ipaddress='true')
+ +form-field__error({ error: 'ipaddress', message: 'Invalid address!' })
+
+//- Mixin for text field with IP address and port range check.
+mixin form-field__ip-address-with-port-range({ label, model, name, enabled, placeholder, tip })
+ +form-field__text({
+ label,
+ model,
+ name,
+ disabled: enabledToDisabled(enabled),
+ placeholder,
+ tip
+ })(
+ data-ipaddress='true'
+ data-ipaddress-with-port='true'
+ data-ipaddress-with-port-range='true'
+ )
+ +form-field__error({ error: 'ipaddress', message: 'Invalid address!' })
+ +form-field__error({ error: 'ipaddressPort', message: 'Invalid port!' })
+ +form-field__error({ error: 'ipaddressPortRange', message: 'Invalid port range!' })
+
+//- Mixin for url field.
+mixin form-field__url({ label, model, name, enabled, required, placeholder, tip })
+ -var errLbl = label.substring(0, label.length - 1)
+
+ +form-field__text({
+ label,
+ model,
+ name,
+ disabled: enabledToDisabled(enabled),
+ required,
+ placeholder,
+ tip
+ })(
+ type='url'
+ )
+ if block
+ block
+
+ +form-field__error({ error: 'url', message: `${ errLbl } should be a valid URL!` })
+
+mixin list-text-field({ items, lbl, name, itemName, itemsName })
+ list-editable(ng-model=items)&attributes(attributes)
+ list-editable-item-view
+ | {{ $item }}
+
+ list-editable-item-edit
+ +form-field__text({
+ label: lbl,
+ model: '$item',
+ name: `"${name}"`,
+ required: true,
+ placeholder: `Enter ${lbl.toLowerCase()}`
+ })(
+ ignite-unique=items
+ ignite-form-field-input-autofocus='true'
+ )
+ if block
+ block
+
+ list-editable-no-items
+ list-editable-add-item-button(
+ add-item=`$editLast((${items} = ${items} || []).push(''))`
+ label-single=itemName
+ label-multiple=itemsName
+ )
+
+mixin list-java-class-field(label, model, name, items)
+ +form-field__text({
+ label,
+ model,
+ name,
+ required: true,
+ placeholder: 'Enter fully qualified class name'
+ })(
+ java-identifier='true'
+ java-package-specified='true'
+ java-keywords='true'
+ java-built-in-class='true'
+
+ ignite-unique=items
+ ignite-form-field-input-autofocus='true'
+ )
+ +form-field__error({ error: 'javaBuiltInClass', message: `${ label } should not be the Java built-in class!` })
+ +form-field__error({ error: 'javaKeywords', message: `${ label } could not contains reserved Java keyword!` })
+ +form-field__error({ error: 'javaPackageSpecified', message: `${ label } does not have package specified!` })
+ +form-field__error({ error: 'javaIdentifier', message: `${ label } is invalid Java identifier!` })
+
+ if block
+ block
+
+mixin list-url-field(label, model, name, items)
+ +form-field__text({
+ label,
+ model,
+ name,
+ required: true,
+ placeholder: 'Enter URL'
+ })(
+ type='url'
+
+ ignite-unique=items
+ ignite-form-field-input-autofocus='true'
+ )
+ +form-field__error({ error: 'url', message: 'URL should be valid!' })
+
+ if block
+ block
+
+mixin list-addresses({ items, name, tip, withPortRange = true })
+ list-editable(
+ ng-model=items
+ name=name
+ list-editable-cols=`::[{name: "Addresses:", tip: "${tip}"}]`
+ )&attributes(attributes)
+ list-editable-item-view {{ $item }}
+ list-editable-item-edit(item-name='address')
+ +form-field__text({
+ label: 'Address',
+ model: 'address',
+ name: '"address"',
+ required: true,
+ placeholder: 'IP address:port'
+ })(
+ ipaddress='true'
+ ipaddress-with-port='true'
+ ipaddress-with-port-range=withPortRange
+ ignite-unique=items
+ ignite-form-field-input-autofocus='true'
+ )
+ +form-field__error({ error: 'igniteUnique', message: 'Such IP address already exists!' })
+ +form-field__error({ error: 'ipaddress', message: 'Invalid address!' })
+ +form-field__error({ error: 'ipaddressPort', message: 'Invalid port!' })
+ +form-field__error({ error: 'ipaddressPortRange', message: 'Invalid port range!' })
+ +form-field__error({ error: 'required', message: 'IP address:port could not be empty!' })
+
+ list-editable-no-items
+ list-editable-add-item-button(
+ add-item=`$editLast((${items} = ${items} || []).push(""))`
+ label-multiple='addresses'
+ label-single='address'
+ )
+
+mixin form-field__cache-modes({ label, model, name, placeholder })
+ +form-field__dropdown({
+ label, model, name, placeholder,
+ options: '[\
+ {value: "LOCAL", label: "LOCAL"},\
+ {value: "REPLICATED", label: "REPLICATED"},\
+ {value: "PARTITIONED", label: "PARTITIONED"}\
+ ]',
+ tip: 'Cache modes:\
+ <ul>\
+ <li>PARTITIONED - in this mode the overall key set will be divided into partitions and all partitions will be split equally between participating nodes</li>\
+ <li>REPLICATED - in this mode all the keys are distributed to all participating nodes</li>\
+ <li>LOCAL - in this mode caches residing on different grid nodes will not know about each other</li>\
+ </ul>'
+ })&attributes(attributes)
+ if block
+ block
+
+//- Mixin for eviction policy.
+mixin form-field__eviction-policy({ model, name, enabled, required, tip })
+ -var kind = model + '.kind'
+ -var policy = model + '[' + kind + ']'
+
+ .pc-form-grid-col-60
+ +form-field__dropdown({
+ label: 'Eviction policy:',
+ model: kind,
+ name: `${name}+"Kind"`,
+ disabled: enabledToDisabled(enabled),
+ required: required,
+ placeholder: '{{ ::$ctrl.Caches.evictionPolicy.kind.default }}',
+ options: '::$ctrl.Caches.evictionPolicy.values',
+ tip: tip
+ })
+ .pc-form-group.pc-form-grid-row(ng-if=kind)
+ .pc-form-grid-col-30
+ +form-field__number({
+ label: 'Batch size',
+ model: policy + '.batchSize',
+ name: name + '+ "batchSize"',
+ disabled: enabledToDisabled(enabled),
+ placeholder: '1',
+ min: '1',
+ tip: 'Number of entries to remove on shrink'
+ })
+ .pc-form-grid-col-30
+ form-field-size(
+ label='Max memory size:'
+ ng-model=`${policy}.maxMemorySize`
+ ng-model-options='{allowInvalid: true}'
+ name=`${name}.maxMemorySize`
+ ng-disabled=enabledToDisabled(enabled)
+ tip='Maximum allowed cache size'
+ placeholder='{{ ::$ctrl.Caches.evictionPolicy.maxMemorySize.default }}'
+ min=`{{ $ctrl.Caches.evictionPolicy.maxMemorySize.min(${model}) }}`
+ size-scale-label='mb'
+ size-type='bytes'
+ )
+ +form-field__error({ error: 'min', message: 'Either maximum memory size or maximum size should be greater than 0' })
+ .pc-form-grid-col-60
+ +form-field__number({
+ label: 'Max size:',
+ model: policy + '.maxSize',
+ name: name + '+ "maxSize"',
+ disabled: enabledToDisabled(enabled),
+ placeholder: '{{ ::$ctrl.Caches.evictionPolicy.maxSize.default }}',
+ min: `{{ $ctrl.Caches.evictionPolicy.maxSize.min(${model}) }}`,
+ tip: 'Maximum allowed size of cache before entry will start getting evicted'
+ })(
+ ng-model-options='{allowInvalid: true}'
+ )
+ +form-field__error({ error: 'min', message: 'Either maximum memory size or maximum size should be greater than 0' })
+
+mixin list-pair-edit({ items, keyLbl, valLbl, itemName, itemsName })
+ list-editable(ng-model=items)
+ list-editable-item-view
+ | {{ $item.name }} = {{ $item.value }}
+
+ list-editable-item-edit
+ - form = '$parent.form'
+ .pc-form-grid-row
+ .pc-form-grid-col-30(divider='=')
+ +form-field__text({
+ label: keyLbl,
+ model: '$item.name',
+ name: '"name"',
+ required: true,
+ placeholder: keyLbl
+ })(
+ ignite-unique=items
+ ignite-unique-property='name'
+ ignite-auto-focus
+ )
+ +form-field__error({ error: 'igniteUnique', message: 'Property with such name already exists!' })
+ .pc-form-grid-col-30
+ +form-field__text({
+ label: valLbl,
+ model: '$item.value',
+ name: '"value"',
+ required: true,
+ placeholder: valLbl
+ })
+
+ list-editable-no-items
+ list-editable-add-item-button(
+ add-item=`$editLast((${items} = ${items} || []).push({}))`
+ label-single=itemName
+ label-multiple=itemsName
+ )
+
+mixin form-field__dialect({ label, model, name, required, tip, genericDialectName, placeholder })
+ +form-field__dropdown({
+ label,
+ model,
+ name,
+ required,
+ placeholder,
+ options: '[\
+ {value: "Generic", label: "' + genericDialectName + '"},\
+ {value: "Oracle", label: "Oracle"},\
+ {value: "DB2", label: "IBM DB2"},\
+ {value: "SQLServer", label: "Microsoft SQL Server"},\
+ {value: "MySQL", label: "MySQL"},\
+ {value: "PostgreSQL", label: "PostgreSQL"},\
+ {value: "H2", label: "H2 database"}\
+ ]',
+ tip: `${ tip }
+ <ul>
+ <li>${ genericDialectName }</li>
+ <li>Oracle database</li>
+ <li>IBM DB2</li>
+ <li>Microsoft SQL Server</li>
+ <li>MySQL</li>
+ <li>PostgreSQL</li>
+ <li>H2 database</li>
+ </ul>`
+ })
diff --git a/frontend/app/services/Caches.js b/frontend/app/configuration/services/Caches.ts
similarity index 89%
rename from frontend/app/services/Caches.js
rename to frontend/app/configuration/services/Caches.ts
index db99a4b..a32281f 100644
--- a/frontend/app/services/Caches.js
+++ b/frontend/app/configuration/services/Caches.ts
@@ -17,46 +17,35 @@
import ObjectID from 'bson-objectid';
import omit from 'lodash/fp/omit';
+import {CacheModes, AtomicityModes, ShortCache} from '../types';
+import {Menu} from 'app/types';
export default class Caches {
static $inject = ['$http'];
- /** @type {ig.menu<ig.config.cache.CacheModes>} */
- cacheModes = [
+ cacheModes: Menu<CacheModes> = [
{value: 'LOCAL', label: 'LOCAL'},
{value: 'REPLICATED', label: 'REPLICATED'},
{value: 'PARTITIONED', label: 'PARTITIONED'}
];
- /** @type {ig.menu<ig.config.cache.AtomicityModes>} */
- atomicityModes = [
+ atomicityModes: Menu<AtomicityModes> = [
{value: 'ATOMIC', label: 'ATOMIC'},
{value: 'TRANSACTIONAL', label: 'TRANSACTIONAL'},
{value: 'TRANSACTIONAL_SNAPSHOT', label: 'TRANSACTIONAL_SNAPSHOT'}
];
- /**
- * @param {ng.IHttpService} $http
- */
- constructor($http) {
- this.$http = $http;
- }
+ constructor(private $http: ng.IHttpService) {}
saveCache(cache) {
return this.$http.post('/api/v1/configuration/caches/save', cache);
}
- /**
- * @param {string} cacheID
- */
- getCache(cacheID) {
+ getCache(cacheID: string) {
return this.$http.get(`/api/v1/configuration/caches/${cacheID}`);
}
- /**
- * @param {string} cacheID
- */
- removeCache(cacheID) {
+ removeCache(cacheID: string) {
return this.$http.post(`/api/v1/configuration/caches/remove/${cacheID}`);
}
@@ -83,11 +72,7 @@
};
}
- /**
- * @param {object} cache
- * @returns {ig.config.cache.ShortCache}
- */
- toShortCache(cache) {
+ toShortCache(cache: any): ShortCache {
return {
_id: cache._id,
name: cache.name,
@@ -229,19 +214,13 @@
}
};
- /**
- * @param {ig.config.cache.ShortCache} cache
- */
- getCacheBackupsCount(cache) {
+ getCacheBackupsCount(cache: ShortCache) {
return this.shouldShowCacheBackupsCount(cache)
? (cache.backups || 0)
: void 0;
}
- /**
- * @param {ig.config.cache.ShortCache} cache
- */
- shouldShowCacheBackupsCount(cache) {
+ shouldShowCacheBackupsCount(cache: ShortCache) {
return cache && cache.cacheMode === 'PARTITIONED';
}
}
diff --git a/frontend/app/services/Clusters.spec.js b/frontend/app/configuration/services/Clusters.spec.js
similarity index 100%
rename from frontend/app/services/Clusters.spec.js
rename to frontend/app/configuration/services/Clusters.spec.js
diff --git a/frontend/app/services/Clusters.js b/frontend/app/configuration/services/Clusters.ts
similarity index 94%
rename from frontend/app/services/Clusters.js
rename to frontend/app/configuration/services/Clusters.ts
index 5649f0a..63ad5a8 100644
--- a/frontend/app/services/Clusters.js
+++ b/frontend/app/configuration/services/Clusters.ts
@@ -20,6 +20,8 @@
import ObjectID from 'bson-objectid/objectid';
import {uniqueName} from 'app/utils/uniqueName';
import omit from 'lodash/fp/omit';
+import {DiscoveryKinds, ShortDomainModel, ShortCluster, FailoverSPIs, LoadBalancingKinds} from '../types';
+import {Menu} from 'app/types';
const uniqueNameValidator = (defaultName = '') => (a, items = []) => {
return a && !items.some((b) => b._id !== a._id && (a.name || defaultName) === (b.name || defaultName));
@@ -28,8 +30,7 @@
export default class Clusters {
static $inject = ['$http'];
- /** @type {ig.menu<ig.config.cluster.DiscoveryKinds>}>} */
- discoveries = [
+ discoveries: Menu<DiscoveryKinds> = [
{value: 'Vm', label: 'Static IPs'},
{value: 'Multicast', label: 'Multicast'},
{value: 'S3', label: 'AWS S3'},
@@ -74,13 +75,10 @@
/**
* Cluster-related configuration stuff
- * @param {ng.IHttpService} $http
*/
- constructor($http) {
- this.$http = $http;
- }
+ constructor(private $http: ng.IHttpService) {}
- getConfiguration(clusterID) {
+ getConfiguration(clusterID: string) {
return this.$http.get(`/api/v1/configuration/${clusterID}`);
}
@@ -88,31 +86,24 @@
return this.$http.get('/api/v1/configuration/list');
}
- getCluster(clusterID) {
+ getCluster(clusterID: string) {
return this.$http.get(`/api/v1/configuration/clusters/${clusterID}`);
}
- getClusterCaches(clusterID) {
+ getClusterCaches(clusterID: string) {
return this.$http.get(`/api/v1/configuration/clusters/${clusterID}/caches`);
}
- /**
- * @param {string} clusterID
- * @returns {ng.IPromise<ng.IHttpResponse<{data: Array<ig.config.model.ShortDomainModel>}>>}
- */
- getClusterModels(clusterID) {
- return this.$http.get(`/api/v1/configuration/clusters/${clusterID}/models`);
+ getClusterModels(clusterID: string) {
+ return this.$http.get<{data: ShortDomainModel[]}>(`/api/v1/configuration/clusters/${clusterID}/models`);
}
getClusterIGFSs(clusterID) {
return this.$http.get(`/api/v1/configuration/clusters/${clusterID}/igfss`);
}
- /**
- * @returns {ng.IPromise<ng.IHttpResponse<{data: Array<ig.config.cluster.ShortCluster>}>>}
- */
getClustersOverview() {
- return this.$http.get('/api/v1/configuration/clusters/');
+ return this.$http.get<{data: ShortCluster[]}>('/api/v1/configuration/clusters/');
}
getClustersOverview$() {
@@ -215,8 +206,7 @@
};
}
- /** @type {ig.menu<ig.config.cluster.FailoverSPIs>} */
- failoverSpis = [
+ failoverSpis: Menu<FailoverSPIs> = [
{value: 'JobStealing', label: 'Job stealing'},
{value: 'Never', label: 'Never'},
{value: 'Always', label: 'Always'},
@@ -410,8 +400,7 @@
return cluster.loadBalancingSpi.push(this.makeBlankLoadBalancingSpi());
}
- /** @type {ig.menu<ig.config.cluster.LoadBalancingKinds>} */
- loadBalancingKinds = [
+ loadBalancingKinds: Menu<LoadBalancingKinds> = [
{value: 'RoundRobin', label: 'Round-robin'},
{value: 'Adaptive', label: 'Adaptive'},
{value: 'WeightedRandom', label: 'Random'},
diff --git a/frontend/app/components/page-configure/services/ConfigChangesGuard.spec.js b/frontend/app/configuration/services/ConfigChangesGuard.spec.js
similarity index 100%
rename from frontend/app/components/page-configure/services/ConfigChangesGuard.spec.js
rename to frontend/app/configuration/services/ConfigChangesGuard.spec.js
diff --git a/frontend/app/components/page-configure/services/ConfigChangesGuard.js b/frontend/app/configuration/services/ConfigChangesGuard.ts
similarity index 85%
rename from frontend/app/components/page-configure/services/ConfigChangesGuard.js
rename to frontend/app/configuration/services/ConfigChangesGuard.ts
index cda9965..a6735fb 100644
--- a/frontend/app/components/page-configure/services/ConfigChangesGuard.js
+++ b/frontend/app/configuration/services/ConfigChangesGuard.ts
@@ -22,7 +22,9 @@
import {html} from 'jsondiffpatch/public/build/jsondiffpatch-formatters.js';
import 'jsondiffpatch/public/formatters-styles/html.css';
-export class IgniteObjectDiffer {
+export class IgniteObjectDiffer<T> {
+ diffPatcher: DiffPatcher
+
constructor() {
this.diffPatcher = new DiffPatcher({
cloneDiffValues: true
@@ -47,25 +49,19 @@
this.diffPatcher.processor.pipes.diff.before('trivial', igniteConfigFalsyFilter);
}
- diff(a, b) {
+ diff(a: T, b: T) {
return this.diffPatcher.diff(a, b);
}
}
-export default class ConfigChangesGuard {
+export default class ConfigChangesGuard<T> {
static $inject = ['Confirm', '$sce'];
- /**
- * @param {Confirm} Confirm.
- * @param {ng.ISCEService} $sce.
- */
- constructor(Confirm, $sce) {
- this.Confirm = Confirm;
- this.$sce = $sce;
- this.differ = new IgniteObjectDiffer();
- }
+ constructor(private Confirm: Confirm, private $sce: ng.ISCEService) {}
- _hasChanges(a, b) {
+ differ = new IgniteObjectDiffer<T>();
+
+ _hasChanges(a: T, b: T) {
return this.differ.diff(a, b);
}
@@ -85,11 +81,10 @@
/**
* Compares values and asks user if he wants to continue.
*
- * @template T
- * @param {T} a Left comparison value.
- * @param {T} b Right comparison value.
+ * @param a Left comparison value.
+ * @param b Right comparison value.
*/
- guard(a, b) {
+ guard(a: T, b: T) {
if (!a && !b)
return Promise.resolve(true);
diff --git a/frontend/app/components/page-configure/services/ConfigSelectionManager.js b/frontend/app/configuration/services/ConfigSelectionManager.ts
similarity index 95%
rename from frontend/app/components/page-configure/services/ConfigSelectionManager.js
rename to frontend/app/configuration/services/ConfigSelectionManager.ts
index b5b46d6..380542c 100644
--- a/frontend/app/components/page-configure/services/ConfigSelectionManager.js
+++ b/frontend/app/configuration/services/ConfigSelectionManager.ts
@@ -17,13 +17,11 @@
import {Observable, merge} from 'rxjs';
import {share, distinctUntilChanged, startWith, filter, map, pluck, withLatestFrom, mapTo} from 'rxjs/operators';
-import {RejectType} from '@uirouter/angularjs';
+import {RejectType, TransitionService} from '@uirouter/angularjs';
import isEqual from 'lodash/isEqual';
-/**
- * @param {uirouter.TransitionService} $transitions
- */
-export default function configSelectionManager($transitions) {
+configSelectionManager.$inject = ['$transitions'];
+export default function configSelectionManager($transitions: TransitionService) {
/**
* Determines what items should be marked as selected and if something is being edited at the moment.
*/
@@ -93,4 +91,3 @@
return {selectedItemIDs$, editGoes$, editLeaves$};
};
}
-configSelectionManager.$inject = ['$transitions'];
diff --git a/frontend/app/components/page-configure/services/ConfigurationDownload.spec.js b/frontend/app/configuration/services/ConfigurationDownload.spec.js
similarity index 100%
rename from frontend/app/components/page-configure/services/ConfigurationDownload.spec.js
rename to frontend/app/configuration/services/ConfigurationDownload.spec.js
diff --git a/frontend/app/components/page-configure/services/ConfigurationDownload.js b/frontend/app/configuration/services/ConfigurationDownload.ts
similarity index 70%
rename from frontend/app/components/page-configure/services/ConfigurationDownload.js
rename to frontend/app/configuration/services/ConfigurationDownload.ts
index 3750e63..a93be29 100644
--- a/frontend/app/components/page-configure/services/ConfigurationDownload.js
+++ b/frontend/app/configuration/services/ConfigurationDownload.ts
@@ -16,6 +16,13 @@
*/
import saver from 'file-saver';
+import {ClusterLike} from '../types';
+import MessagesFactory from 'app/services/Messages.service';
+import Activities from 'app/core/activities/Activities.data';
+import ConfigurationResource from './ConfigurationResource';
+import SummaryZipper from './SummaryZipper';
+import Version from 'app/services/Version.service';
+import PageConfigure from './PageConfigure';
export default class ConfigurationDownload {
static $inject = [
@@ -29,17 +36,20 @@
'PageConfigure'
];
- constructor(messages, activitiesData, configuration, summaryZipper, Version, $q, $rootScope, PageConfigure) {
- Object.assign(this, {messages, activitiesData, configuration, summaryZipper, Version, $q, $rootScope, PageConfigure});
+ constructor(
+ private messages: ReturnType<typeof MessagesFactory>,
+ private activitiesData: Activities,
+ private configuration: ConfigurationResource,
+ private summaryZipper: SummaryZipper,
+ private Version: Version,
+ private $q: ng.IQService,
+ private $rootScope: ng.IRootScopeService & {IgniteDemoMode: boolean},
+ private PageConfigure: PageConfigure
+ ) {}
- this.saver = saver;
- }
+ saver = saver;
- /**
- * @param {{_id: string, name: string}} cluster
- * @returns {Promise}
- */
- downloadClusterConfiguration(cluster) {
+ downloadClusterConfiguration(cluster: ClusterLike) {
this.activitiesData.post({action: '/configuration/download'});
return this.PageConfigure.getClusterConfiguration({clusterID: cluster._id, isDemo: !!this.$rootScope.IgniteDemoMode})
@@ -62,11 +72,11 @@
));
}
- nameFile(cluster) {
+ nameFile(cluster: ClusterLike) {
return `${this.escapeFileName(cluster.name)}-project.zip`;
}
- escapeFileName(name) {
+ escapeFileName(name: string) {
return name.replace(/[\\\/*\"\[\],\.:;|=<>?]/g, '-').replace(/ /g, '_');
}
}
diff --git a/frontend/app/components/page-configure/services/ConfigurationResource.spec.js b/frontend/app/configuration/services/ConfigurationResource.spec.js
similarity index 100%
rename from frontend/app/components/page-configure/services/ConfigurationResource.spec.js
rename to frontend/app/configuration/services/ConfigurationResource.spec.js
diff --git a/frontend/app/components/page-configure/services/ConfigurationResource.js b/frontend/app/configuration/services/ConfigurationResource.ts
similarity index 93%
rename from frontend/app/components/page-configure/services/ConfigurationResource.js
rename to frontend/app/configuration/services/ConfigurationResource.ts
index 269eb93..f286126 100644
--- a/frontend/app/components/page-configure/services/ConfigurationResource.js
+++ b/frontend/app/configuration/services/ConfigurationResource.ts
@@ -17,10 +17,9 @@
import _ from 'lodash';
-/**
- * @param {ng.IHttpService} $http
- */
-export default function ConfigurationResourceService($http) {
+ConfigurationResourceService.$inject = ['$http'];
+
+export default function ConfigurationResourceService($http: ng.IHttpService) {
return {
read() {
return $http.get('/api/v1/configuration/list')
@@ -47,5 +46,3 @@
}
};
}
-
-ConfigurationResourceService.$inject = ['$http'];
diff --git a/frontend/app/components/page-configure/services/ConfigureState.js b/frontend/app/configuration/services/ConfigureState.ts
similarity index 96%
rename from frontend/app/components/page-configure/services/ConfigureState.js
rename to frontend/app/configuration/services/ConfigureState.ts
index 143944c..db631b1 100644
--- a/frontend/app/components/page-configure/services/ConfigureState.js
+++ b/frontend/app/configuration/services/ConfigureState.ts
@@ -19,8 +19,9 @@
import {tap, scan} from 'rxjs/operators';
export default class ConfigureState {
+ actions$: Subject<{type: string}>
+
constructor() {
- /** @type {Subject<{type: string}>} */
this.actions$ = new Subject();
this.state$ = new BehaviorSubject({});
this._combinedReducer = (state, action) => state;
diff --git a/frontend/app/services/IGFSs.js b/frontend/app/configuration/services/IGFSs.ts
similarity index 92%
rename from frontend/app/services/IGFSs.js
rename to frontend/app/configuration/services/IGFSs.ts
index c9bde77..b4c3039 100644
--- a/frontend/app/services/IGFSs.js
+++ b/frontend/app/configuration/services/IGFSs.ts
@@ -29,17 +29,9 @@
{value: 'DUAL_ASYNC', label: 'DUAL_ASYNC'}
];
- /**
- * @param {ng.IHttpService} $http
- */
- constructor($http) {
- this.$http = $http;
- }
+ constructor(private $http: ng.IHttpService) {}
- /**
- * @param {string} igfsID
- */
- getIGFS(igfsID) {
+ getIGFS(igfsID: string) {
return this.$http.get(`/api/v1/configuration/igfs/${igfsID}`);
}
diff --git a/frontend/app/services/Models.js b/frontend/app/configuration/services/Models.ts
similarity index 73%
rename from frontend/app/services/Models.js
rename to frontend/app/configuration/services/Models.ts
index 4b360be..ecd06d8 100644
--- a/frontend/app/services/Models.js
+++ b/frontend/app/configuration/services/Models.ts
@@ -17,29 +17,18 @@
import ObjectID from 'bson-objectid';
import omit from 'lodash/fp/omit';
+import {DomainModel, IndexField, ShortDomainModel, Index, Field, KeyField, ValueField} from '../types';
export default class Models {
static $inject = ['$http'];
- /**
- * @param {ng.IHttpService} $http
- */
- constructor($http) {
- this.$http = $http;
+ constructor(private $http: ng.IHttpService) {}
+
+ getModel(modelID: string) {
+ return this.$http.get<{data: DomainModel[]}>(`/api/v1/configuration/domains/${modelID}`);
}
- /**
- * @param {string} modelID
- * @returns {ng.IPromise<ng.IHttpResponse<{data: ig.config.model.DomainModel}>>}
- */
- getModel(modelID) {
- return this.$http.get(`/api/v1/configuration/domains/${modelID}`);
- }
-
- /**
- * @returns {ig.config.model.DomainModel}
- */
- getBlankModel() {
+ getBlankModel(): DomainModel {
return {
_id: ObjectID.generate(),
generatePojo: true,
@@ -74,17 +63,11 @@
normalize = omit(['__v', 'space']);
- /**
- * @param {Array<ig.config.model.IndexField>} fields
- */
- addIndexField(fields) {
+ addIndexField(fields: IndexField[]) {
return fields[fields.push({_id: ObjectID.generate(), direction: true}) - 1];
}
- /**
- * @param {ig.config.model.DomainModel} model
- */
- addIndex(model) {
+ addIndex(model: DomainModel) {
if (!model)
return;
@@ -101,20 +84,13 @@
return model.indexes[model.indexes.length - 1];
}
- /**
- * @param {ig.config.model.DomainModel} model
- */
- hasIndex(model) {
+ hasIndex(model: DomainModel) {
return model.queryMetadata === 'Configuration'
? !!(model.keyFields && model.keyFields.length)
: (!model.generatePojo || !model.databaseSchema && !model.databaseTable);
}
- /**
- * @param {ig.config.model.DomainModel} model
- * @returns {ig.config.model.ShortDomainModel}
- */
- toShortModel(model) {
+ toShortModel(model: DomainModel): ShortDomainModel {
return {
_id: model._id,
keyType: model.keyType,
@@ -126,26 +102,22 @@
queryIndexes = {
/**
* Validates query indexes for completeness
- * @param {Array<ig.config.model.Index>} $value
*/
- complete: ($value = []) => $value.every((index) => (
+ complete: ($value: Index[] = []) => $value.every((index) => (
index.name && index.indexType &&
index.fields && index.fields.length && index.fields.every((field) => !!field.name))
),
/**
* Checks if field names used in indexes exist
- * @param {Array<ig.config.model.Index>} $value
- * @param {Array<ig.config.model.Field>} fields
*/
- fieldsExist: ($value = [], fields = []) => {
+ fieldsExist: ($value: Index[] = [], fields: Field[] = []) => {
const names = new Set(fields.map((field) => field.name));
return $value.every((index) => index.fields && index.fields.every((field) => names.has(field.name)));
},
/**
* Check if fields of query indexes have unique names
- * @param {Array<ig.config.model.Index>} $value
*/
- indexFieldsHaveUniqueNames: ($value = []) => {
+ indexFieldsHaveUniqueNames: ($value: Index[] = []) => {
return $value.every((index) => {
if (!index.fields)
return true;
@@ -158,11 +130,8 @@
/**
* Removes instances of removed fields from queryKeyFields and index fields
- *
- * @param {ig.config.model.DomainModel} model
- * @returns {ig.config.model.DomainModel}
*/
- removeInvalidFields(model) {
+ removeInvalidFields(model: DomainModel): DomainModel {
if (!model)
return model;
@@ -179,9 +148,8 @@
/**
* Checks that collection of DB fields has unique DB and Java field names
- * @param {Array<ig.config.model.KeyField|ig.config.model.ValueField>} DBFields
*/
- storeKeyDBFieldsUnique(DBFields = []) {
+ storeKeyDBFieldsUnique(DBFields: (KeyField|ValueField)[] = []) {
return ['databaseFieldName', 'javaFieldName'].every((key) => {
const items = new Set(DBFields.map((field) => field[key]));
return items.size === DBFields.length;
diff --git a/frontend/app/components/page-configure/services/PageConfigure.spec.js b/frontend/app/configuration/services/PageConfigure.spec.js
similarity index 98%
rename from frontend/app/components/page-configure/services/PageConfigure.spec.js
rename to frontend/app/configuration/services/PageConfigure.spec.js
index 145eed6..dc18b69 100644
--- a/frontend/app/components/page-configure/services/PageConfigure.spec.js
+++ b/frontend/app/configuration/services/PageConfigure.spec.js
@@ -15,7 +15,6 @@
* limitations under the License.
*/
-import {suite, test} from 'mocha';
import {assert} from 'chai';
import {spy} from 'sinon';
import {of, throwError} from 'rxjs';
@@ -30,7 +29,7 @@
import {REMOVE_CLUSTERS_LOCAL_REMOTE, CLONE_CLUSTERS} from './PageConfigure';
import PageConfigure from './PageConfigure';
-import {REMOVE_CLUSTERS, LOAD_LIST, ADD_CLUSTERS, UPDATE_CLUSTER} from '../reducer';
+import {REMOVE_CLUSTERS, LOAD_LIST, ADD_CLUSTERS, UPDATE_CLUSTER} from '../store/reducer';
suite.skip('PageConfigure service', () => {
suite('cloneCluster$ effect', () => {
diff --git a/frontend/app/components/page-configure/services/PageConfigure.js b/frontend/app/configuration/services/PageConfigure.ts
similarity index 78%
rename from frontend/app/components/page-configure/services/PageConfigure.js
rename to frontend/app/configuration/services/PageConfigure.ts
index 5eaedde..b7f04ee 100644
--- a/frontend/app/components/page-configure/services/PageConfigure.js
+++ b/frontend/app/configuration/services/PageConfigure.ts
@@ -24,22 +24,15 @@
ofType
} from '../store/effects';
-import {default as ConfigureState} from 'app/components/page-configure/services/ConfigureState';
-import {default as ConfigSelectors} from 'app/components/page-configure/store/selectors';
+import {default as ConfigureState} from './ConfigureState';
+import {default as ConfigSelectors} from '../store/selectors';
export default class PageConfigure {
static $inject = ['ConfigureState', 'ConfigSelectors'];
- /**
- * @param {ConfigureState} ConfigureState
- * @param {ConfigSelectors} ConfigSelectors
- */
- constructor(ConfigureState, ConfigSelectors) {
- this.ConfigureState = ConfigureState;
- this.ConfigSelectors = ConfigSelectors;
- }
+ constructor(private ConfigureState: ConfigureState, private ConfigSelectors: ConfigSelectors) {}
- getClusterConfiguration({clusterID, isDemo}) {
+ getClusterConfiguration({clusterID, isDemo}: {clusterID: string, isDemo: boolean}) {
return merge(
timer(1).pipe(
take(1),
diff --git a/frontend/app/components/page-configure/services/SummaryZipper.js b/frontend/app/configuration/services/SummaryZipper.ts
similarity index 92%
rename from frontend/app/components/page-configure/services/SummaryZipper.js
rename to frontend/app/configuration/services/SummaryZipper.ts
index 8bc16b4..d02f785 100644
--- a/frontend/app/components/page-configure/services/SummaryZipper.js
+++ b/frontend/app/configuration/services/SummaryZipper.ts
@@ -17,10 +17,7 @@
import Worker from './summary.worker';
-/**
- * @param {ng.IQService} $q
- */
-export default function SummaryZipperService($q) {
+export default function SummaryZipperService($q: ng.IQService) {
return function(message) {
const defer = $q.defer();
const worker = new Worker();
diff --git a/frontend/app/components/page-configure/services/summary.worker.js b/frontend/app/configuration/services/summary.worker.js
similarity index 89%
rename from frontend/app/components/page-configure/services/summary.worker.js
rename to frontend/app/configuration/services/summary.worker.js
index b3b0bce..bebc675 100644
--- a/frontend/app/components/page-configure/services/summary.worker.js
+++ b/frontend/app/configuration/services/summary.worker.js
@@ -17,14 +17,14 @@
import JSZip from 'jszip';
-import IgniteMavenGenerator from 'app/modules/configuration/generator/Maven.service';
-import IgniteDockerGenerator from 'app/modules/configuration/generator/Docker.service';
-import IgniteReadmeGenerator from 'app/modules/configuration/generator/Readme.service';
-import IgnitePropertiesGenerator from 'app/modules/configuration/generator/Properties.service';
-import IgniteConfigurationGenerator from 'app/modules/configuration/generator/ConfigurationGenerator';
+import IgniteMavenGenerator from '../generator/generator/Maven.service';
+import IgniteDockerGenerator from '../generator/generator/Docker.service';
+import IgniteReadmeGenerator from '../generator/generator/Readme.service';
+import IgnitePropertiesGenerator from '../generator/generator/Properties.service';
+import IgniteConfigurationGenerator from '../generator/generator/ConfigurationGenerator';
-import IgniteJavaTransformer from 'app/modules/configuration/generator/JavaTransformer.service';
-import IgniteSpringTransformer from 'app/modules/configuration/generator/SpringTransformer.service';
+import IgniteJavaTransformer from '../generator/generator/JavaTransformer.service';
+import IgniteSpringTransformer from '../generator/generator/SpringTransformer.service';
import {nonEmpty, nonNil} from 'app/utils/lodashMixins';
import get from 'lodash/get';
diff --git a/frontend/app/components/page-configure/states.js b/frontend/app/configuration/states.ts
similarity index 92%
rename from frontend/app/components/page-configure/states.js
rename to frontend/app/configuration/states.ts
index 3b8dec9..33e4dab 100644
--- a/frontend/app/components/page-configure/states.js
+++ b/frontend/app/configuration/states.ts
@@ -15,14 +15,18 @@
* limitations under the License.
*/
-import pageConfigureAdvancedClusterComponent from '../page-configure-advanced/components/page-configure-advanced-cluster/component';
-import pageConfigureAdvancedModelsComponent from '../page-configure-advanced/components/page-configure-advanced-models/component';
-import pageConfigureAdvancedCachesComponent from '../page-configure-advanced/components/page-configure-advanced-caches/component';
-import pageConfigureAdvancedIGFSComponent from '../page-configure-advanced/components/page-configure-advanced-igfs/component';
+import {StateParams} from '@uirouter/angularjs';
-import {Observable, from, combineLatest} from 'rxjs';
+import pageConfigureAdvancedClusterComponent from './components/page-configure-advanced/components/page-configure-advanced-cluster/component';
+import pageConfigureAdvancedModelsComponent from './components/page-configure-advanced/components/page-configure-advanced-models/component';
+import pageConfigureAdvancedCachesComponent from './components/page-configure-advanced/components/page-configure-advanced-caches/component';
+import pageConfigureAdvancedIGFSComponent from './components/page-configure-advanced/components/page-configure-advanced-igfs/component';
+
+import {from, combineLatest} from 'rxjs';
import {switchMap, take, map} from 'rxjs/operators';
+export type ClusterParams = ({clusterID: string} | {clusterID: 'new'}) & StateParams;
+
const idRegex = `new|[a-z0-9]+`;
const shortCachesResolve = ['ConfigSelectors', 'ConfigureState', 'ConfigEffects', '$transition$', function(ConfigSelectors, ConfigureState, {etp}, $transition$) {
diff --git a/frontend/app/components/page-configure/store/actionCreators.js b/frontend/app/configuration/store/actionCreators.js
similarity index 100%
rename from frontend/app/components/page-configure/store/actionCreators.js
rename to frontend/app/configuration/store/actionCreators.js
diff --git a/frontend/app/components/page-configure/store/actionTypes.js b/frontend/app/configuration/store/actionTypes.js
similarity index 100%
rename from frontend/app/components/page-configure/store/actionTypes.js
rename to frontend/app/configuration/store/actionTypes.js
diff --git a/frontend/app/components/page-configure/store/effects.js b/frontend/app/configuration/store/effects.js
similarity index 98%
rename from frontend/app/components/page-configure/store/effects.js
rename to frontend/app/configuration/store/effects.js
index ac807dc..ed90b43 100644
--- a/frontend/app/components/page-configure/store/effects.js
+++ b/frontend/app/configuration/store/effects.js
@@ -30,7 +30,7 @@
shortClustersActionTypes,
shortIGFSsActionTypes,
shortModelsActionTypes
-} from '../reducer';
+} from './reducer';
import {
ADVANCED_SAVE_CACHE,
@@ -57,13 +57,13 @@
removeClusterItemsConfirmed
} from './actionCreators';
-import ConfigureState from 'app/components/page-configure/services/ConfigureState';
-import ConfigurationDownload from 'app/components/page-configure/services/ConfigurationDownload';
-import ConfigSelectors from 'app/components/page-configure/store/selectors';
-import Clusters from 'app/services/Clusters';
-import Caches from 'app/services/Caches';
-import Models from 'app/services/Models';
-import IGFSs from 'app/services/IGFSs';
+import ConfigureState from '../services/ConfigureState';
+import ConfigurationDownload from '../services/ConfigurationDownload';
+import ConfigSelectors from './selectors';
+import Clusters from '../services/Clusters';
+import Caches from '../services/Caches';
+import Models from '../services/Models';
+import IGFSs from '../services/IGFSs';
import {Confirm} from 'app/services/Confirm.service';
export const ofType = (type) => (s) => s.pipe(filter((a) => a.type === type));
diff --git a/frontend/app/components/page-configure/store/effects.spec.js b/frontend/app/configuration/store/effects.spec.js
similarity index 100%
rename from frontend/app/components/page-configure/store/effects.spec.js
rename to frontend/app/configuration/store/effects.spec.js
diff --git a/frontend/app/components/page-configure/reducer.js b/frontend/app/configuration/store/reducer.js
similarity index 99%
rename from frontend/app/components/page-configure/reducer.js
rename to frontend/app/configuration/store/reducer.js
index 0f24bfa..2b7dd8b 100644
--- a/frontend/app/components/page-configure/reducer.js
+++ b/frontend/app/configuration/store/reducer.js
@@ -31,7 +31,7 @@
import {
REMOVE_CLUSTER_ITEMS_CONFIRMED
-} from './store/actionTypes';
+} from './actionTypes';
const defaults = {clusters: new Map(), caches: new Map(), spaces: new Map()};
diff --git a/frontend/app/components/page-configure/reducer.spec.js b/frontend/app/configuration/store/reducer.spec.js
similarity index 100%
rename from frontend/app/components/page-configure/reducer.spec.js
rename to frontend/app/configuration/store/reducer.spec.js
diff --git a/frontend/app/components/page-configure/store/selectors.js b/frontend/app/configuration/store/selectors.ts
similarity index 81%
rename from frontend/app/components/page-configure/store/selectors.js
rename to frontend/app/configuration/store/selectors.ts
index 0c70e59..58b4409 100644
--- a/frontend/app/components/page-configure/store/selectors.js
+++ b/frontend/app/configuration/store/selectors.ts
@@ -19,11 +19,12 @@
import {of, empty, combineLatest, forkJoin, pipe} from 'rxjs';
import {filter, pluck, map, switchMap, take, distinctUntilChanged, exhaustMap} from 'rxjs/operators';
import {defaultNames} from '../defaultNames';
+import {DomainModel, ShortCluster} from '../types';
-import {default as Caches} from 'app/services/Caches';
-import {default as Clusters} from 'app/services/Clusters';
-import {default as IGFSs} from 'app/services/IGFSs';
-import {default as Models} from 'app/services/Models';
+import {default as Caches} from '../services/Caches';
+import {default as Clusters} from '../services/Clusters';
+import {default as IGFSs} from '../services/IGFSs';
+import {default as Models} from '../services/Models';
const isDefined = filter((v) => v);
@@ -77,34 +78,32 @@
* @param {IGFSs} IGFSs
* @param {Models} Models
*/
- constructor(Caches, Clusters, IGFSs, Models) {
- this.Caches = Caches;
- this.Clusters = Clusters;
- this.IGFSs = IGFSs;
- this.Models = Models;
+ constructor(private Caches: Caches, private Clusters: Clusters, private IGFSs: IGFSs, private Models: Models) {}
- /**
- * @param {string} id
- * @returns {(state$: Observable) => Observable<ig.config.model.DomainModel>}
- */
- this.selectModel = (id) => selectMapItem('models', id);
- /**
- * @returns {(state$: Observable) => Observable<{pristine: boolean, value: Map<string, ig.config.model.ShortDomainModel>}>}
- */
- this.selectShortModels = () => selectItems('shortModels');
- this.selectShortModelsValue = () => (state$) => state$.pipe(this.selectShortModels(), selectValues);
- /**
- * @returns {(state$: Observable) => Observable<Array<ig.config.cluster.ShortCluster>>}
- */
- this.selectShortClustersValue = () => (state$) => state$.pipe(this.selectShortClusters(), selectValues);
- /**
- * @returns {(state$: Observable) => Observable<Array<string>>}
- */
- this.selectClusterNames = (clusterIDs) => (state$) => state$.pipe(
- this.selectShortClusters(),
- selectNames(clusterIDs)
- );
- }
+ /**
+ * @returns {(state$: Observable) => Observable<DomainModel>}
+ */
+ selectModel = (id: string) => selectMapItem('models', id);
+
+ /**
+ * @returns {(state$: Observable) => Observable<{pristine: boolean, value: Map<string, ShortDomainModel>}>}
+ */
+ selectShortModels = () => selectItems('shortModels');
+
+ selectShortModelsValue = () => (state$) => state$.pipe(this.selectShortModels(), selectValues);
+
+ /**
+ * @returns {(state$: Observable) => Observable<Array<ShortCluster>>}
+ */
+ selectShortClustersValue = () => (state$) => state$.pipe(this.selectShortClusters(), selectValues);
+
+ /**
+ * @returns {(state$: Observable) => Observable<Array<string>>}
+ */
+ selectClusterNames = (clusterIDs) => (state$) => state$.pipe(
+ this.selectShortClusters(),
+ selectNames(clusterIDs)
+ );
selectCluster = (id) => selectMapItem('clusters', id);
diff --git a/frontend/app/components/page-configure/transitionHooks/errorState.js b/frontend/app/configuration/transitionHooks/errorState.ts
similarity index 78%
rename from frontend/app/components/page-configure/transitionHooks/errorState.js
rename to frontend/app/configuration/transitionHooks/errorState.ts
index fd9ca9b..c2e9c8e 100644
--- a/frontend/app/components/page-configure/transitionHooks/errorState.js
+++ b/frontend/app/configuration/transitionHooks/errorState.ts
@@ -15,24 +15,21 @@
* limitations under the License.
*/
-import {RejectType} from '@uirouter/angularjs';
+import {RejectType, UIRouter, Transition, HookMatchCriteria} from '@uirouter/angularjs';
-const isPromise = (object) => object && typeof object.then === 'function';
-const match = {
+const isPromise = (object): object is Promise<any> => object && typeof object.then === 'function';
+const match: HookMatchCriteria = {
to(state) {
return state.data && state.data.errorState;
}
};
-const go = ($transition) => $transition.router.stateService.go(
+const go = ($transition: Transition) => $transition.router.stateService.go(
$transition.to().data.errorState,
$transition.params(),
{location: 'replace'}
);
-/**
- * @returns {Array<Promise>}
- */
-const getResolvePromises = ($transition) => $transition.getResolveTokens()
+const getResolvePromises = ($transition: Transition) => $transition.getResolveTokens()
.filter((token) => typeof token === 'string')
.map((token) => $transition.injector().getAsync(token))
.filter(isPromise);
@@ -42,7 +39,7 @@
* 1. Transition throws an error.
* 2. Any resolve promise throws an error. onError does not work for this case if resolvePolicy is set to 'NOWAIT'.
*/
-export const errorState = ($uiRouter) => {
+export const errorState = ($uiRouter: UIRouter) => {
$uiRouter.transitionService.onError(match, ($transition) => {
if ($transition.error().type !== RejectType.ERROR)
return;
diff --git a/frontend/app/configuration/types/index.ts b/frontend/app/configuration/types/index.ts
new file mode 100644
index 0000000..eb08993
--- /dev/null
+++ b/frontend/app/configuration/types/index.ts
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); 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.
+ */
+
+// Cache
+export type CacheModes = 'PARTITIONED' | 'REPLICATED' | 'LOCAL';
+export type AtomicityModes = 'ATOMIC' | 'TRANSACTIONAL' | 'TRANSACTIONAL_SNAPSHOT';
+
+export interface ShortCache {
+ _id: string,
+ cacheMode: CacheModes,
+ atomicityMode: AtomicityModes,
+ backups: number,
+ name: string
+}
+
+// IGFS
+type DefaultModes = 'PRIMARY' | 'PROXY' | 'DUAL_SYNC' | 'DUAL_ASYNC';
+
+export interface ShortIGFS {
+ _id: string,
+ name: string,
+ defaultMode: DefaultModes,
+ affinnityGroupSize: number
+}
+
+// Models
+type QueryMetadataTypes = 'Annotations' | 'Configuration';
+type DomainModelKinds = 'query' | 'store' | 'both';
+export interface KeyField {
+ databaseFieldName: string,
+ databaseFieldType: string,
+ javaFieldName: string,
+ javaFieldType: string
+}
+export interface ValueField {
+ databaseFieldName: string,
+ databaseFieldType: string,
+ javaFieldName: string,
+ javaFieldType: string
+}
+export interface Field {
+ name: string,
+ className: string
+}
+export interface Alias {
+ field: string,
+ alias: string
+}
+export type IndexTypes = 'SORTED' | 'FULLTEXT' | 'GEOSPATIAL';
+export interface IndexField {
+ _id: string,
+ name?: string,
+ direction?: boolean
+}
+export interface Index {
+ _id: string,
+ name: string,
+ indexType: IndexTypes,
+ fields: Array<IndexField>
+}
+
+export interface DomainModel {
+ _id: string,
+ space?: string,
+ clusters?: Array<string>,
+ caches?: Array<string>,
+ queryMetadata?: QueryMetadataTypes,
+ kind?: DomainModelKinds,
+ tableName?: string,
+ keyFieldName?: string,
+ valueFieldName?: string,
+ databaseSchema?: string,
+ databaseTable?: string,
+ keyType?: string,
+ valueType?: string,
+ keyFields?: Array<KeyField>,
+ valueFields?: Array<ValueField>,
+ queryKeyFields?: Array<string>,
+ fields?: Array<Field>,
+ aliases?: Array<Alias>,
+ indexes?: Array<Index>,
+ generatePojo?: boolean
+}
+
+export interface ShortDomainModel {
+ _id: string,
+ keyType: string,
+ valueType: string,
+ hasIndex: boolean
+}
+
+// Cluster
+export type DiscoveryKinds = 'Vm'
+ | 'Multicast'
+ | 'S3'
+ | 'Cloud'
+ | 'GoogleStorage'
+ | 'Jdbc'
+ | 'SharedFs'
+ | 'ZooKeeper'
+ | 'Kubernetes';
+
+export type LoadBalancingKinds = 'RoundRobin'
+ | 'Adaptive'
+ | 'WeightedRandom'
+ | 'Custom';
+
+export type FailoverSPIs = 'JobStealing' | 'Never' | 'Always' | 'Custom';
+
+export interface Cluster {
+ _id: string,
+ name: string,
+ // TODO: cover with types
+ [key: string]: any
+}
+
+export interface ShortCluster {
+ _id: string,
+ name: string,
+ discovery: DiscoveryKinds,
+ caches: number,
+ models: number,
+ igfs: number
+}
+
+export type ClusterLike = Cluster | ShortCluster;
diff --git a/frontend/app/core/activities/Activities.data.d.ts b/frontend/app/core/activities/Activities.data.d.ts
deleted file mode 100644
index 88f9dd4..0000000
--- a/frontend/app/core/activities/Activities.data.d.ts
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-interface IActivityDataResponse {
- action: string,
- amount: number,
- date: string,
- group: string,
- owner: string,
- _id: string
-}
-
-/**
- * Activities data service
- */
-declare class ActivitiesData {
- /**
- * Posts activity to backend, sends current state if no options specified
- */
- post({group, action}?:{group?: string, action?: string}): ng.IPromise<ng.IHttpResponse<IActivityDataResponse>>
-}
-
-export default ActivitiesData
\ No newline at end of file
diff --git a/frontend/app/core/activities/Activities.data.js b/frontend/app/core/activities/Activities.data.ts
similarity index 68%
rename from frontend/app/core/activities/Activities.data.js
rename to frontend/app/core/activities/Activities.data.ts
index 8786816..b8de6a7 100644
--- a/frontend/app/core/activities/Activities.data.js
+++ b/frontend/app/core/activities/Activities.data.ts
@@ -15,19 +15,27 @@
* limitations under the License.
*/
+import {StateService} from '@uirouter/angularjs';
+
+interface IActivityDataResponse {
+ action: string,
+ amount: number,
+ date: string,
+ group: string,
+ owner: string,
+ _id: string
+}
+
export default class ActivitiesData {
static $inject = ['$http', '$state'];
- /**
- * @param {ng.IHttpService} $http
- * @param {uirouter.StateService} $state
- */
- constructor($http, $state) {
- this.$http = $http;
- this.$state = $state;
- }
+ constructor(private $http: ng.IHttpService, private $state: StateService) {}
- post(options = {}) {
+ /**
+ * Posts activity to backend, sends current state if no options specified
+ */
+ // For some reason, Babel loses this after destructuring, the arrow helps with that
+ post = (options: {group?: string, action?: string} = {}) => {
let { group, action } = options;
// TODO IGNITE-5466: since upgrade to UIRouter 1, "url.source" is undefined.
@@ -35,7 +43,7 @@
action = action || this.$state.$current.url.source || '';
group = group || (action.match(/^\/([^/]+)/) || [])[1];
- return this.$http.post('/api/v1/activities/page', { group, action })
+ return this.$http.post<IActivityDataResponse>('/api/v1/activities/page', { group, action })
.catch(() => {
// No-op.
});
diff --git a/frontend/app/directives/bs-affix-update.directive.js b/frontend/app/directives/bs-affix-update.directive.js
deleted file mode 100644
index a462dcb..0000000
--- a/frontend/app/directives/bs-affix-update.directive.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import angular from 'angular';
-
-/**
- * @param {ng.IWindowService} $window
- * @param {ng.ITimeoutService} $timeout
- */
-export default function directive($window, $timeout) {
- let update = null;
-
- const link = ({$last}) => {
- if ($last) {
- update && $timeout.cancel(update);
- update = $timeout(() => angular.element($window).triggerHandler('resize'), 1000);
- }
- };
-
- return {
- restrict: 'A',
- link
- };
-}
-
-directive.$inject = ['$window', '$timeout'];
diff --git a/frontend/app/directives/centered/centered.directive.js b/frontend/app/directives/centered/centered.directive.js
deleted file mode 100644
index 967e0c2..0000000
--- a/frontend/app/directives/centered/centered.directive.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import './centered.scss';
-
-export default function() {
- return {
- restrict: 'E',
- transclude: true,
- template: '<div class="center-container"><div class="centered"><div ng-transclude></div></div></div>'
- };
-}
diff --git a/frontend/app/directives/centered/centered.scss b/frontend/app/directives/centered/centered.scss
deleted file mode 100644
index 694c1d2..0000000
--- a/frontend/app/directives/centered/centered.scss
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-.center-container {
- position: fixed;
- top: 0;
- left: 0;
- height: 100%;
- width: 100%;
- display: table;
- pointer-events: none;
- z-index: 9999;
-}
-
-.centered {
- display: table-cell;
- vertical-align: middle;
- text-align: center;
-}
-
-.centered > * {
- pointer-events: auto;
-}
\ No newline at end of file
diff --git a/frontend/app/directives/restore-input-focus.directive.js b/frontend/app/directives/restore-input-focus.directive.js
deleted file mode 100644
index 829b888..0000000
--- a/frontend/app/directives/restore-input-focus.directive.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-export default function() {
- /**
- * @param {ng.IScope} $scope
- * @param {JQuery} $element
- */
- const directive = ($scope, $element) => {
- $element.on('click', () => {
- $element.siblings('.input-tip').find('input').focus();
- });
- };
-
- return directive;
-}
diff --git a/frontend/app/directives/ui-ace-docker/ui-ace-docker.controller.js b/frontend/app/directives/ui-ace-docker/ui-ace-docker.controller.js
deleted file mode 100644
index c3928c7..0000000
--- a/frontend/app/directives/ui-ace-docker/ui-ace-docker.controller.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-export default function controller($scope, Version, docker) {
- const ctrl = this;
-
- this.$onInit = () => {
- // Watchers definition.
- const clusterWatcher = () => {
- delete ctrl.data;
-
- if (!$scope.cluster)
- return;
-
- ctrl.data = docker.generate($scope.cluster, Version.currentSbj.getValue());
- };
-
- // Setup watchers.
- Version.currentSbj.subscribe({
- next: clusterWatcher
- });
-
- $scope.$watch('cluster', clusterWatcher);
- };
-}
-
-controller.$inject = ['$scope', 'IgniteVersion', 'IgniteDockerGenerator'];
diff --git a/frontend/app/directives/ui-ace-docker/ui-ace-docker.directive.js b/frontend/app/directives/ui-ace-docker/ui-ace-docker.directive.js
deleted file mode 100644
index 188f11f..0000000
--- a/frontend/app/directives/ui-ace-docker/ui-ace-docker.directive.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import template from './ui-ace-docker.pug';
-import controller from './ui-ace-docker.controller';
-
-export default function() {
- const link = ($scope, $el, $attrs, [igniteUiAceTabs]) => {
- if (igniteUiAceTabs.onLoad)
- $scope.onLoad = igniteUiAceTabs.onLoad;
-
- if (igniteUiAceTabs.onChange)
- $scope.onChange = igniteUiAceTabs.onChange;
- };
-
- return {
- restrict: 'E',
- scope: {
- cluster: '=',
- data: '=ngModel'
- },
- bindToController: {
- cluster: '=',
- data: '=ngModel'
- },
- link,
- template,
- controller,
- controllerAs: 'ctrl',
- require: ['?^igniteUiAceTabs']
- };
-}
diff --git a/frontend/app/directives/ui-ace-docker/ui-ace-docker.pug b/frontend/app/directives/ui-ace-docker/ui-ace-docker.pug
deleted file mode 100644
index c929c70..0000000
--- a/frontend/app/directives/ui-ace-docker/ui-ace-docker.pug
+++ /dev/null
@@ -1,27 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); 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.
-
-.panel-details-noborder
- .details-row
- p
- a(href='https://docs.docker.com/engine/reference/builder/' target='_blank') Docker
- | file is a text file with instructions to create Docker image.<br/>
- | To build image you have to store following Docker file with your Ignite XML configuration to the same directory.<br>
- | Also you could use predefined
- a(href='https://ignite.apache.org/download.cgi#docker' target='_blank') Apache Ignite docker image
- | . For more information about using Ignite with Docker please read
- a(href='https://apacheignite.readme.io/docs/docker-deployment' target='_blank') documentation.
- .details-row(ng-if='ctrl.data' ignite-ace='{onLoad: onLoad, mode: "dockerfile"}' ng-model='ctrl.data')
diff --git a/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.controller.js b/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.controller.js
deleted file mode 100644
index bb4d1c4..0000000
--- a/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.controller.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import _ from 'lodash';
-import {nonNil} from 'app/utils/lodashMixins';
-
-export default function controller($scope, JavaTypes, generator) {
- const ctrl = this;
-
- this.$onInit = () => {
- // Watchers definition.
- // Watcher clean instance data if instance to cluster caches was change
- const cleanPojos = () => {
- delete ctrl.class;
- delete ctrl.pojos;
- delete ctrl.classes;
- };
-
- // Watcher update pojos when changes caches and checkers useConstructor and includeKeyFields
- const updatePojos = () => {
- delete ctrl.pojos;
-
- if (_.isNil(ctrl.cluster) || _.isEmpty(ctrl.cluster.caches))
- return;
-
- ctrl.pojos = generator.pojos(ctrl.cluster.caches, ctrl.useConstructor, ctrl.includeKeyFields);
- };
-
- // Watcher update classes after
- const updateClasses = (value) => {
- delete ctrl.classes;
-
- if (!value)
- return;
-
- const classes = ctrl.classes = [];
-
- _.forEach(ctrl.pojos, (pojo) => {
- if (nonNil(pojo.keyClass))
- classes.push(pojo.keyType);
-
- classes.push(pojo.valueType);
- });
- };
-
- // Update pojos class.
- const updateClass = (value) => {
- if (_.isEmpty(value))
- return;
-
- const pojo = value[0];
-
- ctrl.class = ctrl.class || (pojo.keyClass ? pojo.keyType : pojo.valueType);
- };
-
- // Update pojos data.
- const updatePojosData = (value) => {
- if (_.isNil(value))
- return;
-
- _.forEach(ctrl.pojos, (pojo) => {
- if (pojo.keyType === ctrl.class) {
- ctrl.data = pojo.keyClass;
-
- return false;
- }
-
- if (pojo.valueType === ctrl.class) {
- ctrl.data = pojo.valueClass;
-
- return false;
- }
- });
- };
-
- // Setup watchers. Watchers order is important.
- $scope.$watch('ctrl.cluster.caches', cleanPojos);
- $scope.$watch('ctrl.cluster.caches', updatePojos);
- $scope.$watch('ctrl.cluster.caches', updateClasses);
- $scope.$watch('ctrl.useConstructor', updatePojos);
- $scope.$watch('ctrl.includeKeyFields', updatePojos);
- $scope.$watch('ctrl.pojos', updateClass);
- $scope.$watch('ctrl.pojos', updatePojosData);
- $scope.$watch('ctrl.class', updatePojosData);
- };
-}
-
-controller.$inject = ['$scope', 'JavaTypes', 'JavaTransformer'];
diff --git a/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.directive.js b/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.directive.js
deleted file mode 100644
index c9f97cc..0000000
--- a/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.directive.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import template from './ui-ace-pojos.pug';
-import controller from './ui-ace-pojos.controller';
-
-export default function() {
- const link = ($scope, $el, $attrs, [igniteUiAceTabs]) => {
- if (igniteUiAceTabs.onLoad)
- $scope.onLoad = igniteUiAceTabs.onLoad;
-
- if (igniteUiAceTabs.onChange)
- $scope.onChange = igniteUiAceTabs.onChange;
- };
-
- return {
- restrict: 'E',
- scope: {
- cluster: '=',
- pojos: '=ngModel'
- },
- bindToController: {
- cluster: '=',
- pojos: '=ngModel'
- },
- link,
- template,
- controller,
- controllerAs: 'ctrl',
- require: ['?^igniteUiAceTabs']
- };
-}
diff --git a/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.pug b/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.pug
deleted file mode 100644
index bb8e6d3..0000000
--- a/frontend/app/directives/ui-ace-pojos/ui-ace-pojos.pug
+++ /dev/null
@@ -1,40 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); 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.
-
-mixin check-tooltip(message)
- i.tipLabel.icon-help(bs-tooltip=`"${message}"`)
-
-.panel-details-noborder
- .details-row
- .col-xs-2.col-sm-2.col-md-2
- label POJO class:
- .col-xs-10.col-sm-10.col-md-10.summary-pojo-list
- button.select-toggle.form-control(ng-model='ctrl.class' bs-select bs-options='item for item in ctrl.classes')
- .details-row.checkbox
- .col-xs-2.col-sm-2.col-md-2
- .col-xs-10.col-sm-10.col-md-10
- label
- input(type='checkbox' ng-model='ctrl.useConstructor')
- | Generate constructors
- +check-tooltip("Generate empty and full constructors in POJO classes")
- .details-row.checkbox
- .col-xs-2.col-sm-2.col-md-2
- .col-xs-10.col-sm-10.col-md-10
- label
- input(type='checkbox' ng-model='ctrl.includeKeyFields')
- | Include key fields
- +check-tooltip("Generate key fields in POJO value class")
- .details-row(ng-if='ctrl.data' ignite-ace='{onLoad: onLoad, mode: "java"}' ng-model='ctrl.data')
diff --git a/frontend/app/directives/ui-ace-pom/ui-ace-pom.controller.js b/frontend/app/directives/ui-ace-pom/ui-ace-pom.controller.js
deleted file mode 100644
index ae64022..0000000
--- a/frontend/app/directives/ui-ace-pom/ui-ace-pom.controller.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-export default function controller($scope, Version, maven) {
- const ctrl = this;
-
- this.$onInit = () => {
- // Watchers definition.
- const clusterWatcher = (value) => {
- delete ctrl.data;
-
- if (!value)
- return;
-
- ctrl.data = maven.generate($scope.cluster, Version.currentSbj.getValue());
- };
-
- // Setup watchers.
- Version.currentSbj.subscribe({
- next: clusterWatcher
- });
-
- $scope.$watch('cluster', clusterWatcher);
- };
-}
-
-controller.$inject = ['$scope', 'IgniteVersion', 'IgniteMavenGenerator'];
diff --git a/frontend/app/directives/ui-ace-pom/ui-ace-pom.directive.js b/frontend/app/directives/ui-ace-pom/ui-ace-pom.directive.js
deleted file mode 100644
index f2ba0ae..0000000
--- a/frontend/app/directives/ui-ace-pom/ui-ace-pom.directive.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import template from './ui-ace-pom.pug';
-import controller from './ui-ace-pom.controller';
-
-export default function() {
- const link = ($scope, $el, $attrs, [igniteUiAceTabs]) => {
- if (igniteUiAceTabs.onLoad)
- $scope.onLoad = igniteUiAceTabs.onLoad;
-
- if (igniteUiAceTabs.onChange)
- $scope.onChange = igniteUiAceTabs.onChange;
- };
-
- return {
- restrict: 'E',
- scope: {
- cluster: '='
- },
- link,
- template,
- controller,
- controllerAs: 'ctrl',
- require: ['?^igniteUiAceTabs']
- };
-}
diff --git a/frontend/app/directives/ui-ace-pom/ui-ace-pom.pug b/frontend/app/directives/ui-ace-pom/ui-ace-pom.pug
deleted file mode 100644
index b973a74..0000000
--- a/frontend/app/directives/ui-ace-pom/ui-ace-pom.pug
+++ /dev/null
@@ -1,17 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); 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.
-
-div(ng-if='ctrl.data' ignite-ace='{onLoad: onLoad, mode: "xml"}' ng-model='ctrl.data')
diff --git a/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.controller.js b/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.controller.js
deleted file mode 100644
index 09f7a01..0000000
--- a/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.controller.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-const SERVER_CFG = 'ServerConfigurationFactory';
-const CLIENT_CFG = 'ClientConfigurationFactory';
-
-/**
- * @param {ng.IScope} $scope
- * @param {import('app/modules/configuration/generator/SharpTransformer.service').default} generator
- */
-export default function controller($scope, generator) {
- /** @type {ThisType} */
- const ctrl = this;
-
- this.$onInit = () => {
- delete ctrl.data;
-
- // Set default generator
- ctrl.generator = (cluster) => {
- const type = $scope.cfg ? CLIENT_CFG : SERVER_CFG;
-
- return generator.cluster(cluster, 'config', type, $scope.cfg);
- };
- };
-}
-
-controller.$inject = ['$scope', 'IgniteSharpTransformer'];
diff --git a/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.directive.js b/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.directive.js
deleted file mode 100644
index d6e366b..0000000
--- a/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.directive.js
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); 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.
- */
-
-import _ from 'lodash';
-
-import template from './ui-ace-sharp.pug';
-import controller from './ui-ace-sharp.controller';
-
-/**
- * @param {import('app/modules/configuration/generator/SharpTransformer.service').default} generator
- */
-export default function directive(generator) {
- /**
- * @param {ng.IScope} scope
- * @param {JQLite} $el
- * @param {ng.IAttributes} attrs
- * @param {[typeof controller, any?, ng.IFormController?, ng.INgModelController?]} controllers
- */
- const link = (scope, $el, attrs, controllers) => {
- const [ctrl, igniteUiAceTabs, formCtrl, ngModelCtrl] = controllers;
- if (formCtrl && ngModelCtrl)
- formCtrl.$removeControl(ngModelCtrl);
-
- if (igniteUiAceTabs && igniteUiAceTabs.onLoad) {
- scope.onLoad = (editor) => {
- igniteUiAceTabs.onLoad(editor);
-
- scope.$watch('master', () => editor.attractAttention = false);
- };
- }
-
- if (igniteUiAceTabs && igniteUiAceTabs.onChange)
- scope.onChange = igniteUiAceTabs.onChange;
-
- const render = (data) => {
- delete ctrl.data;
-
- if (!data)
- return;
-
- return ctrl.generator(scope.master);
- };
-
- // Setup generator.
- if (scope.generator) {
- const method = scope.generator;
-
- switch (method) {
- case 'clusterCaches':
- ctrl.generator = (cluster) => {
- const caches = _.reduce(scope.detail, (acc, cache) => {
- if (_.includes(cluster.caches, cache.value))
- acc.push(cache.cache);
-
- return acc;
- }, []);
-
- return generator.clusterCaches(cluster, caches, null, true).asString();
- };
-
- break;
-
- case 'igfss':
- ctrl.generator = (cluster) => {
- const igfss = _.reduce(scope.detail, (acc, igfs) => {
- if (_.includes(cluster.igfss, igfs.value))
- acc.push(igfs.igfs);
-
- return acc;
- }, []);
-
- return generator.igfss(igfss, 'cfg').asString();
- };
-
- break;
-
- case 'cacheStore':
- ctrl.generator = (cache) => {
- const domains = _.reduce(scope.detail, (acc, domain) => {
- if (_.includes(cache.domains, domain.value))
- acc.push(domain.meta);
-
- return acc;
- }, []);
-
- return generator.cacheStore(cache, domains).asString();
- };
-
- break;
-
- default:
- ctrl.generator = (data) => generator[method](data).asString();
- }
- }
-
- if (!_.isUndefined(attrs.clusterCfg)) {
- scope.$watch('cfg', (cfg) => {
- if (!_.isUndefined(cfg))
- return;
-
- scope.cfg = {};
- });
-
- scope.$watch('cfg', (data) => ctrl.data = render(data), true);
- }
-
- const noDeepWatch = !(typeof attrs.noDeepWatch !== 'undefined');
-
- // Setup watchers.
- scope.$watch('master', (data) => ctrl.data = render(data), noDeepWatch);
- };
-
- return {
- priority: 1,
- restrict: 'E',
- scope: {
- master: '=',
- detail: '=',
- generator: '@',
- cfg: '=?clusterCfg'
- },
- bindToController: {
- data: '=?ngModel'
- },
- link,
- template,
- controller,
- controllerAs: 'ctrl',
- require: ['igniteUiAceSharp', '?^igniteUiAceTabs', '?^form', '?ngModel']
- };
-}
-
-directive.$inject = ['IgniteSharpTransformer'];
diff --git a/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.pug b/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.pug
deleted file mode 100644
index d3f9e44..0000000
--- a/frontend/app/directives/ui-ace-sharp/ui-ace-sharp.pug
+++ /dev/null
@@ -1,22 +0,0 @@
-//-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); 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.
-
-div(ng-if='ctrl.data'
- ignite-ace='{onLoad: onLoad, \
- onChange: onChange, \
- renderOptions: renderOptions, \
- mode: "csharp"}'
- ng-model='ctrl.data')
diff --git a/frontend/app/helpers/jade/mixins.pug b/frontend/app/helpers/jade/mixins.pug
index b2aa8e5..6b9c287 100644
--- a/frontend/app/helpers/jade/mixins.pug
+++ b/frontend/app/helpers/jade/mixins.pug
@@ -20,387 +20,3 @@
include ../../primitives/dropdown/index
include ../../primitives/switcher/index
include ../../primitives/form-field/index
-
-//- Function that convert enabled state to corresponding disabled state.
--var enabledToDisabled = function (enabled) {
-- return (enabled === false || enabled === true) ? !enabled : '!(' + enabled + ')';
--}
-
-mixin form-field__java-class({ label, model, name, disabled, required, tip, placeholder, validationActive })
- -var errLbl = label.substring(0, label.length - 1)
-
- +form-field__text({
- label,
- model,
- name,
- disabled,
- required,
- placeholder: placeholder || 'Enter fully qualified class name',
- tip
- })(
- data-java-identifier='true'
- data-java-package-specified='true'
- data-java-keywords='true'
- data-java-built-in-class='true'
- data-validation-active=validationActive ? `{{ ${validationActive} }}` : `'always'`
- )&attributes(attributes)
- if block
- block
-
- +form-field__error({ error: 'javaBuiltInClass', message: `${ errLbl } should not be the Java built-in class!` })
- +form-field__error({ error: 'javaKeywords', message: `${ errLbl } could not contains reserved Java keyword!` })
- +form-field__error({ error: 'javaPackageSpecified', message: `${ errLbl } does not have package specified!` })
- +form-field__error({ error: 'javaIdentifier', message: `${ errLbl } is invalid Java identifier!` })
-
-//- Mixin for text field with enabled condition with options.
-mixin form-field__java-class--typeahead({ label, model, name, options, disabled, required, placeholder, tip, validationActive })
- -var errLbl = label.substring(0, label.length - 1)
-
- +form-field__typeahead({
- label,
- model,
- name,
- disabled,
- required,
- placeholder,
- options,
- tip
- })&attributes(attributes)(
- data-java-identifier='true'
- data-java-package-specified='allow-built-in'
- data-java-keywords='true'
- data-validation-active=validationActive ? `{{ ${validationActive} }}` : `'always'`
- )
- +form-field__error({ error: 'javaKeywords', message: `${ errLbl } could not contains reserved Java keyword!` })
- +form-field__error({ error: 'javaPackageSpecified', message: `${ errLbl } does not have package specified!` })
- +form-field__error({ error: 'javaIdentifier', message: `${ errLbl } is invalid Java identifier!` })
-
-
-mixin form-field__java-package({ label, model, name, disabled, required, tip, tipOpts, placeholder })
- +form-field__text({
- label,
- model,
- name,
- disabled,
- required,
- tip,
- tipOpts,
- placeholder
- })(
- data-java-keywords='true'
- data-java-package-name='package-only'
- )&attributes(attributes)
- if block
- block
-
- +form-field__error({ error: 'javaPackageName', message: 'Package name is invalid!' })
- +form-field__error({ error: 'javaKeywords', message: 'Package name could not contains reserved java keyword!' })
-
-//- Mixin for text field with IP address check.
-mixin form-field__ip-address({ label, model, name, enabled, placeholder, tip })
- +form-field__text({
- label,
- model,
- name,
- disabled: enabledToDisabled(enabled),
- placeholder,
- tip
- })(data-ipaddress='true')
- +form-field__error({ error: 'ipaddress', message: 'Invalid address!' })
-
-//- Mixin for text field with IP address and port range check.
-mixin form-field__ip-address-with-port-range({ label, model, name, enabled, placeholder, tip })
- +form-field__text({
- label,
- model,
- name,
- disabled: enabledToDisabled(enabled),
- placeholder,
- tip
- })(
- data-ipaddress='true'
- data-ipaddress-with-port='true'
- data-ipaddress-with-port-range='true'
- )
- +form-field__error({ error: 'ipaddress', message: 'Invalid address!' })
- +form-field__error({ error: 'ipaddressPort', message: 'Invalid port!' })
- +form-field__error({ error: 'ipaddressPortRange', message: 'Invalid port range!' })
-
-//- Mixin for url field.
-mixin form-field__url({ label, model, name, enabled, required, placeholder, tip })
- -var errLbl = label.substring(0, label.length - 1)
-
- +form-field__text({
- label,
- model,
- name,
- disabled: enabledToDisabled(enabled),
- required,
- placeholder,
- tip
- })(
- type='url'
- )
- if block
- block
-
- +form-field__error({ error: 'url', message: `${ errLbl } should be a valid URL!` })
-
-
-mixin list-text-field({ items, lbl, name, itemName, itemsName })
- list-editable(ng-model=items)&attributes(attributes)
- list-editable-item-view
- | {{ $item }}
-
- list-editable-item-edit
- +form-field__text({
- label: lbl,
- model: '$item',
- name: `"${name}"`,
- required: true,
- placeholder: `Enter ${lbl.toLowerCase()}`
- })(
- ignite-unique=items
- ignite-form-field-input-autofocus='true'
- )
- if block
- block
-
- list-editable-no-items
- list-editable-add-item-button(
- add-item=`$editLast((${items} = ${items} || []).push(''))`
- label-single=itemName
- label-multiple=itemsName
- )
-
-mixin list-java-class-field(label, model, name, items)
- +form-field__text({
- label,
- model,
- name,
- required: true,
- placeholder: 'Enter fully qualified class name'
- })(
- java-identifier='true'
- java-package-specified='true'
- java-keywords='true'
- java-built-in-class='true'
-
- ignite-unique=items
- ignite-form-field-input-autofocus='true'
- )
- +form-field__error({ error: 'javaBuiltInClass', message: `${ label } should not be the Java built-in class!` })
- +form-field__error({ error: 'javaKeywords', message: `${ label } could not contains reserved Java keyword!` })
- +form-field__error({ error: 'javaPackageSpecified', message: `${ label } does not have package specified!` })
- +form-field__error({ error: 'javaIdentifier', message: `${ label } is invalid Java identifier!` })
-
- if block
- block
-
-mixin list-url-field(label, model, name, items)
- +form-field__text({
- label,
- model,
- name,
- required: true,
- placeholder: 'Enter URL'
- })(
- type='url'
-
- ignite-unique=items
- ignite-form-field-input-autofocus='true'
- )
- +form-field__error({ error: 'url', message: 'URL should be valid!' })
-
- if block
- block
-
-mixin list-addresses({ items, name, tip, withPortRange = true })
- list-editable(
- ng-model=items
- name=name
- list-editable-cols=`::[{name: "Addresses:", tip: "${tip}"}]`
- )&attributes(attributes)
- list-editable-item-view {{ $item }}
- list-editable-item-edit(item-name='address')
- +form-field__text({
- label: 'Address',
- model: 'address',
- name: '"address"',
- required: true,
- placeholder: 'IP address:port'
- })(
- ipaddress='true'
- ipaddress-with-port='true'
- ipaddress-with-port-range=withPortRange
- ignite-unique=items
- ignite-form-field-input-autofocus='true'
- )
- +form-field__error({ error: 'igniteUnique', message: 'Such IP address already exists!' })
- +form-field__error({ error: 'ipaddress', message: 'Invalid address!' })
- +form-field__error({ error: 'ipaddressPort', message: 'Invalid port!' })
- +form-field__error({ error: 'ipaddressPortRange', message: 'Invalid port range!' })
- +form-field__error({ error: 'required', message: 'IP address:port could not be empty!' })
-
- list-editable-no-items
- list-editable-add-item-button(
- add-item=`$editLast((${items} = ${items} || []).push(""))`
- label-multiple='addresses'
- label-single='address'
- )
-
-
-mixin form-field__cache-modes({ label, model, name, placeholder })
- +form-field__dropdown({
- label, model, name, placeholder,
- options: '[\
- {value: "LOCAL", label: "LOCAL"},\
- {value: "REPLICATED", label: "REPLICATED"},\
- {value: "PARTITIONED", label: "PARTITIONED"}\
- ]',
- tip: 'Cache modes:\
- <ul>\
- <li>PARTITIONED - in this mode the overall key set will be divided into partitions and all partitions will be split equally between participating nodes</li>\
- <li>REPLICATED - in this mode all the keys are distributed to all participating nodes</li>\
- <li>LOCAL - in this mode caches residing on different grid nodes will not know about each other</li>\
- </ul>'
- })&attributes(attributes)
- if block
- block
-
-//- Mixin for eviction policy.
-mixin form-field__eviction-policy({ model, name, enabled, required, tip })
- -var kind = model + '.kind'
- -var policy = model + '[' + kind + ']'
-
- .pc-form-grid-col-60
- +form-field__dropdown({
- label: 'Eviction policy:',
- model: kind,
- name: `${name}+"Kind"`,
- disabled: enabledToDisabled(enabled),
- required: required,
- placeholder: '{{ ::$ctrl.Caches.evictionPolicy.kind.default }}',
- options: '::$ctrl.Caches.evictionPolicy.values',
- tip: tip
- })
- .pc-form-group.pc-form-grid-row(ng-if=kind)
- .pc-form-grid-col-30
- +form-field__number({
- label: 'Batch size',
- model: policy + '.batchSize',
- name: name + '+ "batchSize"',
- disabled: enabledToDisabled(enabled),
- placeholder: '1',
- min: '1',
- tip: 'Number of entries to remove on shrink'
- })
- .pc-form-grid-col-30
- form-field-size(
- label='Max memory size:'
- ng-model=`${policy}.maxMemorySize`
- ng-model-options='{allowInvalid: true}'
- name=`${name}.maxMemorySize`
- ng-disabled=enabledToDisabled(enabled)
- tip='Maximum allowed cache size'
- placeholder='{{ ::$ctrl.Caches.evictionPolicy.maxMemorySize.default }}'
- min=`{{ $ctrl.Caches.evictionPolicy.maxMemorySize.min(${model}) }}`
- size-scale-label='mb'
- size-type='bytes'
- )
- +form-field__error({ error: 'min', message: 'Either maximum memory size or maximum size should be greater than 0' })
- .pc-form-grid-col-60
- +form-field__number({
- label: 'Max size:',
- model: policy + '.maxSize',
- name: name + '+ "maxSize"',
- disabled: enabledToDisabled(enabled),
- placeholder: '{{ ::$ctrl.Caches.evictionPolicy.maxSize.default }}',
- min: `{{ $ctrl.Caches.evictionPolicy.maxSize.min(${model}) }}`,
- tip: 'Maximum allowed size of cache before entry will start getting evicted'
- })(
- ng-model-options='{allowInvalid: true}'
- )
- +form-field__error({ error: 'min', message: 'Either maximum memory size or maximum size should be greater than 0' })
-
-//- Mixin for XML and Java preview.
-mixin preview-xml-java(master, generator, detail)
- ignite-ui-ace-tabs
- .preview-panel(ng-init='mode = "spring"')
- .preview-legend
- a(ng-class='{active: mode === "spring"}' ng-click='mode = "spring"') Spring
- a(ng-class='{active: mode === "java"}' ng-click='mode = "java"') Java
- //a(ng-class='{active: mode === "csharp"}' ng-click='mode = "csharp"') C#
- //a(ng-class='{active: mode === "app.config"}' ng-click='mode = "app.config"') app.config
- .preview-content(ng-switch='mode')
- ignite-ui-ace-spring(ng-switch-when='spring' data-master=master data-generator=generator ng-model='$parent.data' data-detail=detail)
- ignite-ui-ace-java(ng-switch-when='java' data-master=master data-generator=generator ng-model='$parent.data' data-detail=detail)
- //ignite-ui-ace-sharp(ng-switch-when="csharp" data-master=master data-generator=generator ng-model='$parent.data' data-detail=detail)
- .preview-content-empty(ng-if='!data')
- label All Defaults
-
-
-mixin list-pair-edit({ items, keyLbl, valLbl, itemName, itemsName })
- list-editable(ng-model=items)
- list-editable-item-view
- | {{ $item.name }} = {{ $item.value }}
-
- list-editable-item-edit
- - form = '$parent.form'
- .pc-form-grid-row
- .pc-form-grid-col-30(divider='=')
- +form-field__text({
- label: keyLbl,
- model: '$item.name',
- name: '"name"',
- required: true,
- placeholder: keyLbl
- })(
- ignite-unique=items
- ignite-unique-property='name'
- ignite-auto-focus
- )
- +form-field__error({ error: 'igniteUnique', message: 'Property with such name already exists!' })
- .pc-form-grid-col-30
- +form-field__text({
- label: valLbl,
- model: '$item.value',
- name: '"value"',
- required: true,
- placeholder: valLbl
- })
-
- list-editable-no-items
- list-editable-add-item-button(
- add-item=`$editLast((${items} = ${items} || []).push({}))`
- label-single=itemName
- label-multiple=itemsName
- )
-
-mixin form-field__dialect({ label, model, name, required, tip, genericDialectName, placeholder })
- +form-field__dropdown({
- label,
- model,
- name,
- required,
- placeholder,
- options: '[\
- {value: "Generic", label: "' + genericDialectName + '"},\
- {value: "Oracle", label: "Oracle"},\
- {value: "DB2", label: "IBM DB2"},\
- {value: "SQLServer", label: "Microsoft SQL Server"},\
- {value: "MySQL", label: "MySQL"},\
- {value: "PostgreSQL", label: "PostgreSQL"},\
- {value: "H2", label: "H2 database"}\
- ]',
- tip: `${ tip }
- <ul>
- <li>${ genericDialectName }</li>
- <li>Oracle database</li>
- <li>IBM DB2</li>
- <li>Microsoft SQL Server</li>
- <li>MySQL</li>
- <li>PostgreSQL</li>
- <li>H2 database</li>
- </ul>`
- })
diff --git a/frontend/app/services/JavaTypes.service.js b/frontend/app/services/JavaTypes.service.js
index 0e58b8d..d9cb04f 100644
--- a/frontend/app/services/JavaTypes.service.js
+++ b/frontend/app/services/JavaTypes.service.js
@@ -15,11 +15,7 @@
* limitations under the License.
*/
-import merge from 'lodash/merge';
-import uniq from 'lodash/uniq';
-import map from 'lodash/map';
-import reduce from 'lodash/reduce';
-import isObject from 'lodash/isObject';
+import _ from 'lodash';
import includes from 'lodash/includes';
import isNil from 'lodash/isNil';
import find from 'lodash/find';
@@ -52,45 +48,11 @@
* Utility service for various check on java types.
*/
export default class JavaTypes {
- static $inject = ['IgniteClusterDefaults', 'IgniteCacheDefaults', 'IgniteIGFSDefaults'];
-
- constructor(clusterDflts, cacheDflts, igfsDflts) {
- this.enumClasses = uniq(this._enumClassesAcc(merge(clusterDflts, cacheDflts, igfsDflts), []));
- this.shortEnumClasses = map(this.enumClasses, (cls) => this.shortClassName(cls));
-
+ constructor() {
JAVA_CLASS_STRINGS.push({short: 'byte[]', full: 'byte[]', stringValue: '[B'});
}
/**
- * Collects recursive enum classes.
- *
- * @param root Root object.
- * @param classes Collected classes.
- * @return {Array.<String>}
- * @private
- */
- _enumClassesAcc(root, classes) {
- return reduce(root, (acc, val, key) => {
- if (key === 'clsName')
- acc.push(val);
- else if (isObject(val))
- this._enumClassesAcc(val, acc);
-
- return acc;
- }, classes);
- }
-
- /**
- * Check if class name is non enum class in Ignite configuration.
- *
- * @param clsName
- * @return {boolean}
- */
- nonEnum(clsName) {
- return !includes(this.shortEnumClasses, clsName) && !includes(this.enumClasses, clsName);
- }
-
- /**
* @param clsName {String} Class name to check.
* @returns {boolean} 'true' if provided class name is a not Java built in class.
*/
diff --git a/frontend/test/unit/JavaTypes.test.js b/frontend/app/services/JavaTypes.spec.js
similarity index 83%
rename from frontend/test/unit/JavaTypes.test.js
rename to frontend/app/services/JavaTypes.spec.js
index 2a465e2..5524197 100644
--- a/frontend/test/unit/JavaTypes.test.js
+++ b/frontend/app/services/JavaTypes.spec.js
@@ -15,15 +15,10 @@
* limitations under the License.
*/
-import JavaTypes from '../../app/services/JavaTypes.service';
+import JavaTypes from './JavaTypes.service';
-import ClusterDflts from '../../app/modules/configuration/generator/defaults/Cluster.service';
-import CacheDflts from '../../app/modules/configuration/generator/defaults/Cache.service';
-import IgfsDflts from '../../app/modules/configuration/generator/defaults/IGFS.service';
+const instance = new JavaTypes();
-const instance = new JavaTypes(new ClusterDflts(), new CacheDflts(), new IgfsDflts());
-
-import { suite, test } from 'mocha';
import { assert } from 'chai';
suite('JavaTypesTestsSuite', () => {
@@ -48,15 +43,6 @@
assert.equal(instance.nonBuiltInClass('my.package.CustomClass'), true);
});
- test('nonEnum', () => {
- assert.equal(instance.nonEnum('org.apache.ignite.cache.CacheMode'), false);
- assert.equal(instance.nonEnum('org.apache.ignite.transactions.TransactionConcurrency'), false);
- assert.equal(instance.nonEnum('org.apache.ignite.cache.CacheWriteSynchronizationMode'), false);
- assert.equal(instance.nonEnum('org.apache.ignite.igfs.IgfsIpcEndpointType'), false);
- assert.equal(instance.nonEnum('java.io.Serializable'), true);
- assert.equal(instance.nonEnum('BigDecimal'), true);
- });
-
test('shortClassName', () => {
assert.equal(instance.shortClassName('java.math.BigDecimal'), 'BigDecimal');
assert.equal(instance.shortClassName('BigDecimal'), 'BigDecimal');
diff --git a/frontend/app/services/index.js b/frontend/app/services/index.js
index 77884df..55f8d3d 100644
--- a/frontend/app/services/index.js
+++ b/frontend/app/services/index.js
@@ -16,12 +16,10 @@
*/
import angular from 'angular';
-import Clusters from './Clusters';
import IgniteVersion from './Version.service';
import {default as DefaultState} from './DefaultState';
export default angular
.module('ignite-console.services', [])
- .service('Clusters', Clusters)
.provider('DefaultState', DefaultState)
.service('IgniteVersion', IgniteVersion);
diff --git a/frontend/app/store/reduxDebug.ts b/frontend/app/store/reduxDebug.ts
index d7b1474..5700112 100644
--- a/frontend/app/store/reduxDebug.ts
+++ b/frontend/app/store/reduxDebug.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import {reducer, devTools} from '../components/page-configure/reduxDevtoolsIntegration';
+import {reducer, devTools} from './reduxDevtoolsIntegration';
import {AppStore} from '.';
import {filter, withLatestFrom, tap} from 'rxjs/operators';
diff --git a/frontend/app/components/page-configure/reduxDevtoolsIntegration.js b/frontend/app/store/reduxDevtoolsIntegration.js
similarity index 97%
rename from frontend/app/components/page-configure/reduxDevtoolsIntegration.js
rename to frontend/app/store/reduxDevtoolsIntegration.js
index f602539..ad45250 100644
--- a/frontend/app/components/page-configure/reduxDevtoolsIntegration.js
+++ b/frontend/app/store/reduxDevtoolsIntegration.js
@@ -61,7 +61,7 @@
if (window.__REDUX_DEVTOOLS_EXTENSION__) {
devTools = window.__REDUX_DEVTOOLS_EXTENSION__.connect({
- name: 'Ignite configuration',
+ name: 'Ignite Web Console',
serialize: {
replacer,
reviver
diff --git a/frontend/app/types/index.ts b/frontend/app/types/index.ts
index 731c62c..89f495e 100644
--- a/frontend/app/types/index.ts
+++ b/frontend/app/types/index.ts
@@ -63,6 +63,13 @@
export type NavigationMenu = Array<NavigationMenuItem>;
+export type MenuItem <T> = {
+ label: string,
+ value: T
+};
+
+export type Menu <T> = MenuItem<T>[];
+
export interface IInputErrorNotifier {
notifyAboutError(): void
hideError(): void
diff --git a/frontend/app/vendor.js b/frontend/app/vendor.js
index e9fc8e9..d02b2cc 100644
--- a/frontend/app/vendor.js
+++ b/frontend/app/vendor.js
@@ -22,6 +22,7 @@
import 'angular-sanitize';
import 'angular-strap';
import 'angular-strap/dist/angular-strap.tpl';
+import 'angular1-async-filter';
import 'angular-messages';
import '@uirouter/angularjs';
diff --git a/frontend/index.js b/frontend/index.js
index c18afc3..bf725ac 100644
--- a/frontend/index.js
+++ b/frontend/index.js
@@ -18,5 +18,6 @@
import angular from 'angular';
import igniteConsole from './app/app';
+import configurationLazyModule from './app/configuration/index.lazy';
-angular.bootstrap(document, [igniteConsole.name], {strictDi: true});
+angular.bootstrap(document, [igniteConsole.name, configurationLazyModule.name], {strictDi: true});
diff --git a/frontend/public/images/docker.png b/frontend/public/images/docker.png
deleted file mode 100644
index afc5df4..0000000
--- a/frontend/public/images/docker.png
+++ /dev/null
Binary files differ
diff --git a/frontend/public/images/java.png b/frontend/public/images/java.png
deleted file mode 100644
index ddb3b8e..0000000
--- a/frontend/public/images/java.png
+++ /dev/null
Binary files differ
diff --git a/frontend/public/images/xml.png b/frontend/public/images/xml.png
deleted file mode 100644
index 029065e..0000000
--- a/frontend/public/images/xml.png
+++ /dev/null
Binary files differ
diff --git a/frontend/public/stylesheets/style.scss b/frontend/public/stylesheets/style.scss
index 3f601be..52f6250 100644
--- a/frontend/public/stylesheets/style.scss
+++ b/frontend/public/stylesheets/style.scss
@@ -19,7 +19,6 @@
@import "./bootstrap-custom";
@import "./variables";
@import "~roboto-font/css/fonts.css";
-@import "./../../app/directives/information/information.scss";
@import "./blocks/error";
@import "./form-field";
diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json
index 7419d8f..531a381 100644
--- a/frontend/tsconfig.json
+++ b/frontend/tsconfig.json
@@ -3,6 +3,7 @@
"allowSyntheticDefaultImports": true,
"target": "ES2017",
"moduleResolution": "Node",
+ "module": "esNext",
"noEmit": true,
"allowJs": true,
"checkJs": true,