IGNITE-10239 Update navigation and top menu. - Fixes #5630. Signed-off-by: Andrey Novikov <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9dc251cd Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9dc251cd Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9dc251cd Branch: refs/heads/ignite-10639 Commit: 9dc251cd036a840313e3fb34aa9e522620fc2365 Parents: 8ef8466 Author: Ilya Borisov <[email protected]> Authored: Mon Dec 17 16:29:24 2018 +0700 Committer: Andrey Novikov <[email protected]> Committed: Mon Dec 17 16:29:24 2018 +0700 ---------------------------------------------------------------------- .../e2e/testcafe/components/topNavigation.js | 6 +- .../e2e/testcafe/components/userMenu.js | 2 +- modules/web-console/frontend/app/app.config.js | 7 + modules/web-console/frontend/app/app.js | 8 +- .../connected-clusters-badge/style.scss | 34 ++-- .../connected-clusters-badge/template.pug | 5 +- .../page-configure/icons/configuration.icon.svg | 13 ++ .../app/components/page-configure/index.js | 193 ------------------ .../app/components/page-configure/index.ts | 194 +++++++++++++++++++ .../page-forgot-password/controller.js | 8 +- .../app/components/page-forgot-password/run.js | 11 +- .../components/page-forgot-password/style.scss | 38 ++-- .../page-forgot-password/template.pug | 53 +++-- .../app/components/page-landing/index.js | 11 +- .../app/components/page-landing/public.pug | 21 ++ .../app/components/page-landing/style.scss | 12 ++ .../app/components/page-landing/template.pug | 8 - .../page-password-changed/controller.js | 26 --- .../page-password-changed/controller.ts | 32 +++ .../components/page-password-changed/index.js | 10 +- .../components/page-password-changed/style.scss | 13 +- .../page-password-changed/template.pug | 9 +- .../page-password-reset/controller.js | 11 +- .../app/components/page-password-reset/index.js | 10 +- .../components/page-password-reset/style.scss | 15 +- .../components/page-password-reset/template.pug | 102 ++++------ .../app/components/page-queries/index.js | 100 ---------- .../app/components/page-queries/index.ts | 110 +++++++++++ .../app/components/page-signin/controller.ts | 7 +- .../frontend/app/components/page-signin/run.ts | 10 +- .../app/components/page-signin/style.scss | 33 +--- .../app/components/page-signin/template.pug | 73 +++---- .../app/components/page-signup/controller.ts | 11 +- .../frontend/app/components/page-signup/run.js | 11 +- .../app/components/page-signup/style.scss | 26 +-- .../app/components/page-signup/template.pug | 36 ++-- .../permanent-notifications/component.ts | 25 +++ .../permanent-notifications/controller.ts | 28 +++ .../components/permanent-notifications/index.ts | 21 ++ .../permanent-notifications/style.scss | 54 ++++++ .../permanent-notifications/template.pug | 23 +++ .../app/components/timed-redirection/style.scss | 1 + .../components/web-console-footer/component.js | 4 +- .../web-console-footer-links/component.js | 23 --- .../web-console-footer-links/style.scss | 31 --- .../web-console-footer-links/template.pug | 17 -- .../components/web-console-footer/controller.ts | 27 +++ .../app/components/web-console-footer/index.js | 11 +- .../components/web-console-footer/style.scss | 93 ++++++--- .../components/web-console-footer/template.pug | 20 +- .../components/web-console-header/component.js | 53 ----- .../components/web-console-header/component.ts | 43 ++++ .../components/demo-mode-button/component.ts | 24 +++ .../components/demo-mode-button/controller.ts | 46 +++++ .../components/demo-mode-button/template.pug | 20 ++ .../components/user-menu/component.ts | 25 +++ .../components/user-menu/controller.ts | 53 +++++ .../components/user-menu/style.scss | 28 +++ .../components/user-menu/template.pug | 26 +++ .../web-console-header-content/component.ts | 25 +++ .../web-console-header-content/controller.ts | 45 +++++ .../web-console-header-content/style.scss | 44 +++++ .../web-console-header-content/template.pug | 24 +++ .../web-console-header-extension/component.js | 22 --- .../web-console-header-extension/template.pug | 15 -- .../app/components/web-console-header/index.js | 8 +- .../components/web-console-header/style.scss | 168 +++------------- .../components/web-console-header/template.pug | 32 ++- .../components/web-console-sidebar/component.ts | 25 +++ .../web-console-sidebar/controller.ts | 30 +++ .../app/components/web-console-sidebar/index.ts | 25 +++ .../components/web-console-sidebar/style.scss | 44 +++++ .../components/web-console-sidebar/template.pug | 22 +++ .../web-console-sidebar-navigation/component.ts | 28 +++ .../controller.ts | 24 +++ .../web-console-sidebar-navigation/style.scss | 108 +++++++++++ .../web-console-sidebar-navigation/template.pug | 35 ++++ .../web-console-sidebar-overflow/component.ts | 26 +++ .../web-console-sidebar-overflow/controller.ts | 50 +++++ .../web-console-sidebar-overflow/style.scss | 52 +++++ .../web-console-sidebar-overflow/template.pug | 18 ++ .../app/modules/branding/branding.module.js | 10 +- .../app/modules/branding/branding.service.js | 4 - .../app/modules/branding/footer.directive.js | 39 ---- .../modules/branding/header-logo.directive.js | 39 ---- .../app/modules/branding/header-logo.pug | 18 -- .../modules/branding/header-title.directive.js | 44 ----- .../branding/powered-by-apache.directive.js | 39 ---- .../app/modules/branding/powered-by-apache.pug | 18 -- .../frontend/app/modules/demo/Demo.module.js | 28 --- .../app/modules/navbar/Navbar.provider.js | 30 --- .../app/modules/navbar/navbar.directive.js | 32 --- .../app/modules/navbar/navbar.module.js | 9 +- .../app/modules/navbar/userbar.directive.js | 59 ------ .../web-console/frontend/app/services/store.ts | 75 +++++++ .../frontend/app/store/actions/ui.ts | 36 ++++ .../frontend/app/store/actions/user.ts | 24 +++ .../frontend/app/store/effects/ui.ts | 32 +++ modules/web-console/frontend/app/store/index.ts | 48 +++++ .../web-console/frontend/app/store/ofType.ts | 26 +++ .../frontend/app/store/reducers/ui.ts | 50 +++++ .../frontend/app/store/reduxDebug.ts | 45 +++++ .../frontend/app/store/selectors/ui.ts | 29 +++ modules/web-console/frontend/app/types/index.ts | 30 +++ .../public/images/icons/cluster.icon.svg | 10 + .../images/icons/connectedClusters.icon.svg | 1 - .../public/images/icons/downloadAgent.icon.svg | 16 ++ .../frontend/public/images/icons/index.js | 5 +- .../frontend/public/images/icons/menu.icon.svg | 7 + .../frontend/public/images/icons/sql.icon.svg | 3 + .../frontend/public/stylesheets/style.scss | 74 +++++-- modules/web-console/frontend/views/base.pug | 11 +- .../frontend/views/includes/header-left.pug | 42 ---- .../frontend/views/includes/header-right.pug | 35 ---- modules/web-console/frontend/views/public.pug | 20 ++ 115 files changed, 2390 insertions(+), 1433 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/e2e/testcafe/components/topNavigation.js ---------------------------------------------------------------------- diff --git a/modules/web-console/e2e/testcafe/components/topNavigation.js b/modules/web-console/e2e/testcafe/components/topNavigation.js index b4262d0..6db745e 100644 --- a/modules/web-console/e2e/testcafe/components/topNavigation.js +++ b/modules/web-console/e2e/testcafe/components/topNavigation.js @@ -17,5 +17,7 @@ import {Selector} from 'testcafe'; -export const configureNavButton = Selector('.wch-nav-item').withText('Configure'); -export const queriesNavButton = Selector('.wch-nav-item').withText('Queries'); +export const toggleMenuButton = Selector('.web-console-header__togle-menu-button'); + +export const configureNavButton = Selector('.web-console-sidebar-navigation__link[title="Configuration"]'); +export const queriesNavButton = Selector('.web-console-sidebar-navigation__link[title="Queries"]'); http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/e2e/testcafe/components/userMenu.js ---------------------------------------------------------------------- diff --git a/modules/web-console/e2e/testcafe/components/userMenu.js b/modules/web-console/e2e/testcafe/components/userMenu.js index 75246c8..973f21f 100644 --- a/modules/web-console/e2e/testcafe/components/userMenu.js +++ b/modules/web-console/e2e/testcafe/components/userMenu.js @@ -17,7 +17,7 @@ import {Selector, t} from 'testcafe'; -const _selector = Selector('[ignite-userbar]'); +const _selector = Selector('user-menu'); export const userMenu = { _selector, http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/app.config.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/app.config.js b/modules/web-console/frontend/app/app.config.js index 88bffee..04c02ea 100644 --- a/modules/web-console/frontend/app/app.config.js +++ b/modules/web-console/frontend/app/app.config.js @@ -22,6 +22,7 @@ import isNil from 'lodash/isNil'; import isEmpty from 'lodash/isEmpty'; import mixin from 'lodash/mixin'; +import {user as userAction, register as registerStore} from './store'; const nonNil = negate(isNil); const nonEmpty = negate(isEmpty); @@ -36,6 +37,8 @@ import validationTemplateUrl from 'views/templates/validation-error.tpl.pug'; const igniteConsoleCfg = angular.module('ignite-console.config', ['ngAnimate', 'mgcrea.ngStrap']); +igniteConsoleCfg.run(registerStore); + // Configure AngularJS animation: do not animate fa-spin. igniteConsoleCfg.config(['$animateProvider', ($animateProvider) => { $animateProvider.classNameFilter(/^((?!(fa-spin|ng-animate-disabled)).)*$/); @@ -133,3 +136,7 @@ igniteConsoleCfg.directive('uiGridSelection', function() { } }; }); + +igniteConsoleCfg.run(['$rootScope', 'Store', ($root, store) => { + $root.$on('user', (event, user) => store.dispatch(userAction({...user}))); +}]); http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/app.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/app.js b/modules/web-console/frontend/app/app.js index 2dd2733..e1cbdbb 100644 --- a/modules/web-console/frontend/app/app.js +++ b/modules/web-console/frontend/app/app.js @@ -96,6 +96,7 @@ 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'; import AngularStrapSelect from './services/AngularStrapSelect.decorator'; @@ -159,6 +160,8 @@ import pageSignup from './components/page-signup'; import pageSignin from './components/page-signin'; import pageForgotPassword from './components/page-forgot-password'; import formSignup from './components/form-signup'; +import sidebar from './components/web-console-sidebar'; +import permanentNotifications from './components/permanent-notifications'; import igniteServices from './services'; @@ -266,7 +269,9 @@ export default angular.module('ignite-console', [ progressLine.name, formField.name, formSignup.name, - timedRedirection.name + timedRedirection.name, + sidebar.name, + permanentNotifications.name ]) .service('$exceptionHandler', $exceptionHandler) // Directives. @@ -314,6 +319,7 @@ export default angular.module('ignite-console', [ .service('CSV', CSV) .service('IGFSs', IGFSs) .service('Models', Models) +.service('Store', Store) // Filters. .filter('byName', byName) .filter('bytes', bytes) http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/connected-clusters-badge/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/connected-clusters-badge/style.scss b/modules/web-console/frontend/app/components/connected-clusters-badge/style.scss index 3b2d202..e46e382 100644 --- a/modules/web-console/frontend/app/components/connected-clusters-badge/style.scss +++ b/modules/web-console/frontend/app/components/connected-clusters-badge/style.scss @@ -18,26 +18,26 @@ connected-clusters { @import "./../../../public/stylesheets/variables.scss"; - div { - position: absolute; - top: 0; - right: 30px; + height: 100%; + display: flex; - display: flex; - align-items: center; - padding: 3px 10px; - - cursor: pointer; - color: white; - font-size: 12px; - line-height: 12px; + .connected-cluster-badge__count { + color: $ignite-brand-success; + margin-left: 5px; + } - background-color: $text-color; + button { + height: 100%; + width: 100%; + background: none !important; + border: none !important; + margin: 0 !important; + padding: 0 !important; + outline: none !important; - border-radius: 0 0 4px 4px; + display: flex; + align-items: center; - [ignite-icon] { - margin-right: 6px; - } + font-size: 14px; } } http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/connected-clusters-badge/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/connected-clusters-badge/template.pug b/modules/web-console/frontend/app/components/connected-clusters-badge/template.pug index 49224e5..dfb4bd9 100644 --- a/modules/web-console/frontend/app/components/connected-clusters-badge/template.pug +++ b/modules/web-console/frontend/app/components/connected-clusters-badge/template.pug @@ -14,6 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. -div(ng-click='$ctrl.show()') - svg(ignite-icon='connectedClusters') - | Connected clusters: {{ $ctrl.connectedClusters }} +button(type='button' ng-click='$ctrl.show()') + | My Connected Clusters: <span class='connected-cluster-badge__count'>{{ $ctrl.connectedClusters }}</span> http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-configure/icons/configuration.icon.svg ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure/icons/configuration.icon.svg b/modules/web-console/frontend/app/components/page-configure/icons/configuration.icon.svg new file mode 100644 index 0000000..7c0ac7a --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure/icons/configuration.icon.svg @@ -0,0 +1,13 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"> + <g fill="none" fill-rule="evenodd" transform="translate(0 1)"> + <rect width="11" height="2" x="9" y="1" fill="currentColor" rx="1"/> + <rect width="5" height="2" x="15" y="7" fill="currentColor" rx="1"/> + <rect width="8" height="2" x="12" y="13" fill="currentColor" rx="1"/> + <rect width="5" height="2" y="1" fill="currentColor" rx="1"/> + <rect width="11" height="2" y="7" fill="currentColor" rx="1"/> + <rect width="8" height="2" y="13" fill="currentColor" rx="1"/> + <circle cx="5" cy="1.776" r="1" stroke="currentColor" stroke-width="2"/> + <circle cx="11" cy="7.776" r="1" stroke="currentColor" stroke-width="2"/> + <circle cx="8" cy="13.776" r="1" stroke="currentColor" stroke-width="2"/> + </g> +</svg> http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-configure/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure/index.js b/modules/web-console/frontend/app/components/page-configure/index.js deleted file mode 100644 index 531b46c..0000000 --- a/modules/web-console/frontend/app/components/page-configure/index.js +++ /dev/null @@ -1,193 +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 'angular1-async-filter'; -import {UIRouterRx} from '@uirouter/rx'; -import uiValidate from 'angular-ui-validate'; - -import component from './component'; -import ConfigureState from './services/ConfigureState'; -import PageConfigure from './services/PageConfigure'; -import ConfigurationDownload from './services/ConfigurationDownload'; -import ConfigChangesGuard from './services/ConfigChangesGuard'; -import ConfigSelectionManager from './services/ConfigSelectionManager'; -import SummaryZipper from './services/SummaryZipper'; -import ConfigurationResource from './services/ConfigurationResource'; -import selectors from './store/selectors'; -import effects from './store/effects'; - -import projectStructurePreview from './components/modal-preview-project'; -import itemsTable from './components/pc-items-table'; -import pcUiGridFilters from './components/pc-ui-grid-filters'; -import isInCollection from './components/pcIsInCollection'; -import pcValidation from './components/pcValidation'; -import fakeUiCanExit from './components/fakeUICanExit'; -import formUICanExitGuard from './components/formUICanExitGuard'; -import modalImportModels from './components/modal-import-models'; -import buttonImportModels from './components/button-import-models'; -import buttonDownloadProject from './components/button-download-project'; -import buttonPreviewProject from './components/button-preview-project'; -import previewPanel from './components/preview-panel'; -import pcSplitButton from './components/pc-split-button'; - -import {errorState} from './transitionHooks/errorState'; -import {default as ActivitiesData} from 'app/core/activities/Activities.data'; - -import 'rxjs/add/operator/withLatestFrom'; -import 'rxjs/add/operator/skip'; - -import {Observable} from 'rxjs/Observable'; - -Observable.prototype.debug = function(l) { - return this.do((v) => console.log(l, v), (e) => console.error(l, e), () => console.log(l, 'completed')); -}; - -import { - editReducer2, - shortObjectsReducer, - reducer, - editReducer, - loadingReducer, - itemsEditReducerFactory, - mapStoreReducerFactory, - mapCacheReducerFactory, - basicCachesActionTypes, - clustersActionTypes, - shortClustersActionTypes, - cachesActionTypes, - shortCachesActionTypes, - modelsActionTypes, - shortModelsActionTypes, - igfssActionTypes, - shortIGFSsActionTypes, - refsReducer -} from './reducer'; - -import {reducer as reduxDevtoolsReducer, devTools} from './reduxDevtoolsIntegration'; -import {registerStates} from './states'; - -/** - * @param {uirouter.UIRouter} $uiRouter - * @param {ActivitiesData} ActivitiesData - */ -function registerActivitiesHook($uiRouter, 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', - uiValidate, - pcUiGridFilters.name, - projectStructurePreview.name, - itemsTable.name, - pcValidation.name, - modalImportModels.name, - buttonImportModels.name, - buttonDownloadProject.name, - buttonPreviewProject.name, - previewPanel.name, - pcSplitButton.name - ]) - .config(registerStates) - .config(['DefaultStateProvider', (DefaultState) => { - DefaultState.setRedirectTo(() => 'base.configuration.overview'); - }]) - .run(registerActivitiesHook) - .run(['ConfigEffects', 'ConfigureState', '$uiRouter', (ConfigEffects, ConfigureState, $uiRouter) => { - $uiRouter.plugin(UIRouterRx); - - if (devTools) { - devTools.subscribe((e) => { - if (e.type === 'DISPATCH' && e.state) ConfigureState.actions$.next(e); - }); - - ConfigureState.actions$ - .filter((e) => e.type !== 'DISPATCH') - .withLatestFrom(ConfigureState.state$.skip(1)) - .subscribe(([action, state]) => devTools.send(action, state)); - - ConfigureState.addReducer(reduxDevtoolsReducer); - } - - ConfigureState.addReducer(refsReducer({ - models: {at: 'domains', store: 'caches'}, - caches: {at: 'caches', store: 'models'} - })); - - ConfigureState.addReducer((state, action) => Object.assign({}, state, { - clusterConfiguration: editReducer(state.clusterConfiguration, action), - configurationLoading: loadingReducer(state.configurationLoading, action), - basicCaches: itemsEditReducerFactory(basicCachesActionTypes)(state.basicCaches, action), - clusters: mapStoreReducerFactory(clustersActionTypes)(state.clusters, action), - shortClusters: mapCacheReducerFactory(shortClustersActionTypes)(state.shortClusters, action), - caches: mapStoreReducerFactory(cachesActionTypes)(state.caches, action), - shortCaches: mapCacheReducerFactory(shortCachesActionTypes)(state.shortCaches, action), - models: mapStoreReducerFactory(modelsActionTypes)(state.models, action), - shortModels: mapCacheReducerFactory(shortModelsActionTypes)(state.shortModels, action), - igfss: mapStoreReducerFactory(igfssActionTypes)(state.igfss, action), - shortIgfss: mapCacheReducerFactory(shortIGFSsActionTypes)(state.shortIgfss, action), - edit: editReducer2(state.edit, action) - })); - - ConfigureState.addReducer(shortObjectsReducer); - - ConfigureState.addReducer((state, action) => { - switch (action.type) { - case 'APPLY_ACTIONS_UNDO': - return action.state; - - default: - return state; - } - }); - - const la = ConfigureState.actions$.scan((acc, action) => [...acc, action], []); - - ConfigureState.actions$ - .filter((a) => a.type === 'UNDO_ACTIONS') - .withLatestFrom(la, ({actions}, actionsWindow, initialState) => { - return { - type: 'APPLY_ACTIONS_UNDO', - state: actionsWindow.filter((a) => !actions.includes(a)).reduce(ConfigureState._combinedReducer, {}) - }; - }) - .do((a) => ConfigureState.dispatchAction(a)) - .subscribe(); - ConfigEffects.connect(); - }]) - .component('pageConfigure', component) - .directive('pcIsInCollection', isInCollection) - .directive('fakeUiCanExit', fakeUiCanExit) - .directive('formUiCanExitGuard', formUICanExitGuard) - .factory('configSelectionManager', ConfigSelectionManager) - .service('IgniteSummaryZipper', SummaryZipper) - .service('IgniteConfigurationResource', ConfigurationResource) - .service('ConfigSelectors', selectors) - .service('ConfigEffects', effects) - .service('ConfigChangesGuard', ConfigChangesGuard) - .service('PageConfigure', PageConfigure) - .service('ConfigureState', ConfigureState) - .service('ConfigurationDownload', ConfigurationDownload) - .run(errorState); http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-configure/index.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-configure/index.ts b/modules/web-console/frontend/app/components/page-configure/index.ts new file mode 100644 index 0000000..dd2ad20 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-configure/index.ts @@ -0,0 +1,194 @@ +/* + * 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 'angular1-async-filter'; +import {UIRouterRx} from '@uirouter/rx'; +import uiValidate from 'angular-ui-validate'; + +import component from './component'; +import ConfigureState from './services/ConfigureState'; +import PageConfigure from './services/PageConfigure'; +import ConfigurationDownload from './services/ConfigurationDownload'; +import ConfigChangesGuard from './services/ConfigChangesGuard'; +import ConfigSelectionManager from './services/ConfigSelectionManager'; +import SummaryZipper from './services/SummaryZipper'; +import ConfigurationResource from './services/ConfigurationResource'; +import selectors from './store/selectors'; +import effects from './store/effects'; + +import projectStructurePreview from './components/modal-preview-project'; +import itemsTable from './components/pc-items-table'; +import pcUiGridFilters from './components/pc-ui-grid-filters'; +import isInCollection from './components/pcIsInCollection'; +import pcValidation from './components/pcValidation'; +import fakeUiCanExit from './components/fakeUICanExit'; +import formUICanExitGuard from './components/formUICanExitGuard'; +import modalImportModels from './components/modal-import-models'; +import buttonImportModels from './components/button-import-models'; +import buttonDownloadProject from './components/button-download-project'; +import buttonPreviewProject from './components/button-preview-project'; +import previewPanel from './components/preview-panel'; +import pcSplitButton from './components/pc-split-button'; + +import {errorState} from './transitionHooks/errorState'; +import {default as ActivitiesData} from 'app/core/activities/Activities.data'; + +import 'rxjs/add/operator/withLatestFrom'; +import 'rxjs/add/operator/skip'; + +import {Observable} from 'rxjs/Observable'; + +import {navigationMenuItem, AppStore} from '../../store'; +import {default as configurationIcon} from './icons/configuration.icon.svg'; +import {default as IconsService} from '../ignite-icon/service'; + +Observable.prototype.debug = function(l) { + return this.do((v) => console.log(l, v), (e) => console.error(l, e), () => console.log(l, 'completed')); +}; + +import { + editReducer2, + shortObjectsReducer, + reducer, + editReducer, + loadingReducer, + itemsEditReducerFactory, + mapStoreReducerFactory, + mapCacheReducerFactory, + basicCachesActionTypes, + clustersActionTypes, + shortClustersActionTypes, + cachesActionTypes, + shortCachesActionTypes, + modelsActionTypes, + shortModelsActionTypes, + igfssActionTypes, + shortIGFSsActionTypes, + refsReducer +} from './reducer'; + +import {reducer as reduxDevtoolsReducer, devTools} from './reduxDevtoolsIntegration'; +import {registerStates} from './states'; + +/** + * @param {uirouter.UIRouter} $uiRouter + * @param {ActivitiesData} ActivitiesData + */ +function registerActivitiesHook($uiRouter, 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', + uiValidate, + pcUiGridFilters.name, + projectStructurePreview.name, + itemsTable.name, + pcValidation.name, + modalImportModels.name, + buttonImportModels.name, + buttonDownloadProject.name, + buttonPreviewProject.name, + previewPanel.name, + pcSplitButton.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}); + + $uiRouter.plugin(UIRouterRx); + + ConfigureState.addReducer(refsReducer({ + models: {at: 'domains', store: 'caches'}, + caches: {at: 'caches', store: 'models'} + })); + + ConfigureState.addReducer((state, action) => Object.assign({}, state, { + clusterConfiguration: editReducer(state.clusterConfiguration, action), + configurationLoading: loadingReducer(state.configurationLoading, action), + basicCaches: itemsEditReducerFactory(basicCachesActionTypes)(state.basicCaches, action), + clusters: mapStoreReducerFactory(clustersActionTypes)(state.clusters, action), + shortClusters: mapCacheReducerFactory(shortClustersActionTypes)(state.shortClusters, action), + caches: mapStoreReducerFactory(cachesActionTypes)(state.caches, action), + shortCaches: mapCacheReducerFactory(shortCachesActionTypes)(state.shortCaches, action), + models: mapStoreReducerFactory(modelsActionTypes)(state.models, action), + shortModels: mapCacheReducerFactory(shortModelsActionTypes)(state.shortModels, action), + igfss: mapStoreReducerFactory(igfssActionTypes)(state.igfss, action), + shortIgfss: mapCacheReducerFactory(shortIGFSsActionTypes)(state.shortIgfss, action), + edit: editReducer2(state.edit, action) + })); + + ConfigureState.addReducer(shortObjectsReducer); + + ConfigureState.addReducer((state, action) => { + switch (action.type) { + case 'APPLY_ACTIONS_UNDO': + return action.state; + + default: + return state; + } + }); + + const la = ConfigureState.actions$.scan((acc, action) => [...acc, action], []); + + ConfigureState.actions$ + .filter((a) => a.type === 'UNDO_ACTIONS') + .withLatestFrom(la, ({actions}, actionsWindow, initialState) => { + return { + type: 'APPLY_ACTIONS_UNDO', + state: actionsWindow.filter((a) => !actions.includes(a)).reduce(ConfigureState._combinedReducer, {}) + }; + }) + .do((a) => ConfigureState.dispatchAction(a)) + .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) + .service('ConfigSelectors', selectors) + .service('ConfigEffects', effects) + .service('ConfigChangesGuard', ConfigChangesGuard) + .service('PageConfigure', PageConfigure) + .service('ConfigureState', ConfigureState) + .service('ConfigurationDownload', ConfigurationDownload) + .run(errorState); http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-forgot-password/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-forgot-password/controller.js b/modules/web-console/frontend/app/components/page-forgot-password/controller.js index 7d06773..86597af 100644 --- a/modules/web-console/frontend/app/components/page-forgot-password/controller.js +++ b/modules/web-console/frontend/app/components/page-forgot-password/controller.js @@ -24,22 +24,26 @@ export default class PageForgotPassword { data = {email: null}; /** @type {string} */ serverError = null; + /** @type {JQLite} */ + el; - static $inject = ['Auth', 'IgniteMessages', 'IgniteFormUtils']; + static $inject = ['Auth', 'IgniteMessages', 'IgniteFormUtils', '$element']; /** * @param {import('app/modules/user/Auth.service').default} Auth */ - constructor(Auth, IgniteMessages, IgniteFormUtils) { + constructor(Auth, IgniteMessages, IgniteFormUtils, el) { this.Auth = Auth; this.IgniteMessages = IgniteMessages; this.IgniteFormUtils = IgniteFormUtils; + this.el = el; } /** @param {import('./types').IForgotPasswordFormController} form */ canSubmitForm(form) { return form.$error.server ? true : !form.$invalid; } $postLink() { + this.el.addClass('public-page'); this.form.email.$validators.server = () => !this.serverError; } http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-forgot-password/run.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-forgot-password/run.js b/modules/web-console/frontend/app/components/page-forgot-password/run.js index c7ee6a6..d9259e9 100644 --- a/modules/web-console/frontend/app/components/page-forgot-password/run.js +++ b/modules/web-console/frontend/app/components/page-forgot-password/run.js @@ -15,6 +15,8 @@ * limitations under the License. */ +import publicTemplate from '../../../views/public.pug'; + /** * @param {import("@uirouter/angularjs").UIRouter} $uiRouter */ @@ -23,7 +25,14 @@ export function registerState($uiRouter) { const state = { name: 'forgotPassword', url: '/forgot-password', - component: 'pageForgotPassword', + views: { + '': { + template: publicTemplate + }, + 'page@forgotPassword': { + component: 'pageForgotPassword' + } + }, unsaved: true, tfMetaTags: { title: 'Forgot Password' http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-forgot-password/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-forgot-password/style.scss b/modules/web-console/frontend/app/components/page-forgot-password/style.scss index 86425c1..7893c62 100644 --- a/modules/web-console/frontend/app/components/page-forgot-password/style.scss +++ b/modules/web-console/frontend/app/components/page-forgot-password/style.scss @@ -20,34 +20,22 @@ page-forgot-password { flex-direction: column; flex: 1 0 auto; - section { - margin-left: auto; - margin-right: auto; - width: 530px; - - h3 { - font-size: 38px; - font-weight: 300; - margin: 30px 0 30px; - } - - p { - margin-bottom: 20px; - } + p { + margin-bottom: 20px; + } - .form-field { - margin: 10px 0; - } + .form-field { + margin: 10px 0; + } - .form-footer { - padding: 15px 0; - text-align: right; - display: flex; - align-items: center; + .form-footer { + padding: 15px 0; + text-align: right; + display: flex; + align-items: center; - .btn-ignite { - margin-left: auto; - } + .btn-ignite { + margin-left: auto; } } } http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-forgot-password/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-forgot-password/template.pug b/modules/web-console/frontend/app/components/page-forgot-password/template.pug index 82e7898..309e9b9 100644 --- a/modules/web-console/frontend/app/components/page-forgot-password/template.pug +++ b/modules/web-console/frontend/app/components/page-forgot-password/template.pug @@ -16,34 +16,25 @@ include /app/helpers/jade/mixins -web-console-header - web-console-header-left - ignite-header-title - -.container--responsive.body-container - section - - const form = '$ctrl.form' - h3 Forgot password? - p Enter the email address for your account & we'll email you a link to reset your password. - form(name=form novalidate ng-submit='$ctrl.remindPassword()') - +form-field__email({ - label: 'Email:', - model: '$ctrl.data.email', - name: '"email"', - placeholder: 'Input email', - required: true - })( - ng-model-options='{allowInvalid: true}' - autocomplete='email' - ignite-auto-focus - tabindex='0' - ) - +form-field__error({error: 'server', message: `{{$ctrl.serverError}}`}) - footer.form-footer - a(ui-sref='signin') Back to sign in - button.btn-ignite.btn-ignite--primary( - tabindex='1' - type='submit' - ) Send it to me - -web-console-footer +h3.public-page__title Forgot password? +p Enter the email address for your account & we'll email you a link to reset your password. +form(name='$ctrl.form' novalidate ng-submit='$ctrl.remindPassword()') + +form-field__email({ + label: 'Email:', + model: '$ctrl.data.email', + name: '"email"', + placeholder: 'Input email', + required: true + })( + ng-model-options='{allowInvalid: true}' + autocomplete='email' + ignite-auto-focus + tabindex='0' + ) + +form-field__error({error: 'server', message: `{{$ctrl.serverError}}`}) + footer.form-footer + a(ui-sref='signin') Back to sign in + button.btn-ignite.btn-ignite--primary( + tabindex='1' + type='submit' + ) Send it to me http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-landing/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-landing/index.js b/modules/web-console/frontend/app/components/page-landing/index.js index 8f678f3..cabb5bb 100644 --- a/modules/web-console/frontend/app/components/page-landing/index.js +++ b/modules/web-console/frontend/app/components/page-landing/index.js @@ -17,6 +17,7 @@ import angular from 'angular'; +import baseTemplate from './public.pug'; import template from './template.pug'; import './style.scss'; @@ -44,7 +45,15 @@ export default angular $stateProvider .state('landing', { url: '/', - template: '<page-landing></page-landing>', + views: { + '@': { + template: baseTemplate + }, + 'page@landing': { + component: 'pageLanding' + } + }, + // template: '<page-landing></page-landing>', redirectTo: (trans) => { return trans.injector().get('User').read() .then(() => { http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-landing/public.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-landing/public.pug b/modules/web-console/frontend/app/components/page-landing/public.pug new file mode 100644 index 0000000..d9153f5 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-landing/public.pug @@ -0,0 +1,21 @@ +//- + 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. + +web-console-header(hide-menu-button='true') + .web-console-header-content__title Management console for Apache Ignite + .page-landing__button-signin.btn-ignite.btn-ignite--primary(ui-sref='signin') Sign In +.content(ui-view='page') +web-console-footer.web-console-footer__page-bottom \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-landing/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-landing/style.scss b/modules/web-console/frontend/app/components/page-landing/style.scss index a92206b..90f3dda 100644 --- a/modules/web-console/frontend/app/components/page-landing/style.scss +++ b/modules/web-console/frontend/app/components/page-landing/style.scss @@ -24,8 +24,20 @@ @include custom_btn; } +.page-landing__button-signin { + align-self: center; + margin-left: 30px; + margin-right: var(--page-side-padding) !important; + min-width: 80px; + font-weight: 500; + padding: 10px 25px !important; + flex: 0 0 auto; +} + page-landing { font-family: Roboto; + display: block; + margin: 0 calc(var(--page-side-padding) * -1) calc(var(--page-side-padding) * -1); .btn-custom { @include custom_btn; http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-landing/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-landing/template.pug b/modules/web-console/frontend/app/components/page-landing/template.pug index 0fc1f9c..bf926fa 100644 --- a/modules/web-console/frontend/app/components/page-landing/template.pug +++ b/modules/web-console/frontend/app/components/page-landing/template.pug @@ -14,12 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. -web-console-header - web-console-header-left - ignite-header-title - web-console-header-right - a#signin_show.btn-ignite.btn-ignite--primary(ui-sref='signin') Sign In - section.intro-container-wrapper .container .col-lg-6.col-md-6.col-sm-6.col-xs-12.intro-content @@ -62,5 +56,3 @@ section.features-container-wrapper p The Web Console allows you to have accounts with different roles. .align-center.text-center a.btn.btn-lg.btn-primary.btn-custom(ui-sref='signup') Get Started - -web-console-footer http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-changed/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-changed/controller.js b/modules/web-console/frontend/app/components/page-password-changed/controller.js deleted file mode 100644 index e3b0a03..0000000 --- a/modules/web-console/frontend/app/components/page-password-changed/controller.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. - */ - -export default class { - static $inject = ['$state', '$timeout']; - - constructor($state, $timeout) { - $timeout(() => { - $state.go('signin'); - }, 10000); - } -} http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-changed/controller.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-changed/controller.ts b/modules/web-console/frontend/app/components/page-password-changed/controller.ts new file mode 100644 index 0000000..9696a09 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-password-changed/controller.ts @@ -0,0 +1,32 @@ +/* + * 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 {StateService} from '@uirouter/angularjs'; + +export default class implements ng.IPostLink { + static $inject = ['$state', '$timeout', '$element']; + + constructor($state: StateService, $timeout: ng.ITimeoutService, private el: JQLite) { + $timeout(() => { + $state.go('signin'); + }, 10000); + } + + $postLink() { + this.el.addClass('public-page'); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-changed/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-changed/index.js b/modules/web-console/frontend/app/components/page-password-changed/index.js index 7c244be..903138f 100644 --- a/modules/web-console/frontend/app/components/page-password-changed/index.js +++ b/modules/web-console/frontend/app/components/page-password-changed/index.js @@ -19,6 +19,7 @@ import angular from 'angular'; import template from './template.pug'; import controller from './controller'; +import publicTemplate from '../../../views/public.pug'; import './style.scss'; @@ -32,7 +33,14 @@ export default angular .config(['$stateProvider', ($stateProvider) => { $stateProvider.state('password.send', { url: '/changed', - component: 'pagePasswordChanged', + views: { + '@': { + template: publicTemplate + }, + '[email protected]': { + component: 'pagePasswordChanged' + } + }, tfMetaTags: { title: 'Password send' }, http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-changed/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-changed/style.scss b/modules/web-console/frontend/app/components/page-password-changed/style.scss index eeb44ec..e32e9b2 100644 --- a/modules/web-console/frontend/app/components/page-password-changed/style.scss +++ b/modules/web-console/frontend/app/components/page-password-changed/style.scss @@ -19,17 +19,10 @@ page-password-changed { display: flex; flex: 1 0 auto; flex-direction: column; - min-height: 100%; - - font-family: Roboto; - - .body-container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - } + justify-content: center; + align-items: center; + max-width: initial !important; h2 { margin-bottom: 30px; http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-changed/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-changed/template.pug b/modules/web-console/frontend/app/components/page-password-changed/template.pug index 7d2d986..82c2cc1 100644 --- a/modules/web-console/frontend/app/components/page-password-changed/template.pug +++ b/modules/web-console/frontend/app/components/page-password-changed/template.pug @@ -14,9 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. -.container.body-container - h2 Ready! +h2 Ready! - p - | Further instructions for password reset have been sent to your e-mail address.#[br] - | You'll be redirected back automatically in a few seconds. If not, please #[a(ui-sref='signin') click here]. +p + | Further instructions for password reset have been sent to your e-mail address.#[br] + | You'll be redirected back automatically in a few seconds. If not, please #[a(ui-sref='signin') click here]. http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-reset/controller.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-reset/controller.js b/modules/web-console/frontend/app/components/page-password-reset/controller.js index 53d6c69..b69e566 100644 --- a/modules/web-console/frontend/app/components/page-password-reset/controller.js +++ b/modules/web-console/frontend/app/components/page-password-reset/controller.js @@ -16,7 +16,9 @@ */ export default class { - static $inject = ['$modal', '$http', '$state', 'IgniteMessages']; + static $inject = ['$modal', '$http', '$state', 'IgniteMessages', '$element']; + /** @type {JQLite} */ + el; /** * @param {mgcrea.ngStrap.modal.IModalService} $modal @@ -24,10 +26,15 @@ export default class { * @param {import('@uirouter/angularjs').StateService} $state * @param {ReturnType<typeof import('app/services/Messages.service').default>} Messages */ - constructor($modal, $http, $state, Messages) { + constructor($modal, $http, $state, Messages, el) { this.$http = $http; this.$state = $state; this.Messages = Messages; + this.el = el; + } + + $postLink() { + this.el.addClass('public-page'); } $onInit() { http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-reset/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-reset/index.js b/modules/web-console/frontend/app/components/page-password-reset/index.js index e1042a6..c07fa23 100644 --- a/modules/web-console/frontend/app/components/page-password-reset/index.js +++ b/modules/web-console/frontend/app/components/page-password-reset/index.js @@ -22,6 +22,7 @@ import _ from 'lodash'; import template from './template.pug'; import controller from './controller'; +import publicTemplate from '../../../views/public.pug'; import './style.scss'; @@ -42,7 +43,14 @@ export default angular }) .state('password.reset', { url: '/reset?{token}', - component: 'pagePasswordReset', + views: { + '@': { + template: publicTemplate + }, + '[email protected]': { + component: 'pagePasswordReset' + } + }, redirectTo: (trans) => { if (_.isEmpty(trans.params('to').token)) return 'signin'; http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-reset/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-reset/style.scss b/modules/web-console/frontend/app/components/page-password-reset/style.scss index 75f758e..05ef953 100644 --- a/modules/web-console/frontend/app/components/page-password-reset/style.scss +++ b/modules/web-console/frontend/app/components/page-password-reset/style.scss @@ -20,12 +20,19 @@ page-password-reset { flex: 1 0 auto; flex-direction: column; - footer { + .form-footer { + padding: 15px 0; + text-align: right; display: flex; - justify-content: flex-end; + align-items: center; + + .btn-ignite { + margin-left: auto; + } } - .btn-ignite + .btn-ignite { - margin-left: 10px; + form { + display: grid; + grid-gap: 10px; } } http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-password-reset/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-password-reset/template.pug b/modules/web-console/frontend/app/components/page-password-reset/template.pug index 1acfab8..c0df3c9 100644 --- a/modules/web-console/frontend/app/components/page-password-reset/template.pug +++ b/modules/web-console/frontend/app/components/page-password-reset/template.pug @@ -16,65 +16,45 @@ include /app/helpers/jade/mixins -web-console-header - web-console-header-left - ignite-header-title +//- This doesn't seem to do anything ðµ +.main-content(ng-if='error') + .text-center + p {{::$ctrl.ui.error}} +h3.public-page__title(ng-if-start='$ctrl.ui.token && !$ctrl.ui.error') Reset Password +form.page-password-reset__grid(name='$ctrl.form' ng-init='reset_info.token = token' ng-if-end) + +form-field__email({ + label: 'E-mail:', + model: '$ctrl.ui.email', + disabled: true + }) + + +form-field__password({ + label: 'New password:', + model: '$ctrl.ui.password', + name: '"password"', + required: true, + placeholder: 'New password' + })( + ignite-auto-focus + ignite-on-enter-focus-move='passwordConfirmInput' + ) + +form-field__password({ + label: 'Confirm password:', + model: 'confirm', + name: '"passwordConfirm"', + required: true, + placeholder: 'Confirm new password' + })( + ignite-on-enter-focus-move='resetForm.$valid && resetPassword(user_info)' + ignite-match='$ctrl.ui.password' + ) + + footer.form-footer + a(ui-sref='default-state') Cancel + button.btn-ignite.btn-ignite--primary( + ng-disabled='$ctrl.form.$invalid' + ng-click='$ctrl.resetPassword()' + ) + svg.icon-left(ignite-icon='checkmark') + | Save Changes -.container.body-container - .row - .main-content(ng-if='error') - .text-center - p {{::$ctrl.ui.error}} - div(ng-if='$ctrl.ui.token && !$ctrl.ui.error') - header.header-with-selector - div - h1 Reset Password - - -var form = '$ctrl.form' - form.theme--ignite(name='$ctrl.form' ng-init='reset_info.token = token') - .row - .col-50 - +form-field__email({ - label: 'E-mail:', - model: '$ctrl.ui.email', - disabled: true - }) - - .row - .col-50 - +form-field__password({ - label: 'New password:', - model: '$ctrl.ui.password', - name: '"password"', - required: true, - placeholder: 'New password' - })( - ignite-auto-focus - ignite-on-enter-focus-move='passwordConfirmInput' - ) - - .row - .col-50 - +form-field__password({ - label: 'Confirm password:', - model: 'confirm', - name: '"passwordConfirm"', - required: true, - placeholder: 'Confirm new password' - })( - ignite-on-enter-focus-move='resetForm.$valid && resetPassword(user_info)' - ignite-match='$ctrl.ui.password' - ) - - hr - - footer - a.btn-ignite.btn-ignite--link-success(type='button' ui-sref='default-state') Cancel - button.btn-ignite.btn-ignite--success( - ng-disabled='$ctrl.form.$invalid' - ng-click='$ctrl.resetPassword()' - ) - svg.icon-left(ignite-icon='checkmark') - | Save Changes - -web-console-footer http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-queries/index.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-queries/index.js b/modules/web-console/frontend/app/components/page-queries/index.js deleted file mode 100644 index ba9e511..0000000 --- a/modules/web-console/frontend/app/components/page-queries/index.js +++ /dev/null @@ -1,100 +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 './style.scss'; - -import angular from 'angular'; - -import queriesNotebooksList from './components/queries-notebooks-list'; -import queriesNotebook from './components/queries-notebook'; -import pageQueriesCmp from './component'; -import {default as ActivitiesData} from 'app/core/activities/Activities.data'; -import Notebook from './notebook.service'; - -/** - * @param {uirouter.UIRouter} $uiRouter - * @param {ActivitiesData} ActivitiesData - */ -function registerActivitiesHook($uiRouter, ActivitiesData) { - $uiRouter.transitionService.onSuccess({to: 'base.sql.**'}, (transition) => { - ActivitiesData.post({group: 'sql', action: transition.targetState().name()}); - }); -} - -registerActivitiesHook.$inject = ['$uiRouter', 'IgniteActivitiesData']; - -export default angular.module('ignite-console.sql', [ - 'ui.router', - queriesNotebooksList.name, - queriesNotebook.name -]) - .component('pageQueries', pageQueriesCmp) - .component('pageQueriesSlot', { - require: { - pageQueries: '^pageQueries' - }, - bindings: { - slotName: '<' - }, - controller: class { - static $inject = ['$transclude', '$timeout']; - - constructor($transclude, $timeout) { - this.$transclude = $transclude; - this.$timeout = $timeout; - } - - $postLink() { - this.$transclude((clone) => { - this.pageQueries[this.slotName].empty(); - clone.appendTo(this.pageQueries[this.slotName]); - }); - } - }, - transclude: true - }) - .service('IgniteNotebook', Notebook) - .config(['$stateProvider', ($stateProvider) => { - // set up the states - $stateProvider - .state('base.sql', { - abstract: true - }) - .state('base.sql.tabs', { - url: '/queries', - component: 'pageQueries', - redirectTo: 'base.sql.tabs.notebooks-list', - permission: 'query' - }) - .state('base.sql.tabs.notebooks-list', { - url: '/notebooks', - component: 'queriesNotebooksList', - permission: 'query', - tfMetaTags: { - title: 'Notebooks' - } - }) - .state('base.sql.notebook', { - url: '/notebook/{noteId}', - component: 'queriesNotebook', - permission: 'query', - tfMetaTags: { - title: 'Query notebook' - } - }); - }]) - .run(registerActivitiesHook); http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-queries/index.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-queries/index.ts b/modules/web-console/frontend/app/components/page-queries/index.ts new file mode 100644 index 0000000..2e25cb0 --- /dev/null +++ b/modules/web-console/frontend/app/components/page-queries/index.ts @@ -0,0 +1,110 @@ +/* + * 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 './style.scss'; + +import angular from 'angular'; + +import queriesNotebooksList from './components/queries-notebooks-list'; +import queriesNotebook from './components/queries-notebook'; +import pageQueriesCmp from './component'; +import {default as ActivitiesData} from 'app/core/activities/Activities.data'; +import Notebook from './notebook.service'; +import {navigationMenuItem, AppStore} from '../../store'; + +/** + * @param {uirouter.UIRouter} $uiRouter + * @param {ActivitiesData} ActivitiesData + */ +function registerActivitiesHook($uiRouter, ActivitiesData) { + $uiRouter.transitionService.onSuccess({to: 'base.sql.**'}, (transition) => { + ActivitiesData.post({group: 'sql', action: transition.targetState().name()}); + }); +} + +registerActivitiesHook.$inject = ['$uiRouter', 'IgniteActivitiesData']; + +export default angular.module('ignite-console.sql', [ + 'ui.router', + queriesNotebooksList.name, + queriesNotebook.name +]) + .run(['Store', (store: AppStore) => { + store.dispatch(navigationMenuItem({ + activeSref: 'base.sql.**', + icon: 'sql', + label: 'Queries', + order: 2, + sref: 'base.sql.tabs.notebooks-list' + })); + }]) + .component('pageQueries', pageQueriesCmp) + .component('pageQueriesSlot', { + require: { + pageQueries: '^pageQueries' + }, + bindings: { + slotName: '<' + }, + controller: class { + static $inject = ['$transclude', '$timeout']; + + constructor($transclude, $timeout) { + this.$transclude = $transclude; + this.$timeout = $timeout; + } + + $postLink() { + this.$transclude((clone) => { + this.pageQueries[this.slotName].empty(); + clone.appendTo(this.pageQueries[this.slotName]); + }); + } + }, + transclude: true + }) + .service('IgniteNotebook', Notebook) + .config(['$stateProvider', ($stateProvider) => { + // set up the states + $stateProvider + .state('base.sql', { + abstract: true + }) + .state('base.sql.tabs', { + url: '/queries', + component: 'pageQueries', + redirectTo: 'base.sql.tabs.notebooks-list', + permission: 'query' + }) + .state('base.sql.tabs.notebooks-list', { + url: '/notebooks', + component: 'queriesNotebooksList', + permission: 'query', + tfMetaTags: { + title: 'Notebooks' + } + }) + .state('base.sql.notebook', { + url: '/notebook/{noteId}', + component: 'queriesNotebook', + permission: 'query', + tfMetaTags: { + title: 'Query notebook' + } + }); + }]) + .run(registerActivitiesHook); http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-signin/controller.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-signin/controller.ts b/modules/web-console/frontend/app/components/page-signin/controller.ts index c461b86..18fee0b 100644 --- a/modules/web-console/frontend/app/components/page-signin/controller.ts +++ b/modules/web-console/frontend/app/components/page-signin/controller.ts @@ -27,7 +27,7 @@ interface ISigninFormController extends ng.IFormController { password: ng.INgModelController } -export default class { +export default class implements ng.IPostLink { data: ISiginData = { email: null, password: null @@ -37,15 +37,16 @@ export default class { serverError: string = null; - static $inject = ['Auth', 'IgniteMessages', 'IgniteFormUtils']; + static $inject = ['Auth', 'IgniteMessages', 'IgniteFormUtils', '$element']; - constructor(private Auth: AuthService, private IgniteMessages, private IgniteFormUtils) {} + constructor(private Auth: AuthService, private IgniteMessages, private IgniteFormUtils, private el: JQLite) {} canSubmitForm(form: ISigninFormController) { return form.$error.server ? true : !form.$invalid; } $postLink() { + this.el.addClass('public-page'); this.form.email.$validators.server = () => !this.serverError; this.form.password.$validators.server = () => !this.serverError; } http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-signin/run.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-signin/run.ts b/modules/web-console/frontend/app/components/page-signin/run.ts index aa5647c..4c0a1e6 100644 --- a/modules/web-console/frontend/app/components/page-signin/run.ts +++ b/modules/web-console/frontend/app/components/page-signin/run.ts @@ -15,6 +15,7 @@ * limitations under the License. */ +import publicTemplate from '../../../views/public.pug'; import {UIRouter} from '@uirouter/angularjs'; import {IIgniteNg1StateDeclaration} from 'app/types'; @@ -22,7 +23,14 @@ export function registerState($uiRouter: UIRouter) { const state: IIgniteNg1StateDeclaration = { url: '/signin', name: 'signin', - component: 'pageSignin', + views: { + '': { + template: publicTemplate + }, + 'page@signin': { + component: 'pageSignin' + } + }, unsaved: true, redirectTo: (trans) => { const skipStates = new Set(['signup', 'forgotPassword', 'landing']); http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-signin/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-signin/style.scss b/modules/web-console/frontend/app/components/page-signin/style.scss index 51da101..729d439 100644 --- a/modules/web-console/frontend/app/components/page-signin/style.scss +++ b/modules/web-console/frontend/app/components/page-signin/style.scss @@ -18,32 +18,19 @@ page-signin { display: flex; flex-direction: column; - flex: 1 0 auto; - section { - margin-left: auto; - margin-right: auto; - width: 530px; - - h3 { - font-size: 38px; - font-weight: 300; - margin: 30px 0 30px; - } - - .form-field { - margin: 10px 0; - } + .form-field { + margin: 10px 0; + } - .form-footer { - padding: 15px 0; - text-align: right; - display: flex; - align-items: center; + .form-footer { + padding: 15px 0; + text-align: right; + display: flex; + align-items: center; - .btn-ignite { - margin-left: auto; - } + .btn-ignite { + margin-left: auto; } } http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-signin/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-signin/template.pug b/modules/web-console/frontend/app/components/page-signin/template.pug index b31a9bd..2a128a0 100644 --- a/modules/web-console/frontend/app/components/page-signin/template.pug +++ b/modules/web-console/frontend/app/components/page-signin/template.pug @@ -16,44 +16,35 @@ include /app/helpers/jade/mixins -web-console-header - web-console-header-left - ignite-header-title - -.container--responsive.body-container - section - -var form = '$ctrl.form' - h3 Sign In - form(name=form novalidate ng-submit='$ctrl.signin()') - +form-field__email({ - label: 'Email:', - model: '$ctrl.data.email', - name: '"email"', - placeholder: 'Input email', - required: true - })( - ng-model-options='{allowInvalid: true}' - autocomplete='email' - ignite-auto-focus - ) - +form-field__error({error: 'server', message: `{{$ctrl.serverError}}`}) - +form-field__password({ - label: 'Password:', - model: '$ctrl.data.password', - name: '"password"', - placeholder: 'Input password', - required: true - })( - ng-model-options='{allowInvalid: true}' - autocomplete='current-password' - ) - +form-field__error({error: 'server', message: `{{$ctrl.serverError}}`}) - footer.form-footer - a(ui-sref='forgotPassword({email: $ctrl.data.email})') Forgot password? - button.btn-ignite.btn-ignite--primary( - type='submit' - ) Sign In - footer.page-signin__no-account-message - | Don't have an account? #[a(ui-sref='signup') Get started] - -web-console-footer +h3.public-page__title Sign In +form(name='$ctrl.form' novalidate ng-submit='$ctrl.signin()') + +form-field__email({ + label: 'Email:', + model: '$ctrl.data.email', + name: '"email"', + placeholder: 'Input email', + required: true + })( + ng-model-options='{allowInvalid: true}' + autocomplete='email' + ignite-auto-focus + ) + +form-field__error({error: 'server', message: `{{$ctrl.serverError}}`}) + +form-field__password({ + label: 'Password:', + model: '$ctrl.data.password', + name: '"password"', + placeholder: 'Input password', + required: true + })( + ng-model-options='{allowInvalid: true}' + autocomplete='current-password' + ) + +form-field__error({error: 'server', message: `{{$ctrl.serverError}}`}) + footer.form-footer + a(ui-sref='forgotPassword({email: $ctrl.data.email})') Forgot password? + button.btn-ignite.btn-ignite--primary( + type='submit' + ) Sign In +footer.page-signin__no-account-message + | Don't have an account? #[a(ui-sref='signup') Get started] http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-signup/controller.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-signup/controller.ts b/modules/web-console/frontend/app/components/page-signup/controller.ts index ddf77be..93d9987 100644 --- a/modules/web-console/frontend/app/components/page-signup/controller.ts +++ b/modules/web-console/frontend/app/components/page-signup/controller.ts @@ -20,7 +20,7 @@ import MessagesFactory from '../../services/Messages.service'; import FormUtilsFactoryFactory from '../../services/FormUtils.service'; import {ISignupData} from '../form-signup'; -export default class PageSignup { +export default class PageSignup implements ng.IPostLink { form: ng.IFormController; data: ISignupData = { @@ -34,14 +34,19 @@ export default class PageSignup { serverError: string | null = null; - static $inject = ['Auth', 'IgniteMessages', 'IgniteFormUtils']; + static $inject = ['Auth', 'IgniteMessages', 'IgniteFormUtils', '$element']; constructor( private Auth: Auth, private IgniteMessages: ReturnType<typeof MessagesFactory>, - private IgniteFormUtils: ReturnType<typeof FormUtilsFactoryFactory> + private IgniteFormUtils: ReturnType<typeof FormUtilsFactoryFactory>, + private el: JQLite ) {} + $postLink() { + this.el.addClass('public-page'); + } + canSubmitForm(form: PageSignup['form']) { return form.$error.server ? true : !form.$invalid; } http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-signup/run.js ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-signup/run.js b/modules/web-console/frontend/app/components/page-signup/run.js index 1d04fa2..bd27638 100644 --- a/modules/web-console/frontend/app/components/page-signup/run.js +++ b/modules/web-console/frontend/app/components/page-signup/run.js @@ -15,6 +15,8 @@ * limitations under the License. */ +import publicTemplate from '../../../views/public.pug'; + /** * @param {import("@uirouter/angularjs").UIRouter} $uiRouter */ @@ -23,7 +25,14 @@ export function registerState($uiRouter) { const state = { name: 'signup', url: '/signup', - component: 'pageSignup', + views: { + '': { + template: publicTemplate + }, + 'page@signup': { + component: 'pageSignup' + } + }, unsaved: true, tfMetaTags: { title: 'Sign Up' http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-signup/style.scss ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-signup/style.scss b/modules/web-console/frontend/app/components/page-signup/style.scss index 98c4729..0930036 100644 --- a/modules/web-console/frontend/app/components/page-signup/style.scss +++ b/modules/web-console/frontend/app/components/page-signup/style.scss @@ -20,26 +20,14 @@ page-signup { flex-direction: column; flex: 1 0 auto; - section { - h3 { - font-size: 38px; - font-weight: 300; - margin: 30px 0 30px; - } - - margin-left: auto; - margin-right: auto; - width: 530px; - - form footer { - padding: 15px 0; - text-align: right; - display: flex; - align-items: center; + form footer { + padding: 15px 0; + text-align: right; + display: flex; + align-items: center; - .btn-ignite { - margin-left: auto; - } + .btn-ignite { + margin-left: auto; } } http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/page-signup/template.pug ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/page-signup/template.pug b/modules/web-console/frontend/app/components/page-signup/template.pug index 5584dfc..686079a 100644 --- a/modules/web-console/frontend/app/components/page-signup/template.pug +++ b/modules/web-console/frontend/app/components/page-signup/template.pug @@ -14,26 +14,16 @@ See the License for the specific language governing permissions and limitations under the License. -include /app/helpers/jade/mixins - -web-console-header - web-console-header-left - ignite-header-title - -.container--responsive.body-container - section - h3 Don't Have An Account? - form(name='$ctrl.form' novalidate ng-submit='$ctrl.signup()') - form-signup( - outer-form='$ctrl.form' - ng-model='$ctrl.data' - server-error='$ctrl.serverError' - ) - footer.full-width.form-footer - button.btn-ignite.btn-ignite--primary( - type='submit' - ) Sign Up - footer.page-signup__has-account-message - | Already have an account? #[a(ui-sref='signin') Sign in here] - -web-console-footer +h3.public-page__title Don't Have An Account? +form(name='$ctrl.form' novalidate ng-submit='$ctrl.signup()') + form-signup( + outer-form='$ctrl.form' + ng-model='$ctrl.data' + server-error='$ctrl.serverError' + ) + footer.full-width.form-footer + button.btn-ignite.btn-ignite--primary( + type='submit' + ) Sign Up +footer.page-signup__has-account-message + | Already have an account? #[a(ui-sref='signin') Sign in here] http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/permanent-notifications/component.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/permanent-notifications/component.ts b/modules/web-console/frontend/app/components/permanent-notifications/component.ts new file mode 100644 index 0000000..e86d3e5 --- /dev/null +++ b/modules/web-console/frontend/app/components/permanent-notifications/component.ts @@ -0,0 +1,25 @@ +/* + * 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 './template.pug'; +import controller from './controller'; +import './style.scss'; + +export const component: ng.IComponentOptions = { + template, + controller +}; http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/permanent-notifications/controller.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/permanent-notifications/controller.ts b/modules/web-console/frontend/app/components/permanent-notifications/controller.ts new file mode 100644 index 0000000..d672304 --- /dev/null +++ b/modules/web-console/frontend/app/components/permanent-notifications/controller.ts @@ -0,0 +1,28 @@ +/* + * 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 class PermanentNotifications { + static $inject = ['UserNotifications', '$rootScope', '$window'] + constructor( + private UserNotifications: unknown, + private $rootScope: ng.IRootScopeService, + private $window: ng.IWindowService + ) {} + closeDemo() { + this.$window.close(); + } +} http://git-wip-us.apache.org/repos/asf/ignite/blob/9dc251cd/modules/web-console/frontend/app/components/permanent-notifications/index.ts ---------------------------------------------------------------------- diff --git a/modules/web-console/frontend/app/components/permanent-notifications/index.ts b/modules/web-console/frontend/app/components/permanent-notifications/index.ts new file mode 100644 index 0000000..33a9189 --- /dev/null +++ b/modules/web-console/frontend/app/components/permanent-notifications/index.ts @@ -0,0 +1,21 @@ +/* + * 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 {component} from './component'; + +export default angular.module('ignite-console.permanent-notifications', []) + .component('permanentNotifications', component);
