From cc873d9e4e4d2b65fc467af74ab70da1d3325428 Mon Sep 17 00:00:00 2001 From: Oleksii Kurinnyi Date: Thu, 18 Jan 2018 11:27:17 +0200 Subject: [PATCH] Dashboard: code clean-up (#8333) * make dashboard *.ts files compliant to typescript and tslint rules Signed-off-by: Oleksii Kurinnyi * remove unused component Signed-off-by: Oleksii Kurinnyi --- dashboard/src/app/admin/admin-config.ts | 4 +- .../src/app/admin/plugins/plugins-config.ts | 36 --- .../src/app/admin/plugins/plugins-filter.ts | 40 --- .../app/admin/plugins/plugins.controller.ts | 288 ------------------ dashboard/src/app/admin/plugins/plugins.html | 180 ----------- dashboard/src/app/admin/plugins/plugins.styl | 63 ---- .../user-details/user-details.controller.ts | 26 +- .../user-management.controller.ts | 20 +- .../administration/administration-config.ts | 2 +- .../docker-registry-list.directive.ts | 23 +- .../src/app/colors/che-color.constant.ts | 4 +- .../app/colors/che-color.constant.ts.template | 4 +- .../che-output-colors.constant.ts.template | 4 +- .../src/app/constants/che-jobs.constant.ts | 62 ++-- .../src/app/dashboard/dashboard-config.ts | 6 +- .../dashboard-panel.directive.ts | 22 +- .../last-workspaces.directive.ts | 19 +- .../app/diagnostics/diagnostics.directive.ts | 2 +- .../action/factory-action-box.directive.ts | 16 +- .../command/factory-command.directive.ts | 16 +- .../factory-from-file.controller.ts | 2 +- .../factory-from-file.directive.ts | 16 +- .../create-factory/create-factory-config.ts | 2 +- .../create-factory.controller.ts | 9 +- .../git/create-factory-git.directive.ts | 14 +- .../factory-from-template.directive.ts | 16 +- .../src/app/factories/factories-config.ts | 4 +- .../factory-details/factory-details-config.ts | 4 +- .../factory-details.controller.ts | 2 + .../factory-information.controller.ts | 14 +- .../last-factories.directive.ts | 14 +- .../factory-item/factory-item.controller.ts | 7 +- .../factory-item/factory-item.directive.ts | 2 +- .../load-factory/load-factory.controller.ts | 32 +- .../load-factory/load-factory.service.ts | 2 +- .../navbar-dropdown-menu.directive.ts | 159 +++++----- .../app/navbar/navbar-selected.controller.ts | 4 +- .../app/navbar/navbar-selected.directive.ts | 31 +- dashboard/src/app/navbar/navbar.controller.ts | 2 +- dashboard/src/app/navbar/navbar.directive.ts | 12 +- .../navbar-notification.controller.ts | 4 +- .../navbar-notification.directive.ts | 21 +- .../recent-workspaces.controller.spec.ts | 4 +- .../recent-workspaces.directive.ts | 2 +- ...zation-select-members-dialog.controller.ts | 6 +- dashboard/src/app/profile/profile-config.ts | 2 +- .../src/app/profile/profile.controller.ts | 6 +- .../proxy/proxy-settings.constant.ts.template | 4 +- .../build-stack/build-stack.controller.ts | 3 +- .../recipe-editor/recipe-editor.ts | 1 - .../stack-item/stack-item.controller.ts | 12 +- .../stack-item/stack-item.directive.ts | 41 ++- .../stack-details/import-stack.service.ts | 8 +- .../select-template.controller.ts | 6 +- .../stacks/stack-details/stack.controller.ts | 18 +- .../invite-members/list-members.controller.ts | 2 +- .../invite-members/list-members.directive.ts | 2 - .../list-team-members.controller.ts | 38 ++- .../member-item/member-item.controller.ts | 2 +- .../member-item/member-item.directive.ts | 2 - .../add-import-project.controller.ts | 2 + .../edit-project/edit-project.controller.ts | 2 + .../project-metadata.controller.ts | 2 + .../workspace-item/usage-chart.directive.ts | 22 +- .../add-developers.controller.ts | 2 + .../share-workspace.controller.ts | 18 +- .../list-env-variables.controller.ts | 6 +- .../edit-server-dialog.controller.ts | 5 +- .../list-servers/list-servers.controller.ts | 6 +- .../machine-config.controller.ts | 9 +- .../machine-config.directive.ts | 7 +- .../export-workspace-dialog.controller.ts | 18 +- .../export-workspace.controller.ts | 9 +- .../export-workspace.directive.ts | 30 +- .../ready-to-go-stacks.controller.ts | 7 +- .../ready-to-go-stacks.directive.ts | 26 +- ...create-project-stack-library.controller.ts | 8 +- .../create-project-stack-library.directive.ts | 27 +- .../warnings/workspace-warnings.directive.ts | 18 +- .../edit-machine-dialog.controller.ts | 24 +- .../add-project-popover.controller.ts | 2 + .../project-details.controller.ts | 6 +- .../project-repository.controller.ts | 6 +- .../workspace-details-ssh.controller.ts | 23 +- .../workspace-details-ssh.directive.ts | 12 +- ...kspace-ram-allocation-slider.controller.ts | 4 +- ...rkspace-ram-allocation-slider.directive.ts | 35 +-- .../workspace-status-indicator.directive.ts | 10 +- .../workspace-status.directive.ts | 1 - .../api/builder/che-workspace-builder.ts | 8 +- .../src/components/api/che-agent.factory.ts | 4 +- .../api/environment/compose-parser.ts | 3 + dashboard/src/components/typings/che.d.ts | 16 +- dashboard/tsconfig.json | 3 +- 94 files changed, 598 insertions(+), 1152 deletions(-) delete mode 100644 dashboard/src/app/admin/plugins/plugins-config.ts delete mode 100644 dashboard/src/app/admin/plugins/plugins-filter.ts delete mode 100644 dashboard/src/app/admin/plugins/plugins.controller.ts delete mode 100644 dashboard/src/app/admin/plugins/plugins.html delete mode 100644 dashboard/src/app/admin/plugins/plugins.styl diff --git a/dashboard/src/app/admin/admin-config.ts b/dashboard/src/app/admin/admin-config.ts index 05f4cbd905..9c12be8df1 100644 --- a/dashboard/src/app/admin/admin-config.ts +++ b/dashboard/src/app/admin/admin-config.ts @@ -10,7 +10,6 @@ */ 'use strict'; -import {AdminsPluginsConfig} from './plugins/plugins-config'; import {AdminsUserManagementConfig} from './user-management/user-management-config'; /** @@ -19,8 +18,9 @@ import {AdminsUserManagementConfig} from './user-management/user-management-conf export class AdminsConfig { constructor(register: che.IRegisterService) { - new AdminsPluginsConfig(register); + /* tslint:disable */ new AdminsUserManagementConfig(register); + /* tslint:enable */ } } diff --git a/dashboard/src/app/admin/plugins/plugins-config.ts b/dashboard/src/app/admin/plugins/plugins-config.ts deleted file mode 100644 index b605eb94fb..0000000000 --- a/dashboard/src/app/admin/plugins/plugins-config.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2015-2018 Red Hat, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -'use strict'; - -/* exported PluginFilter */ - -import {AdminPluginsCtrl} from './plugins.controller'; -import {PluginsFilter} from './plugins-filter'; -export class AdminsPluginsConfig { - - constructor(register) { - register.controller('AdminPluginsCtrl', AdminPluginsCtrl); - - new PluginsFilter(register); - - // config routes - register.app.config(function ($routeProvider) { - $routeProvider.accessWhen('/admin/plugins', { - templateUrl: 'app/admin/plugins/plugins.html', - controller: 'AdminPluginsCtrl', - controllerAs: 'adminPluginsCtrl' - }); - }) - ; - } -} - - diff --git a/dashboard/src/app/admin/plugins/plugins-filter.ts b/dashboard/src/app/admin/plugins/plugins-filter.ts deleted file mode 100644 index 217e3e0344..0000000000 --- a/dashboard/src/app/admin/plugins/plugins-filter.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2015-2018 Red Hat, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -'use strict'; - - -export class PluginsFilter { - - constructor(register) { - // Register this factory - register.app.filter('filterStagedPlugins', function () { - return function (toFilterPlugins) { - // no plugins, nothing to get - if (!toFilterPlugins) { - return []; - } - - let filtered = []; - for (var i = 0; i < toFilterPlugins.length; i++) { - var plugin = toFilterPlugins[i]; - if ('STAGED_INSTALL' === plugin.status || 'STAGED_UNINSTALL' === plugin.status) { - filtered.push(plugin); - } - } - - return filtered; - }; - }); - } -} - - - diff --git a/dashboard/src/app/admin/plugins/plugins.controller.ts b/dashboard/src/app/admin/plugins/plugins.controller.ts deleted file mode 100644 index 5f127b68fa..0000000000 --- a/dashboard/src/app/admin/plugins/plugins.controller.ts +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 2015-2018 Red Hat, Inc. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - */ -'use strict'; - -/** - * @ngdoc controller - * @name admin.plugins.controller:PluginsCtrl - * @description This class is handling the controller of the plugins - * @author Florent Benoit - */ -export class AdminPluginsCtrl { - - - /** - * Default constructor - * @ngInject for Dependency injection - */ - constructor($scope, $q, $mdDialog, $interval, $location, $anchorScroll, cheNotification, cheAdminPlugins) { - this.$scope = $scope; - this.$q = $q; - this.$mdDialog = $mdDialog; - this.$interval = $interval; - this.$location = $location; - this.$anchorScroll = $anchorScroll; - this.cheNotification = cheNotification; - this.cheAdminPlugins = cheAdminPlugins; - - this.isLoading = true; - this.buildInProgress = false; - this.displayReloadChe = false; - this.buildCheFailed = false; - - this.plugins = []; - - this.refreshPlugins(); - } - - - refreshPlugins() { - let promise = this.cheAdminPlugins.fetchPlugins(); - - promise.then(() => { - this.updateData(); - this.isLoading = false; - }, (error: any) => { - this.isLoading = false; - if (error && error.status === 304) { - this.updateData(); - } - }); - } - - /** - * Require to remove the given plugin - * @param pluginName name of the plugin to remove - */ - remove(event, pluginName) { - - let confirm = this.$mdDialog.confirm() - .title('Would you like to remove plug-in ' + pluginName + '?') - .content('') - .ariaLabel('Remove plug-in') - .ok('Delete it!') - .cancel('Cancel') - .clickOutsideToClose(true) - .targetEvent(event); - this.$mdDialog.show(confirm).then(() => { - let promise = this.cheAdminPlugins.removePlugin(pluginName); - promise.then(() => { - this.refreshPlugins(); - }, (error) => { - this.cheNotification.showError(error.data.message ? error.data.message : 'Delete failed.'); - console.log('error', error); - }); - }); - - - } - - - /** - * Require to install the given plugin - * @param pluginName name of the plugin to install and then add into staged - */ - install(pluginName) { - let promise = this.cheAdminPlugins.updatePlugin(pluginName, 'TO_INSTALL'); - let installPromise = promise.then(() => { - this.refreshPlugins(); - }); - - - return installPromise; - } - - /** - * Require to install the given plugin - * @param pluginName name of the plugin to install and then add into staged - */ - uninstall(pluginName) { - let promise = this.cheAdminPlugins.updatePlugin(pluginName, 'TO_UNINSTALL'); - let uninstallPromise = promise.then(() => { - this.refreshPlugins(); - }); - - - return uninstallPromise; - } - - - - prettyPrintStatus(plugin) { - if ('STAGED_INSTALL' === plugin.status) { - return 'To Be Installed'; - } else if ('STAGED_UNINSTALL' === plugin.status) { - return 'To Be Uninstalled'; - } - - - } - - cancelStage(plugin) { - - let action; - if ('STAGED_INSTALL' === plugin.status) { - action = 'UNDO_TO_INSTALL'; - } else if ('STAGED_UNINSTALL' === plugin.status) { - action = 'UNDO_TO_UNINSTALL'; - } else { - return; - } - - - let promise = this.cheAdminPlugins.updatePlugin(plugin.name, action); - let cancelPromise = promise.then(() => { - this.refreshPlugins(); - }); - - - return cancelPromise; - } - - - updateData() { - - this.plugins.length = 0; - let updatePlugins = this.cheAdminPlugins.getPlugins(); - updatePlugins.forEach((plugin) => { - this.plugins.push(plugin); - }); - - } - - - dropzoneAcceptURL(url) { - - if (!url.startsWith('upload:') && !url.startsWith('https://eclipse.org/che/?install')) { - let deferred = this.$q.defer(); - deferred.reject({data: {message:'The plugin URL is invalid'}}); - return deferred.promise; - } - - var pluginReference = this.getPluginReference(url); - - let promise = this.cheAdminPlugins.addPlugin(pluginReference); - let addPromise = promise.then(() => { - this.refreshPlugins(); - }, (error) => { - throw error; - }); - - return addPromise; - } - - - /** - * Gets the plugin URI based on groupId, etc or if not found return the input URL - * @param uri - * @returns {*} - */ - getPluginReference(uri) { - - var query = uri; - var result = {}; - query.split('&').forEach(function(part) { - var item = part.split('='); - result[item[0]] = decodeURIComponent(item[1]); - }); - - return result.uri || uri; - } - - - buildAssembly() { - - this.buildInProgress = true; - this.displayReloadChe = false; - this.buildCheFailed = false; - this.displayLog = false; - - - let startInstallPromise = this.cheAdminPlugins.startInstall(); - startInstallPromise.then((data) => { - // get ID - let id = data.id; - - this.follow = this.$interval(() => { - this.followProcess(id); - }, 5000); - - }, (error) => { - this.buildInProgress = false; - this.cheNotification.showError(error.data.message ? error.data.message : error); - }); - - } - - - - followProcess(id) { - this.checkInstall(id); - } - - checkInstall(id) { - let checkStatusPromise = this.cheAdminPlugins.getInstallDetails(id); - - checkStatusPromise.then((data) => { - - var regExp = new RegExp('\n', 'g'); - this.currentBuildLog = data.log.replace(regExp, '
'); - - if ('SUCCESS' === data.status || 'FAILED' === data.status) { - // cancel scan - this.$interval.cancel(this.follow); - this.finishInstall(data.status); - } - - }); - - } - - finishInstall(status) { - this.refreshPlugins(); - this.buildInProgress = false; - if (status === 'SUCCESS') { - this.displayReloadChe = true; - } else { - this.displayReloadChe = false; - this.buildCheFailed = true; - - } - } - - /** - * Reload the app - */ - reloadChe() { - this.reloadcheInProgress = true; - let promise = this.cheAdminPlugins.reloadCheApp(); - promise.then(() => { - this.reloadcheInProgress = false; - this.reloadcheDone = true; - this.displayReloadChe = false; - }, () => { - this.reloadcheInProgress = false; - this.displayReloadChe = false; - }); - - } - - scrollToStaged() { - this.$location.hash('plugin-staged'); - this.$anchorScroll(); - } - - toggleDisplayLog() { - this.displayLog = !this.displayLog; - } - - -} diff --git a/dashboard/src/app/admin/plugins/plugins.html b/dashboard/src/app/admin/plugins/plugins.html deleted file mode 100644 index 2dc33c7611..0000000000 --- a/dashboard/src/app/admin/plugins/plugins.html +++ /dev/null @@ -1,180 +0,0 @@ - - - - - - -
Plug-ins that are packaged and linked in this Che assembly.
- -
- No user plug-ins are currently installed in this Che assembly. -
- -
- - - - - - - - - - - - - - - - - - - - - - - - -
Plug-InVersionScopeAction
{{plugin.name}}{{plugin.version}}{{plugin.category}} -
{{plugin.name}}{{plugin.version}}{{plugin.category}}To Be Uninstalled
- - - -
- {{(adminPluginsCtrl.plugins | filter: { status: 'STAGED_UNINSTALL' }).length}} staged for installation -
- - -
- -
- - - -
Plug-ins that can be added to this Che assembly.
- -
-
- -
-
- -
-
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
Plug-InVersionScopeAction
{{plugin.name}}{{plugin.version}}{{plugin.category}} - - -
{{plugin.name}}{{plugin.version}}{{plugin.category}}To Be Installed
- - -
- - on available plug-ins:  -
-
- -
- - - -
Plug-ins that will be packaged and linked into this Che assembly.
- -
- There are no plug-ins currently staged. -
- -
- - - - - - - - - - - - - - - - - - - - -
Plug-InVersionScopeStateAction
{{plugin.name}}{{plugin.version}}{{plugin.category}}{{adminPluginsCtrl.prettyPrintStatus(plugin)}}
-
- -
- -
- -
-
Che App Reloaded
-
Build of Che App failed. See log below
-
- -
-
-
-
Building...
-
-
-
- -
-
- -
-
- -
- - -
- - -
diff --git a/dashboard/src/app/admin/plugins/plugins.styl b/dashboard/src/app/admin/plugins/plugins.styl deleted file mode 100644 index 1a40b779c2..0000000000 --- a/dashboard/src/app/admin/plugins/plugins.styl +++ /dev/null @@ -1,63 +0,0 @@ -md-content.plugins-content - background-color $list-separator-color - - -.plugins-staged-zone-action - padding-top 20px - padding-bottom 20px - - -.plugins-table - width 100% - -.plugins-table che-link - margin-left 10px - -.plugins-table, .plugins-table th, .plugins-table td - border-collapse collapse - empty-cells show - border-width 1px - border-style solid - border-color $list-separator-color - -.plugins-table th - background-color $table-header-color - font-size 18px - color $label-primary-color - -.plugins-table th, .plugins-table td - padding: 1em - -.plugins-greyed-action - color $label-info-color - font-style italic - -.plugins-install-output - height 450px - overflow scroll - padding 15px - box-shadow-simple() - -.plugin-install-build-label - font-size 18px - color $label-info-color - margin-right 20px - -.plugins-panel-subtitle - margin-top -15px - margin-bottom 15px - -.plugins-review-box - margin-top 10px - text-align right - -.plugin-empty-space - min-height 700px - - -.plugins-nothing-now - color $label-info-color - -.plugins-build-failed - color red - margin-bottom 15px diff --git a/dashboard/src/app/admin/user-management/user-details/user-details.controller.ts b/dashboard/src/app/admin/user-management/user-details/user-details.controller.ts index 763fc851e4..ede5236d0b 100644 --- a/dashboard/src/app/admin/user-management/user-details/user-details.controller.ts +++ b/dashboard/src/app/admin/user-management/user-details/user-details.controller.ts @@ -10,21 +10,15 @@ */ 'use strict'; +import {CheNotification} from '../../../../components/notification/che-notification.factory'; +import {CheProfile} from '../../../../components/api/che-profile.factory'; + enum Tab {Profile, Organization} interface IScope extends ng.IScope { profileInformationForm: ng.IFormController; } -interface IProfileAttributes { - firstName?: string; - lastName?: string; - phone?: string; - country?: string; - employer?: string; - jobtitle?: string; -} - const MAX_ITEMS = 12; /** @@ -42,11 +36,11 @@ export class AdminUserDetailsController { /** * User profile service. */ - private cheProfile: any; + private cheProfile: CheProfile; /** * Notification service. */ - private cheNotification: any; + private cheNotification: CheNotification; /** * Index of the selected tab. */ @@ -58,7 +52,7 @@ export class AdminUserDetailsController { /** * Profile attributes. */ - private profileAttributes: IProfileAttributes; + private profileAttributes: che.IProfileAttributes; /** * Loading state of the page. */ @@ -84,7 +78,13 @@ export class AdminUserDetailsController { * Default constructor that is using resource injection * @ngInject for Dependency injection */ - constructor(cheProfile: any, $location: ng.ILocationService, $timeout: ng.ITimeoutService, $scope: ng.IScope, cheNotification: any, cheOrganization: che.api.ICheOrganization, initData: {userId; userName}) { + constructor(cheProfile: CheProfile, + $location: ng.ILocationService, + $timeout: ng.ITimeoutService, + $scope: ng.IScope, + cheNotification: CheNotification, + cheOrganization: che.api.ICheOrganization, + initData: {userId; userName}) { this.cheOrganization = cheOrganization; this.$location = $location; this.cheProfile = cheProfile; diff --git a/dashboard/src/app/admin/user-management/user-management.controller.ts b/dashboard/src/app/admin/user-management/user-management.controller.ts index 3eb6c8fa46..a0e5c18d51 100644 --- a/dashboard/src/app/admin/user-management/user-management.controller.ts +++ b/dashboard/src/app/admin/user-management/user-management.controller.ts @@ -10,6 +10,10 @@ */ 'use strict'; +import {CheUser} from '../../../components/api/che-user.factory'; +import {CheNotification} from '../../../components/notification/che-notification.factory'; +import {ConfirmDialogService} from '../../../components/service/confirm-dialog/confirm-dialog.service'; + const MAX_ITEMS = 12; /** @@ -21,16 +25,16 @@ export class AdminsUserManagementCtrl { $log: ng.ILogService; $mdDialog: ng.material.IDialogService; $location: ng.ILocationService; - cheUser: any; - cheNotification: any; + cheUser: CheUser; + cheNotification: CheNotification; pagesInfo: any; - users: Array; - usersMap: Map; + users: Array; + usersMap: Map; userFilter: {name: string}; userOrderBy: string; isLoading: boolean; - private confirmDialogService: any; + private confirmDialogService: ConfirmDialogService; private cheOrganization: che.api.ICheOrganization; private userOrganizationCount: {[userId: string]: number} = {}; private cheListHelper: che.widget.ICheListHelper; @@ -43,10 +47,10 @@ export class AdminsUserManagementCtrl { $rootScope: che.IRootScopeService, $log: ng.ILogService, $mdDialog: ng.material.IDialogService, - cheUser: any, + cheUser: CheUser, $location: ng.ILocationService, - cheNotification: any, - confirmDialogService: any, + cheNotification: CheNotification, + confirmDialogService: ConfirmDialogService, cheOrganization: che.api.ICheOrganization, $scope: ng.IScope, cheListHelperFactory: che.widget.ICheListHelperFactory) { diff --git a/dashboard/src/app/administration/administration-config.ts b/dashboard/src/app/administration/administration-config.ts index 887ad2e1d6..32f6b52ca4 100644 --- a/dashboard/src/app/administration/administration-config.ts +++ b/dashboard/src/app/administration/administration-config.ts @@ -25,7 +25,7 @@ export class AdministrationConfig { register.controller('EditRegistryController', EditRegistryController); // config routes - register.app.config(($routeProvider: ng.route.IRouteProvider) => { + register.app.config(($routeProvider: che.route.IRouteProvider) => { $routeProvider.accessWhen('/administration', { title: 'Administration', templateUrl: 'app/administration/administration.html' diff --git a/dashboard/src/app/administration/docker-registry/docker-registry-list/docker-registry-list.directive.ts b/dashboard/src/app/administration/docker-registry/docker-registry-list/docker-registry-list.directive.ts index e1894a1322..e0e52faa7d 100644 --- a/dashboard/src/app/administration/docker-registry/docker-registry-list/docker-registry-list.directive.ts +++ b/dashboard/src/app/administration/docker-registry/docker-registry-list/docker-registry-list.directive.ts @@ -24,24 +24,17 @@ * * @author Oleksii Orel */ -export class DockerRegistryList { +export class DockerRegistryList implements ng.IDirective { - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor() { - this.restrict = 'E'; - this.templateUrl = 'app/administration/docker-registry/docker-registry-list/docker-registry-list.html'; - this.replace = false; + restrict = 'E'; + templateUrl = 'app/administration/docker-registry/docker-registry-list/docker-registry-list.html'; + replace = false; - this.controller = 'DockerRegistryListController'; - this.controllerAs = 'dockerRegistryListController'; + controller = 'DockerRegistryListController'; + controllerAs = 'dockerRegistryListController'; - this.bindToController = true; + bindToController = true; - this.scope = true; - - } + scope = true; } diff --git a/dashboard/src/app/colors/che-color.constant.ts b/dashboard/src/app/colors/che-color.constant.ts index dc477f19bc..ffe4bd0ef8 100644 --- a/dashboard/src/app/colors/che-color.constant.ts +++ b/dashboard/src/app/colors/che-color.constant.ts @@ -12,8 +12,8 @@ export class CheColorsConfig { - constructor(register) { - // Register this factory + constructor(register: che.IRegisterService) { + // register this factory register.app.constant('jsonColors', JSON.stringify({ '$che-navy-color': '#353E50', '$che-medium-blue-color': '#4A90E2', diff --git a/dashboard/src/app/colors/che-color.constant.ts.template b/dashboard/src/app/colors/che-color.constant.ts.template index 4069da463f..0f941cbdb4 100644 --- a/dashboard/src/app/colors/che-color.constant.ts.template +++ b/dashboard/src/app/colors/che-color.constant.ts.template @@ -12,8 +12,8 @@ export class CheColorsConfig { - constructor(register) { - // Register this factory + constructor(register: che.IRegisterService) { + // register this factory register.app.constant('jsonColors', JSON.stringify(%CONTENT%)); } diff --git a/dashboard/src/app/colors/che-output-colors.constant.ts.template b/dashboard/src/app/colors/che-output-colors.constant.ts.template index d1587432db..d36ce8e595 100644 --- a/dashboard/src/app/colors/che-output-colors.constant.ts.template +++ b/dashboard/src/app/colors/che-output-colors.constant.ts.template @@ -12,8 +12,8 @@ export class CheOutputColorsConfig { - constructor(register) { - // Register this factory + constructor(register: che.IRegisterService) { + // register this factory register.app.constant('jsonOutputColors', JSON.stringify(%CONTENT%)); } } diff --git a/dashboard/src/app/constants/che-jobs.constant.ts b/dashboard/src/app/constants/che-jobs.constant.ts index ad343db3d8..b55cf2cf0c 100644 --- a/dashboard/src/app/constants/che-jobs.constant.ts +++ b/dashboard/src/app/constants/che-jobs.constant.ts @@ -15,36 +15,36 @@ */ export class CheJobsConfig { - constructor(register) { - // Register this factory - register.app.constant('jsonJobs', JSON.stringify([{ - name: 'Architect' - }, { - name: 'Team Lead' - }, { - name: 'DevOps' - }, { - name: 'Developer' - }, { - name: 'System Administrator' - }, { - name: 'Manager' - }, { - name: 'Director' - }, { - name: 'VP' - }, { - name: 'C-Level' - }, { - name: 'Freelance' - }, { - name: 'Educator' - }, { - name: 'Student' - }, { - name: 'Hobbyist' - }] - )); + constructor(register: che.IRegisterService) { + // register this factory + register.app.constant('jsonJobs', JSON.stringify([{ + name: 'Architect' + }, { + name: 'Team Lead' + }, { + name: 'DevOps' + }, { + name: 'Developer' + }, { + name: 'System Administrator' + }, { + name: 'Manager' + }, { + name: 'Director' + }, { + name: 'VP' + }, { + name: 'C-Level' + }, { + name: 'Freelance' + }, { + name: 'Educator' + }, { + name: 'Student' + }, { + name: 'Hobbyist' + }] + )); - } + } } diff --git a/dashboard/src/app/dashboard/dashboard-config.ts b/dashboard/src/app/dashboard/dashboard-config.ts index 9cf6cb9c7b..689309cfe7 100644 --- a/dashboard/src/app/dashboard/dashboard-config.ts +++ b/dashboard/src/app/dashboard/dashboard-config.ts @@ -13,7 +13,6 @@ import {DashboardLastWorkspacesController} from './last-workspaces/last-workspaces.controller'; import {DashboardLastWorkspaces} from './last-workspaces/last-workspaces.directive'; import {DashboardPanel} from './dashboard-panel/dashboard-panel.directive'; -import {CheService} from '../../components/api/che-service.factory'; import {CheWorkspace} from '../../components/api/workspace/che-workspace.factory'; export class DashboardConfig { @@ -33,7 +32,7 @@ export class DashboardConfig { title: 'Dashboard', templateUrl: 'app/dashboard/dashboard.html', resolve: { - check: ['$q', '$location', 'cheWorkspace', 'cheService', ($q: ng.IQService, $location: ng.ILocationService, cheWorkspace: CheWorkspace, cheService: CheService) => { + check: ['$q', '$location', 'cheWorkspace', ($q: ng.IQService, $location: ng.ILocationService, cheWorkspace: CheWorkspace) => { cheWorkspace.fetchWorkspaces().then(() => { if (cheWorkspace.getWorkspaces().length === 0) { $location.path('/create-workspace'); @@ -46,8 +45,7 @@ export class DashboardConfig { }] } }); - }) - ; + }); } } diff --git a/dashboard/src/app/dashboard/dashboard-panel/dashboard-panel.directive.ts b/dashboard/src/app/dashboard/dashboard-panel/dashboard-panel.directive.ts index d36876823a..96ec8459b4 100644 --- a/dashboard/src/app/dashboard/dashboard-panel/dashboard-panel.directive.ts +++ b/dashboard/src/app/dashboard/dashboard-panel/dashboard-panel.directive.ts @@ -16,29 +16,23 @@ * @description This class is handling the directive of the panel for displaying dashboard entries. * @author Oleksii Kurinnyi */ -export class DashboardPanel { +export class DashboardPanel implements ng.IDirective { - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor() { - this.restrict = 'E'; - this.transclude = true; - this.replace = true; - } + restrict = 'E'; + transclude = true; + replace = true; /** * Template for the panel - * @param element - * @param attrs + * @param $element + * @param $attrs * @returns {string} the template */ - template(element, attrs) { + template($element: ng.IAugmentedJQuery, $attrs: ng.IAttributes): string { return '' + '
' + '
' - + '' + attrs.panelTitle + '' + + '' + ($attrs as any).panelTitle + '' + '
' + '
' + '' diff --git a/dashboard/src/app/dashboard/last-workspaces/last-workspaces.directive.ts b/dashboard/src/app/dashboard/last-workspaces/last-workspaces.directive.ts index 948b93ce77..efa3baa19c 100644 --- a/dashboard/src/app/dashboard/last-workspaces/last-workspaces.directive.ts +++ b/dashboard/src/app/dashboard/last-workspaces/last-workspaces.directive.ts @@ -16,20 +16,13 @@ * @description This class is handling the directive of the listing last opened workspaces in the dashboard * @author Oleksii Orel */ -export class DashboardLastWorkspaces { +export class DashboardLastWorkspaces implements ng.IDirective { + restrict = 'E'; + templateUrl = 'app/dashboard/last-workspaces/last-workspaces.html'; - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor() { - this.restrict = 'E'; - this.templateUrl = 'app/dashboard/last-workspaces/last-workspaces.html'; - - this.controller = 'DashboardLastWorkspacesController'; - this.controllerAs = 'dashboardLastWorkspacesController'; - this.bindToController = true; - } + controller = 'DashboardLastWorkspacesController'; + controllerAs = 'dashboardLastWorkspacesController'; + bindToController = true; } diff --git a/dashboard/src/app/diagnostics/diagnostics.directive.ts b/dashboard/src/app/diagnostics/diagnostics.directive.ts index 1c5a8ab181..0a1e3e1b9c 100644 --- a/dashboard/src/app/diagnostics/diagnostics.directive.ts +++ b/dashboard/src/app/diagnostics/diagnostics.directive.ts @@ -24,7 +24,7 @@ * * @author Florent Benoit */ -export class Diagnostics { +export class Diagnostics implements ng.IDirective { replace: boolean = false; restrict: string = 'E'; diff --git a/dashboard/src/app/factories/create-factory/action/factory-action-box.directive.ts b/dashboard/src/app/factories/create-factory/action/factory-action-box.directive.ts index 0c8470e66b..4feb0032ce 100644 --- a/dashboard/src/app/factories/create-factory/action/factory-action-box.directive.ts +++ b/dashboard/src/app/factories/create-factory/action/factory-action-box.directive.ts @@ -14,15 +14,15 @@ * Defines a directive for displaying action box. * @author Florent Benoit */ -export class FactoryActionBox { - private restrict: string; - private templateUrl: string; - private replace: boolean; - private controller: string; - private controllerAs: string; - private bindToController: boolean; +export class FactoryActionBox implements ng.IDirective { + restrict: string; + templateUrl: string; + replace: boolean; + controller: string; + controllerAs: string; + bindToController: boolean; - private scope: { + scope: { [propName: string]: string; }; diff --git a/dashboard/src/app/factories/create-factory/command/factory-command.directive.ts b/dashboard/src/app/factories/create-factory/command/factory-command.directive.ts index bb2a31cb18..c2e0090bff 100644 --- a/dashboard/src/app/factories/create-factory/command/factory-command.directive.ts +++ b/dashboard/src/app/factories/create-factory/command/factory-command.directive.ts @@ -14,15 +14,15 @@ * Defines a directive for displaying factory commands. * @author Florent Benoit */ -export class FactoryCommand { - private restrict: string; - private templateUrl: string; - private replace: boolean; - private controller: string; - private controllerAs: string; - private bindToController: boolean; +export class FactoryCommand implements ng.IDirective { + restrict: string; + templateUrl: string; + replace: boolean; + controller: string; + controllerAs: string; + bindToController: boolean; - private scope: { + scope: { [propName: string]: string; }; diff --git a/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.controller.ts b/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.controller.ts index f8135ca457..1eb9c2dde6 100644 --- a/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.controller.ts +++ b/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.controller.ts @@ -51,7 +51,7 @@ export class FactoryFromFileCtrl { this.isImporting = this.uploader.isUploading; - var ctrl = this; + const ctrl = this; // filters this.uploader.filters.push({ diff --git a/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.directive.ts b/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.directive.ts index 75e0e9b824..66142afcc1 100644 --- a/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.directive.ts +++ b/dashboard/src/app/factories/create-factory/config-file-tab/factory-from-file.directive.ts @@ -18,15 +18,15 @@ interface IFactoryFromFileScope extends ng.IScope { * Defines a directive for configuring factory from file. * @author Oleksii Orel */ -export class FactoryFromFile { - private restrict: string; - private templateUrl: string; - private replace: boolean; - private controller: string; - private controllerAs: string; - private bindToController: boolean; +export class FactoryFromFile implements ng.IDirective { + restrict: string; + templateUrl: string; + replace: boolean; + controller: string; + controllerAs: string; + bindToController: boolean; - private scope: { + scope: { [propName: string]: string; }; diff --git a/dashboard/src/app/factories/create-factory/create-factory-config.ts b/dashboard/src/app/factories/create-factory/create-factory-config.ts index 907fb27da7..e70b4566d9 100644 --- a/dashboard/src/app/factories/create-factory/create-factory-config.ts +++ b/dashboard/src/app/factories/create-factory/create-factory-config.ts @@ -58,7 +58,7 @@ export class CreateFactoryConfig { // config routes - register.app.config(($routeProvider: any) => { + register.app.config(($routeProvider: che.route.IRouteProvider) => { $routeProvider.accessWhen('/factories/create-factory', { title: 'New Factory', templateUrl: 'app/factories/create-factory/create-factory.html', diff --git a/dashboard/src/app/factories/create-factory/create-factory.controller.ts b/dashboard/src/app/factories/create-factory/create-factory.controller.ts index 24b0595290..d53ed07801 100644 --- a/dashboard/src/app/factories/create-factory/create-factory.controller.ts +++ b/dashboard/src/app/factories/create-factory/create-factory.controller.ts @@ -43,7 +43,14 @@ export class CreateFactoryCtrl { * Default constructor that is using resource injection * @ngInject for Dependency injection */ - constructor($location: ng.ILocationService, cheAPI: CheAPI, $log: ng.ILogService, cheNotification: CheNotification, $scope: ng.IScope, $filter: ng.IFilterService, lodash: any, $document: ng.IDocumentService) { + constructor($location: ng.ILocationService, + cheAPI: CheAPI, + $log: ng.ILogService, + cheNotification: CheNotification, + $scope: ng.IScope, + $filter: ng.IFilterService, + lodash: any, + $document: ng.IDocumentService) { this.$location = $location; this.cheAPI = cheAPI; this.$log = $log; diff --git a/dashboard/src/app/factories/create-factory/git/create-factory-git.directive.ts b/dashboard/src/app/factories/create-factory/git/create-factory-git.directive.ts index 095d1fe848..6526da3ba7 100644 --- a/dashboard/src/app/factories/create-factory/git/create-factory-git.directive.ts +++ b/dashboard/src/app/factories/create-factory/git/create-factory-git.directive.ts @@ -14,14 +14,14 @@ * Defines a directive for creating factory from git. * @author Florent Benoit */ -export class CreateFactoryGit { - private restrict: string; - private templateUrl: string; - private controller: string; - private controllerAs: string; - private bindToController: boolean; +export class CreateFactoryGit implements ng.IDirective { + restrict: string; + templateUrl: string; + controller: string; + controllerAs: string; + bindToController: boolean; - private scope: { + scope: { [propName: string]: string; }; diff --git a/dashboard/src/app/factories/create-factory/template-tab/factory-from-template.directive.ts b/dashboard/src/app/factories/create-factory/template-tab/factory-from-template.directive.ts index 937a8fee06..be78c367f8 100644 --- a/dashboard/src/app/factories/create-factory/template-tab/factory-from-template.directive.ts +++ b/dashboard/src/app/factories/create-factory/template-tab/factory-from-template.directive.ts @@ -14,15 +14,15 @@ * Defines a directive for displaying factory from template widget. * @author Oleksii Orel */ -export class FactoryFromTemplate { - private restrict: string; - private templateUrl: string; - private controller: string; - private controllerAs: string; - private bindToController: boolean; - private replace: boolean; +export class FactoryFromTemplate implements ng.IDirective { + restrict: string; + templateUrl: string; + controller: string; + controllerAs: string; + bindToController: boolean; + replace: boolean; - private scope: { + scope: { [propName: string]: string; }; diff --git a/dashboard/src/app/factories/factories-config.ts b/dashboard/src/app/factories/factories-config.ts index db5eac2c9f..aa891b0b2d 100644 --- a/dashboard/src/app/factories/factories-config.ts +++ b/dashboard/src/app/factories/factories-config.ts @@ -32,7 +32,7 @@ export class FactoryConfig { register.service('loadFactoryService', LoadFactoryService); // config routes - register.app.config(function ($routeProvider) { + register.app.config(function ($routeProvider: che.route.IRouteProvider) { $routeProvider.accessWhen('/factories', { title: 'Factories', templateUrl: 'app/factories/list-factories/list-factories.html', @@ -55,9 +55,11 @@ export class FactoryConfig { }); // config files + /* tslint:disable */ new FactoryDetailsConfig(register); new CreateFactoryConfig(register); new LastFactoriesConfig(register); + /* tslint:enable */ } } diff --git a/dashboard/src/app/factories/factory-details/factory-details-config.ts b/dashboard/src/app/factories/factory-details/factory-details-config.ts index da14d977b4..b8bfe0b6ba 100644 --- a/dashboard/src/app/factories/factory-details/factory-details-config.ts +++ b/dashboard/src/app/factories/factory-details/factory-details-config.ts @@ -20,7 +20,7 @@ export class FactoryDetailsConfig { register.controller('FactoryDetailsController', FactoryDetailsController); // config routes - register.app.config(($routeProvider: any) => { + register.app.config(($routeProvider: che.route.IRouteProvider) => { let locationProvider = { title: 'Factory', templateUrl: 'app/factories/factory-details/factory-details.html', @@ -34,6 +34,8 @@ export class FactoryDetailsConfig { }); // config files + /* tslint:disable */ new InformationTabConfig(register); + /* tslint:enable */ } } diff --git a/dashboard/src/app/factories/factory-details/factory-details.controller.ts b/dashboard/src/app/factories/factory-details/factory-details.controller.ts index 16a89d5286..5c4daa1096 100644 --- a/dashboard/src/app/factories/factory-details/factory-details.controller.ts +++ b/dashboard/src/app/factories/factory-details/factory-details.controller.ts @@ -25,7 +25,9 @@ export class FactoryDetailsController { * @ngInject for Dependency injection */ constructor($route: ng.route.IRouteService, cheFactory: CheFactory, cheNotification: CheNotification) { + /* tslint:disable */ 'ngInject'; + /* tslint:enable */ this.cheFactory = cheFactory; let factoryId = $route.current.params.id; diff --git a/dashboard/src/app/factories/factory-details/information-tab/factory-information/factory-information.controller.ts b/dashboard/src/app/factories/factory-details/information-tab/factory-information/factory-information.controller.ts index 9d51275c47..87b6fd46ea 100644 --- a/dashboard/src/app/factories/factory-details/information-tab/factory-information/factory-information.controller.ts +++ b/dashboard/src/app/factories/factory-details/information-tab/factory-information/factory-information.controller.ts @@ -37,7 +37,7 @@ export class FactoryInformationController { private factory: che.IFactory; private copyOriginFactory: che.IFactory; private factoryContent: string; - private workspaceImportedRecipe: any; + // private workspaceImportedRecipe: any; private environmentName: string; private workspaceName: string; private stackId: string; @@ -49,8 +49,16 @@ export class FactoryInformationController { * Default constructor that is using resource injection * @ngInject for Dependency injection */ - constructor($scope: ng.IScope, cheAPI: CheAPI, cheNotification: CheNotification, $location: ng.ILocationService, $log: ng.ILogService, - $timeout: ng.ITimeoutService, lodash: any, $filter: ng.IFilterService, $q: ng.IQService, confirmDialogService: ConfirmDialogService) { + constructor($scope: ng.IScope, + cheAPI: CheAPI, + cheNotification: CheNotification, + $location: ng.ILocationService, + $log: ng.ILogService, + $timeout: ng.ITimeoutService, + lodash: any, + $filter: ng.IFilterService, + $q: ng.IQService, + confirmDialogService: ConfirmDialogService) { this.cheAPI = cheAPI; this.cheNotification = cheNotification; this.$location = $location; diff --git a/dashboard/src/app/factories/last-factories/last-factories.directive.ts b/dashboard/src/app/factories/last-factories/last-factories.directive.ts index a129d684c9..4ae4f18395 100644 --- a/dashboard/src/app/factories/last-factories/last-factories.directive.ts +++ b/dashboard/src/app/factories/last-factories/last-factories.directive.ts @@ -16,13 +16,13 @@ * @description This class is handling the directive of the listing last opened factories * @author Oleksii Orel */ -export class LastFactories { - private restrict: string; - private templateUrl: string; - private replace: boolean; - private controller: string; - private controllerAs: string; - private bindToController: boolean; +export class LastFactories implements ng.IDirective { + restrict: string; + templateUrl: string; + replace: boolean; + controller: string; + controllerAs: string; + bindToController: boolean; /** * Default constructor that is using resource diff --git a/dashboard/src/app/factories/list-factories/factory-item/factory-item.controller.ts b/dashboard/src/app/factories/list-factories/factory-item/factory-item.controller.ts index ec736dc1ef..958fb334cc 100644 --- a/dashboard/src/app/factories/list-factories/factory-item/factory-item.controller.ts +++ b/dashboard/src/app/factories/list-factories/factory-item/factory-item.controller.ts @@ -20,14 +20,17 @@ export class FactoryItemController { private $location: ng.ILocationService; private cheFactory: CheFactory; private cheEnvironmentRegistry: CheEnvironmentRegistry; - private lodash: _.LoDashStatic; + private lodash: any; private factory: che.IFactory; /** * Default constructor that is using resource injection * @ngInject for Dependency injection */ - constructor($location: ng.ILocationService, cheFactory: CheFactory, cheEnvironmentRegistry: CheEnvironmentRegistry, lodash: _.LoDashStatic) { + constructor($location: ng.ILocationService, + cheFactory: CheFactory, + cheEnvironmentRegistry: CheEnvironmentRegistry, + lodash: any) { this.$location = $location; this.cheFactory = cheFactory; this.cheEnvironmentRegistry = cheEnvironmentRegistry; diff --git a/dashboard/src/app/factories/list-factories/factory-item/factory-item.directive.ts b/dashboard/src/app/factories/list-factories/factory-item/factory-item.directive.ts index 7213df6fac..7fe88ae910 100644 --- a/dashboard/src/app/factories/list-factories/factory-item/factory-item.directive.ts +++ b/dashboard/src/app/factories/list-factories/factory-item/factory-item.directive.ts @@ -14,7 +14,7 @@ * Defines a directive for factory item in list. * @author Oleksii Orel */ -export class CheFactoryItem { +export class CheFactoryItem implements ng.IDirective { restrict: string = 'E'; templateUrl: string = 'app/factories/list-factories/factory-item/factory-item.html'; diff --git a/dashboard/src/app/factories/load-factory/load-factory.controller.ts b/dashboard/src/app/factories/load-factory/load-factory.controller.ts index 14365011b4..5f9b2bf1d5 100644 --- a/dashboard/src/app/factories/load-factory/load-factory.controller.ts +++ b/dashboard/src/app/factories/load-factory/load-factory.controller.ts @@ -16,7 +16,7 @@ import {RouteHistory} from '../../../components/routing/route-history.service'; import {CheJsonRpcApi} from '../../../components/api/json-rpc/che-json-rpc-api.factory'; import {CheJsonRpcMasterApi} from '../../../components/api/json-rpc/che-json-rpc-master-api'; -const WS_AGENT_STEP: number = 3 +const WS_AGENT_STEP: number = 3; /** * This class is handling the controller for the factory loading. @@ -27,7 +27,7 @@ export class LoadFactoryController { private $timeout: ng.ITimeoutService; private $mdDialog: ng.material.IDialogService; private loadFactoryService: LoadFactoryService; - private lodash: _.LoDashStatic; + private lodash: any; private cheNotification: CheNotification; private $location: ng.ILocationService; private routeHistory: RouteHistory; @@ -46,9 +46,17 @@ export class LoadFactoryController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor(cheAPI: CheAPI, cheJsonRpcApi: CheJsonRpcApi, $route: ng.route.IRouteService, $timeout: ng.ITimeoutService, - $mdDialog: ng.material.IDialogService, loadFactoryService: LoadFactoryService, lodash: _.LoDashStatic, cheNotification: CheNotification, - $location: ng.ILocationService, routeHistory: RouteHistory, $window: ng.IWindowService) { + constructor(cheAPI: CheAPI, + cheJsonRpcApi: CheJsonRpcApi, + $route: ng.route.IRouteService, + $timeout: ng.ITimeoutService, + $mdDialog: ng.material.IDialogService, + loadFactoryService: LoadFactoryService, + lodash: any, + cheNotification: CheNotification, + $location: ng.ILocationService, + routeHistory: RouteHistory, + $window: ng.IWindowService) { this.cheAPI = cheAPI; this.$timeout = $timeout; this.$mdDialog = $mdDialog; @@ -60,7 +68,7 @@ export class LoadFactoryController { this.$window = $window; this.workspaces = []; - this.workspace = {}; + this.workspace = {} as che.IWorkspace; this.hideMenuAndFooter(); this.jsonRpcMasterApi = cheJsonRpcApi.getJsonRpcMasterApi(cheAPI.getWorkspace().getJsonRpcApiLocation()); @@ -202,11 +210,11 @@ export class LoadFactoryController { */ getWorkspaceToStart(): void { let createPolicy = (this.factory.policies) ? this.factory.policies.create : 'perClick'; - var workspace = null; + let workspace = null; switch (createPolicy) { case 'perUser' : workspace = this.lodash.find(this.workspaces, (w: che.IWorkspace) => { - return this.factory.id === w.attributes.factoryId; + return this.factory.id === (w.attributes as any).factoryId; }); break; case 'perAccount' : @@ -465,7 +473,7 @@ export class LoadFactoryController { detectProjectsToImport(projects: Array): void { this.projectsToImport = 0; - projects.forEach((project: che.IProject) => { + projects.forEach((project: che.IProjectTemplate) => { if (!this.isProjectOnFileSystem(project)) { this.projectsToImport++; this.importProject(this.workspace.id, project); @@ -480,7 +488,7 @@ export class LoadFactoryController { /** * Project is on file system if there is no errors except code=9. */ - isProjectOnFileSystem(project: che.IProject): boolean { + isProjectOnFileSystem(project: che.IProjectTemplate): boolean { let problems = project.problems; if (!problems || problems.length === 0) { return true; @@ -557,7 +565,7 @@ export class LoadFactoryController { } else { // add every factory parameter by prefix Object.keys(this.routeParams).forEach((key: string) => { - ideParams.push('factory-' + key + ':' + this.$window.encodeURIComponent(this.routeParams[key])); + ideParams.push('factory-' + key + ':' + (this.$window as any).encodeURIComponent(this.routeParams[key])); }); } @@ -658,7 +666,7 @@ export class LoadFactoryController { */ downloadLogs(): void { let logs = ''; - this.getLoadingSteps().forEach((step) => { + this.getLoadingSteps().forEach((step: any) => { logs += step.logs + '\n'; }); window.open('data:text/csv,' + encodeURIComponent(logs)); diff --git a/dashboard/src/app/factories/load-factory/load-factory.service.ts b/dashboard/src/app/factories/load-factory/load-factory.service.ts index 47d1dac71d..86192dfd8f 100644 --- a/dashboard/src/app/factories/load-factory/load-factory.service.ts +++ b/dashboard/src/app/factories/load-factory/load-factory.service.ts @@ -90,7 +90,7 @@ export class LoadFactoryService { * Reset the loading progress. */ resetLoadProgress(): void { - this.loadingSteps.forEach((step) => { + this.loadingSteps.forEach((step: any) => { step.logs = ''; step.hasError = false; }); diff --git a/dashboard/src/app/navbar/navbar-dropdown-menu/navbar-dropdown-menu.directive.ts b/dashboard/src/app/navbar/navbar-dropdown-menu/navbar-dropdown-menu.directive.ts index 54b51621d6..76592b1358 100644 --- a/dashboard/src/app/navbar/navbar-dropdown-menu/navbar-dropdown-menu.directive.ts +++ b/dashboard/src/app/navbar/navbar-dropdown-menu/navbar-dropdown-menu.directive.ts @@ -10,6 +10,14 @@ */ 'use strict'; +interface IDropdonwMenuAttributes extends ng.IAttributes { + navbarDropdownRightClick: any; +} + +interface IDropdonwMenuRootScope extends ng.IRootScopeService { + navbarDropdownActiveMenu: HTMLElement; +} + /** * @ngDoc directive * @name navbar.directive:NavbarDropdownMenu @@ -28,7 +36,7 @@ export class NavbarDropdownMenu implements ng.IDirective { /** * Root scope service. */ - $rootScope: ng.IRootScopeService; + $rootScope: IDropdonwMenuRootScope; restrict: string = 'E'; bindToController: boolean = true; @@ -54,118 +62,121 @@ export class NavbarDropdownMenu implements ng.IDirective { */ constructor($timeout: ng.ITimeoutService, $document: ng.IDocumentService, - $rootScope: ng.IRootScopeService) { + $rootScope: IDropdonwMenuRootScope) { this.$timeout = $timeout; this.$document = $document; this.$rootScope = $rootScope; } - compile($element, attrs) { + compile($element: ng.IAugmentedJQuery, $attrs: IDropdonwMenuAttributes): ng.IDirectivePrePost { let jqButton = $element.find('[ng-transclude]'); - if (angular.isDefined(attrs['navbarDropdownRightClick'])) { + if (angular.isDefined($attrs.navbarDropdownRightClick)) { jqButton.attr('ng-click', ''); jqButton.attr('che-on-right-click', '$mdOpenMenu($event)'); } else { jqButton.attr('ng-click', '$mdOpenMenu($event)'); } + + return {}; } - link($scope, $element) { + link($scope: ng.IScope, $element: ng.IAugmentedJQuery): void { // store active menu element in rootScope let menuContentEl = $element.find('.navbar-dropdown-menu'), menuEl = $element.find('md-menu'); $scope.$watch(() => { return menuContentEl.is(':visible'); - }, (visible) => { + }, (visible: boolean) => { if (visible) { this.$rootScope.navbarDropdownActiveMenu = menuEl[0]; } }); let self = this; - this.$document.off('.dropdown-menu') - .on('mousedown.dropdown-menu contextmenu.dropdown-menu', '.md-menu-backdrop', (e) => { - let eventType = e.type, - eventWhich = e.which, - backdropEl = angular.element(e.target); + this.$document + .off('.dropdown-menu') + .on('mousedown.dropdown-menu contextmenu.dropdown-menu', '.md-menu-backdrop', (e: JQueryEventObject) => { + let eventType = e.type, + eventWhich = e.which, + backdropEl = angular.element(e.target); - if (eventType === 'mousedown') { - if (eventWhich === 3) { - // prevent event propagation for right mousedown - // and wait for contextmenu event - e.preventDefault(); - e.stopPropagation(); - return false; - } else { - eventType = 'click'; - } - } - - var x = e.clientX, - y = e.clientY, - stack = []; - let elementMouseIsOver = self.$document[0].elementFromPoint(x, y); - elementMouseIsOver.style.pointerEvents = 'none'; - stack.push(elementMouseIsOver); - - // iterate elements under cursor - let limit = 50, - nextTargetEl; - while (elementMouseIsOver && elementMouseIsOver.tagName !== 'BODY' && elementMouseIsOver.tagName !== 'MD-MENU' && limit > 0){ - elementMouseIsOver = self.$document[0].elementFromPoint(x, y); - - // break when top of tree is reached - if (stack[stack.length-1] === elementMouseIsOver) { - break; - } - - let curEl = angular.element(elementMouseIsOver); - - // element to trigger event - if (!nextTargetEl) { - nextTargetEl = curEl; + if (eventType === 'mousedown') { + if (eventWhich === 3) { + // prevent event propagation for right mousedown + // and wait for contextmenu event + e.preventDefault(); + e.stopPropagation(); + return false; + } else { + eventType = 'click'; + } } + const x = e.clientX, + y = e.clientY, + stack = []; + let elementMouseIsOver = (self.$document[0] as any).elementFromPoint(x, y); elementMouseIsOver.style.pointerEvents = 'none'; stack.push(elementMouseIsOver); - limit--; - } + // iterate elements under cursor + let limit = 50, + nextTargetEl; + while (elementMouseIsOver && elementMouseIsOver.tagName !== 'BODY' && elementMouseIsOver.tagName !== 'MD-MENU' && limit > 0) { + elementMouseIsOver = (self.$document[0] as any).elementFromPoint(x, y); - // click on menu's backdrop to hide menu - backdropEl.triggerHandler('click'); + // break when top of tree is reached + if (stack[stack.length - 1] === elementMouseIsOver) { + break; + } - if (elementMouseIsOver && elementMouseIsOver.tagName === 'MD-MENU') { - // if menu is found then - // check if click is caught over the same menu - if(elementMouseIsOver === this.$rootScope.navbarDropdownActiveMenu) { - // clear active menu - delete this.$rootScope.navbarDropdownActiveMenu; + let curEl = angular.element(elementMouseIsOver); + + // element to trigger event + if (!nextTargetEl) { + nextTargetEl = curEl; + } + + elementMouseIsOver.style.pointerEvents = 'none'; + stack.push(elementMouseIsOver); + + limit--; + } + + // click on menu's backdrop to hide menu + backdropEl.triggerHandler('click'); + + if (elementMouseIsOver && elementMouseIsOver.tagName === 'MD-MENU') { + // if menu is found then + // check if click is caught over the same menu + if (elementMouseIsOver === this.$rootScope.navbarDropdownActiveMenu) { + // clear active menu + delete this.$rootScope.navbarDropdownActiveMenu; + } else { + // open new menu by triggering mouse event + angular.element(nextTargetEl).trigger({ + type: eventType, + which: eventWhich + } as JQueryEventObject); + } } else { - // open new menu by triggering mouse event + // if menu isn't found + // just trigger same mouse event on first found element angular.element(nextTargetEl).trigger({ type: eventType, which: eventWhich - }); + } as JQueryEventObject); } - } else { - // if menu isn't found - // just trigger same mouse event on first found element - angular.element(nextTargetEl).trigger({ - type: eventType, - which: eventWhich - }); - } - // clean pointer events - for (let i=0; i { // if there is a previous selected element, unselect it if (this.$rootScope.selectedNavBarElement) { @@ -60,40 +59,40 @@ export class NavBarSelected implements ng.IDirective { }; // highlight item at start - if (attrs.href === '#' + this.$location.path()) { - select(element); + if ($attrs.href === '#' + this.$location.path()) { + select($element); } // highlight item on click - element.bind('click', (event: JQueryEventObject) => { + $element.bind('click', (event: JQueryEventObject) => { // prevent activating menu item if Ctrl key is pressed if (event.ctrlKey) { this.$rootScope.selectedNavBarElement.focus(); return; } - select(element); + select($element); }); - element.bind('mousedown', () => { - element.addClass('navbar-item-no-hover'); + $element.bind('mousedown', () => { + $element.addClass('navbar-item-no-hover'); }); - element.bind('mouseup', () => { - if (element !== this.$rootScope.selectedNavBarElement) { - element.blur(); + $element.bind('mouseup', () => { + if ($element !== this.$rootScope.selectedNavBarElement) { + $element.blur(); } }); - element.bind('mouseover', () => { - element.removeClass('navbar-item-no-hover'); + $element.bind('mouseover', () => { + $element.removeClass('navbar-item-no-hover'); }); $scope.$on('navbar-selected:set', (event: ng.IAngularEvent, path: string) => { // unselect previously selected item - if (this.$rootScope.selectedNavBarElement === element) { + if (this.$rootScope.selectedNavBarElement === $element) { this.$rootScope.selectedNavBarElement.removeClass('che-navbar-selected'); delete this.$rootScope.selectedNavBarElement; } // select item - if (attrs.href === path) { - select(element); + if ($attrs.href === path) { + select($element); } }); } diff --git a/dashboard/src/app/navbar/navbar.controller.ts b/dashboard/src/app/navbar/navbar.controller.ts index b8f369046f..fb98a581d4 100644 --- a/dashboard/src/app/navbar/navbar.controller.ts +++ b/dashboard/src/app/navbar/navbar.controller.ts @@ -14,7 +14,7 @@ import {CheKeycloak} from '../../components/api/che-keycloak.factory'; import {CheService} from '../../components/api/che-service.factory'; export class CheNavBarController { - private menuItemUrl = { + menuItemUrl = { dashboard: '#/', workspaces: '#/workspaces', administration: '#/administration', diff --git a/dashboard/src/app/navbar/navbar.directive.ts b/dashboard/src/app/navbar/navbar.directive.ts index 6864d8c00b..72479cc5c6 100644 --- a/dashboard/src/app/navbar/navbar.directive.ts +++ b/dashboard/src/app/navbar/navbar.directive.ts @@ -14,12 +14,12 @@ * Defines a directive for creating navbar. * @author Florent Benoit */ -export class CheNavBar { - private replace: boolean; - private restrict: string; - private templateUrl: string; - private controller: string; - private controllerAs: string; +export class CheNavBar implements ng.IDirective { + replace: boolean; + restrict: string; + templateUrl: string; + controller: string; + controllerAs: string; /** * Default constructor that is using resource diff --git a/dashboard/src/app/navbar/notification/navbar-notification.controller.ts b/dashboard/src/app/navbar/notification/navbar-notification.controller.ts index 81fce43e11..362cb636ae 100644 --- a/dashboard/src/app/navbar/notification/navbar-notification.controller.ts +++ b/dashboard/src/app/navbar/notification/navbar-notification.controller.ts @@ -26,7 +26,7 @@ export class NavbarNotificationController { */ constructor(applicationNotifications: ApplicationNotifications, $scope: ng.IScope) { this.applicationNotifications = applicationNotifications; - $scope.$on("$mdMenuClose", () => { + $scope.$on('$mdMenuClose', () => { this.removeReadNotifications(); }); } @@ -53,7 +53,7 @@ export class NavbarNotificationController { */ removeReadNotifications(): void { let notificationsToRemove = []; - let notifications = this.applicationNotifications.getNotifications() + let notifications = this.applicationNotifications.getNotifications(); notifications.forEach((notification: any) => { if (notification.removeOnRead) { notificationsToRemove.push(notification); diff --git a/dashboard/src/app/navbar/notification/navbar-notification.directive.ts b/dashboard/src/app/navbar/notification/navbar-notification.directive.ts index 2ed9373de3..9f0eeec810 100644 --- a/dashboard/src/app/navbar/notification/navbar-notification.directive.ts +++ b/dashboard/src/app/navbar/notification/navbar-notification.directive.ts @@ -16,21 +16,14 @@ * @description This class is handling the directive to handle the container with notifications * @author Ann Shumilova */ -export class NavbarNotification { +export class NavbarNotification implements ng.IDirective { - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor() { - this.restrict = 'E'; - this.bindToController = true; - this.templateUrl = 'app/navbar/notification/navbar-notification.html'; - this.controller = 'NavbarNotificationController'; - this.controllerAs = 'navbarNotificationController'; + restrict = 'E'; + bindToController = true; + templateUrl = 'app/navbar/notification/navbar-notification.html'; + controller = 'NavbarNotificationController'; + controllerAs = 'navbarNotificationController'; - this.transclude = true; - - } + transclude = true; } diff --git a/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.controller.spec.ts b/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.controller.spec.ts index fe76baafbd..4ec39763e0 100644 --- a/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.controller.spec.ts +++ b/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.controller.spec.ts @@ -14,8 +14,6 @@ import {CheAPIBuilder} from '../../../components/api/builder/che-api-builder.fac import {CheHttpBackend} from '../../../components/api/test/che-http-backend'; import IdeSvc from '../../ide/ide.service'; import {CheBranding} from '../../../components/branding/che-branding.factory'; -import {IWorkspaceAttributes} from '../../../components/api/builder/che-workspace-builder'; - /** * Test of the NavbarRecentWorkspacesController @@ -68,7 +66,7 @@ describe('NavbarRecentWorkspacesController', () => { let wrkspName = 'testName' + i; let wrkspCreateDate = new Date(2001, 1, 1, i, 1).toString(); let wrkspUpdateDate = new Date(2001, 1, 1, i, 2).toString(); - let wrkspAttr = {'created': Date.parse(wrkspCreateDate), 'updated': Date.parse(wrkspUpdateDate)} as IWorkspaceAttributes; + let wrkspAttr = {'created': Date.parse(wrkspCreateDate), 'updated': Date.parse(wrkspUpdateDate)}; let workspace = apiBuilder.getWorkspaceBuilder().withId(wrkspId).withAttributes(wrkspAttr).withName(wrkspName).build(); workspaces.push(workspace); } diff --git a/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.directive.ts b/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.directive.ts index 40b28a3263..6a6d962601 100644 --- a/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.directive.ts +++ b/dashboard/src/app/navbar/recent-workspaces/recent-workspaces.directive.ts @@ -16,7 +16,7 @@ * @description This class is handling the directive of the listing recent opened workspaces in the navbar * @author Oleksii Kurinnyi */ -export class NavbarRecentWorkspaces { +export class NavbarRecentWorkspaces implements ng.IDirective { restrict: string; templateUrl: string; controller: string; diff --git a/dashboard/src/app/organizations/organization-details/organization-select-members-dialog/organization-select-members-dialog.controller.ts b/dashboard/src/app/organizations/organization-details/organization-select-members-dialog/organization-select-members-dialog.controller.ts index e13a874d78..9b8623b106 100644 --- a/dashboard/src/app/organizations/organization-details/organization-select-members-dialog/organization-select-members-dialog.controller.ts +++ b/dashboard/src/app/organizations/organization-details/organization-select-members-dialog/organization-select-members-dialog.controller.ts @@ -57,10 +57,6 @@ export class OrganizationSelectMembersDialogController { * The list of users, that are available to be added */ private availableUsers: Array; - /** - * The list of users, that are going to be added - */ - private usersToAdd: Array; /** * Current user. */ @@ -122,7 +118,7 @@ export class OrganizationSelectMembersDialogController { map[member.id] = member; return map; }, {}); - this.availableUsers = this.parentOrganizationMembers.filter((parentOrganizationMember: che.IUser) => { + this.availableUsers = this.parentOrganizationMembers.filter((parentOrganizationMember: che.IUser) => { return !existingMembers[parentOrganizationMember.id] && parentOrganizationMember.id !== this.user.id; }); diff --git a/dashboard/src/app/profile/profile-config.ts b/dashboard/src/app/profile/profile-config.ts index 7dd682675d..650f068969 100644 --- a/dashboard/src/app/profile/profile-config.ts +++ b/dashboard/src/app/profile/profile-config.ts @@ -24,7 +24,7 @@ export class ProfileConfig { }; // config routes - register.app.config(function ($routeProvider) { + register.app.config(function ($routeProvider: che.route.IRouteProvider) { $routeProvider.accessWhen('/account', locationProvider); }); } diff --git a/dashboard/src/app/profile/profile.controller.ts b/dashboard/src/app/profile/profile.controller.ts index f954eb49b5..95e9d882af 100644 --- a/dashboard/src/app/profile/profile.controller.ts +++ b/dashboard/src/app/profile/profile.controller.ts @@ -33,10 +33,10 @@ export class ProfileController { this.profileUrl = cheKeycloak.getProfileUrl(); let profile = cheProfile.getProfile(); - this.firstName = profile.attributes['firstName']; - this.lastName = profile.attributes['lastName']; + this.firstName = profile.attributes.firstName; + this.lastName = profile.attributes.lastName; this.email = profile.email; - this.userName = profile.attributes['preferred_username']; + this.userName = (profile.attributes as any).preferred_username; } /** diff --git a/dashboard/src/app/proxy/proxy-settings.constant.ts.template b/dashboard/src/app/proxy/proxy-settings.constant.ts.template index 24e92de3d4..8b0de9ac13 100644 --- a/dashboard/src/app/proxy/proxy-settings.constant.ts.template +++ b/dashboard/src/app/proxy/proxy-settings.constant.ts.template @@ -12,8 +12,8 @@ export class ProxySettingsConfig { - constructor(register) { - // Register this factory + constructor(register: che.IRegisterService) { + // register this factory register.app.constant('proxySettings', '%CONTENT%'); } diff --git a/dashboard/src/app/stacks/list-stacks/build-stack/build-stack.controller.ts b/dashboard/src/app/stacks/list-stacks/build-stack/build-stack.controller.ts index 8661686c6c..692426a733 100644 --- a/dashboard/src/app/stacks/list-stacks/build-stack/build-stack.controller.ts +++ b/dashboard/src/app/stacks/list-stacks/build-stack/build-stack.controller.ts @@ -14,7 +14,6 @@ import {ImportStackService} from '../../stack-details/import-stack.service'; import {CheStack} from '../../../../components/api/che-stack.factory'; import {IEnvironmentManagerMachine} from '../../../../components/api/environment/environment-manager-machine'; import {CheBranding} from '../../../../components/branding/che-branding.factory'; -import {EnvironmentManager} from '../../../../components/api/environment/environment-manager'; import {CheRecipeTypes} from '../../../../components/api/recipe/che-recipe-types'; import {RecipeEditor} from './recipe-editor/recipe-editor'; import {CheWorkspace} from '../../../../components/api/workspace/che-workspace.factory'; @@ -68,7 +67,7 @@ export class BuildStackController { * It will hide the dialog box. */ cancel(): void { - this.importStackService.setStack({}); + this.importStackService.setStack({} as che.IStack); this.$mdDialog.cancel(); } diff --git a/dashboard/src/app/stacks/list-stacks/build-stack/recipe-editor/recipe-editor.ts b/dashboard/src/app/stacks/list-stacks/build-stack/recipe-editor/recipe-editor.ts index ed9fd63a52..a98c283b11 100644 --- a/dashboard/src/app/stacks/list-stacks/build-stack/recipe-editor/recipe-editor.ts +++ b/dashboard/src/app/stacks/list-stacks/build-stack/recipe-editor/recipe-editor.ts @@ -11,7 +11,6 @@ 'use strict'; import {EnvironmentManager} from '../../../../../components/api/environment/environment-manager'; -import {CheRecipeTypes} from '../../../../../components/api/recipe/che-recipe-types'; export class RecipeEditor { diff --git a/dashboard/src/app/stacks/list-stacks/stack-item/stack-item.controller.ts b/dashboard/src/app/stacks/list-stacks/stack-item/stack-item.controller.ts index d723f85015..77dc11f192 100644 --- a/dashboard/src/app/stacks/list-stacks/stack-item/stack-item.controller.ts +++ b/dashboard/src/app/stacks/list-stacks/stack-item/stack-item.controller.ts @@ -18,11 +18,17 @@ */ export class StackItemController { + $location: ng.ILocationService; + lodash: any; + + stack: che.IStack; + /** * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($location, lodash) { + constructor($location: ng.ILocationService, + lodash: any) { this.$location = $location; this.lodash = lodash; } @@ -39,8 +45,8 @@ export class StackItemController { * @param stack stack with components * @returns {*} */ - getComponents(stack) { - return this.lodash.map(stack.components, (component) => { + getComponents(stack: che.IStack) { + return this.lodash.map(stack.components, (component: any) => { return component.name; }).join(', '); } diff --git a/dashboard/src/app/stacks/list-stacks/stack-item/stack-item.directive.ts b/dashboard/src/app/stacks/list-stacks/stack-item/stack-item.directive.ts index 03743cc4d9..70077d6363 100644 --- a/dashboard/src/app/stacks/list-stacks/stack-item/stack-item.directive.ts +++ b/dashboard/src/app/stacks/list-stacks/stack-item/stack-item.directive.ts @@ -15,33 +15,28 @@ * Expects in parent scope: * @param{object} stack */ -export class StackItem { +export class StackItem implements ng.IDirective { - /** - * Default constructor. - */ - constructor() { - this.restrict = 'E'; + restrict = 'E'; - // we require ngModel as we want to use it inside our directive - this.require = ['ngModel']; + // we require ngModel as we want to use it inside our directive + require = ['ngModel']; - // scope values - this.scope = { - stack: '=stack', - userId: '=userId', - isSelectable: '=cheSelectable', - isSelect: '=?ngModel', - onCheckboxClick: '&?cheOnCheckboxClick', - onDelete: '&cheOnDelete', - onDuplicate: '&cheOnDuplicate' - }; + // scope values + scope = { + stack: '=stack', + userId: '=userId', + isSelectable: '=cheSelectable', + isSelect: '=?ngModel', + onCheckboxClick: '&?cheOnCheckboxClick', + onDelete: '&cheOnDelete', + onDuplicate: '&cheOnDuplicate' + }; - this.templateUrl = 'app/stacks/list-stacks/stack-item/stack-item.html'; + templateUrl = 'app/stacks/list-stacks/stack-item/stack-item.html'; - this.controller = 'StackItemController'; - this.controllerAs = 'stackItemController'; - this.bindToController = true; - } + controller = 'StackItemController'; + controllerAs = 'stackItemController'; + bindToController = true; } diff --git a/dashboard/src/app/stacks/stack-details/import-stack.service.ts b/dashboard/src/app/stacks/stack-details/import-stack.service.ts index aa7df9414a..6a25121c0f 100644 --- a/dashboard/src/app/stacks/stack-details/import-stack.service.ts +++ b/dashboard/src/app/stacks/stack-details/import-stack.service.ts @@ -18,7 +18,7 @@ import {StackValidationService} from './stack-validation.service'; */ export class ImportStackService { private stackValidationService: StackValidationService; - private stack: che.IStack | {}; + private stack: che.IStack; /** @@ -28,7 +28,7 @@ export class ImportStackService { constructor(stackValidationService: StackValidationService) { this.stackValidationService = stackValidationService; - this.stack = {}; + this.stack = {} as che.IStack; } /** @@ -36,7 +36,7 @@ export class ImportStackService { * * @param stack {che.IStack} */ - setStack(stack: che.IStack | {}): void { + setStack(stack: che.IStack): void { this.stack = stack; } @@ -45,7 +45,7 @@ export class ImportStackService { * * @returns {che.IStack} */ - getStack(): che.IStack | {} { + getStack(): che.IStack { return this.stack; } diff --git a/dashboard/src/app/stacks/stack-details/select-template/select-template.controller.ts b/dashboard/src/app/stacks/stack-details/select-template/select-template.controller.ts index 79bdf7cea0..f45068a711 100644 --- a/dashboard/src/app/stacks/stack-details/select-template/select-template.controller.ts +++ b/dashboard/src/app/stacks/stack-details/select-template/select-template.controller.ts @@ -20,7 +20,7 @@ import {StackController} from '../stack.controller'; */ export class SelectTemplateController { stack: che.IStack; - selectedTemplates: Array; + selectedTemplates: Array; projectsOrderBy: string; private $mdDialog: ng.material.IDialogService; @@ -53,10 +53,10 @@ export class SelectTemplateController { /** * Helper method used to get the length of keys of the given object - * @param projectTemplate {che.IProject} + * @param projectTemplate {che.IProjectTemplate} * @param isAdd {boolean} */ - updateSelectedTemplates(projectTemplate: che.IProject, isAdd: boolean): void { + updateSelectedTemplates(projectTemplate: che.IProjectTemplate, isAdd: boolean): void { if (isAdd) { this.selectedTemplates.push(projectTemplate); } else { diff --git a/dashboard/src/app/stacks/stack-details/stack.controller.ts b/dashboard/src/app/stacks/stack-details/stack.controller.ts index 7286a9aa78..6b6e184028 100644 --- a/dashboard/src/app/stacks/stack-details/stack.controller.ts +++ b/dashboard/src/app/stacks/stack-details/stack.controller.ts @@ -302,7 +302,8 @@ export class StackController { this.createStack(); return; } - this.cheStack.updateStack(this.stack.id, this.stackJson).then((stack: any) => { + const stack = angular.fromJson(this.stackJson); + this.cheStack.updateStack(this.stack.id, stack).then((stack: any) => { this.cheNotification.showInfo('Stack is successfully updated.'); this.isLoading = false; this.stack = stack; @@ -320,7 +321,8 @@ export class StackController { * Creates new stack. */ createStack(): void { - this.cheStack.createStack(this.stackJson).then((stack: any) => { + const stack = angular.fromJson(this.stackJson); + this.cheStack.createStack(stack).then((stack: any) => { this.stack = stack; this.isLoading = false; this.cheStack.fetchStacks(); @@ -380,11 +382,11 @@ export class StackController { /** * Update projects sequentially by iterating on the number of the projects. * @param workspaceId{string} - the ID of the workspace to use for adding commands - * @param projects{Array} - the array to follow + * @param projects{Array} - the array to follow * @param index{number} - the index of the array of commands * @param deferred{ng.IDeferred} */ - updateProjects(workspaceId: string, projects: Array, index: number, deferred: ng.IDeferred): void { + updateProjects(workspaceId: string, projects: Array, index: number, deferred: ng.IDeferred): void { if (index < projects.length) { let project = projects[index]; let projectTypeResolverService = this.cheWorkspace.getWorkspaceAgent(workspaceId).getProjectTypeResolver(); @@ -406,12 +408,12 @@ export class StackController { /** * Add projects. * @param workspaceId{string} - the ID of the workspace to use for adding projects - * @param projects{Array} - the adding projects + * @param projects{Array} - the adding projects * @param deferred{ng.IDeferred} * * @returns {ng.IPromise} */ - addProjects(workspaceId: string, projects: Array, deferred: ng.IDeferred): void { + addProjects(workspaceId: string, projects: Array, deferred: ng.IDeferred): void { if (projects && projects.length) { let workspaceAgent = this.cheWorkspace.getWorkspaceAgent(workspaceId); workspaceAgent.getProject().createProjects(projects).then(() => { @@ -427,9 +429,9 @@ export class StackController { /** * Show popup for stack's testing * @param stack {che.IStack} - * @param projects {Array} + * @param projects {Array} */ - showStackTestPopup(stack: che.IStack, projects: Array): void { + showStackTestPopup(stack: che.IStack, projects: Array): void { this.showIDE = false; stack.workspaceConfig.projects = []; let deferred = this.$q.defer(); diff --git a/dashboard/src/app/teams/invite-members/list-members.controller.ts b/dashboard/src/app/teams/invite-members/list-members.controller.ts index 6b0f00304a..925f89566f 100644 --- a/dashboard/src/app/teams/invite-members/list-members.controller.ts +++ b/dashboard/src/app/teams/invite-members/list-members.controller.ts @@ -107,7 +107,7 @@ export class ListMembersController { * Handler for value changed in the list. * @param member */ - onValueChanged(member): void { + onValueChanged(member: any): void { member.roles = [angular.fromJson(member.role)]; } diff --git a/dashboard/src/app/teams/invite-members/list-members.directive.ts b/dashboard/src/app/teams/invite-members/list-members.directive.ts index 2f46ffcc7c..f3a512d9dc 100644 --- a/dashboard/src/app/teams/invite-members/list-members.directive.ts +++ b/dashboard/src/app/teams/invite-members/list-members.directive.ts @@ -38,6 +38,4 @@ export class ListMembers implements ng.IDirective { owner: '=' }; - constructor () { - } } diff --git a/dashboard/src/app/teams/team-details/team-members/list-team-members.controller.ts b/dashboard/src/app/teams/team-details/team-members/list-team-members.controller.ts index f570522d84..272b3e7029 100644 --- a/dashboard/src/app/teams/team-details/team-members/list-team-members.controller.ts +++ b/dashboard/src/app/teams/team-details/team-members/list-team-members.controller.ts @@ -10,6 +10,10 @@ */ 'use strict'; import {TeamDetailsService} from '../team-details.service'; +import {ConfirmDialogService} from '../../../../components/service/confirm-dialog/confirm-dialog.service'; +import {CheNotification} from '../../../../components/notification/che-notification.factory'; +import {CheProfile} from '../../../../components/api/che-profile.factory'; +import {CheUser} from '../../../../components/api/che-user.factory'; /** * @ngdoc controller @@ -22,6 +26,10 @@ export class ListTeamMembersController { * Location service. */ $location: ng.ILocationService; + /** + * Selection and filtration helper + */ + cheListHelper: che.widget.ICheListHelper; /** * Team API interaction. @@ -34,11 +42,11 @@ export class ListTeamMembersController { /** * User API interaction. */ - private cheUser: any; + private cheUser: CheUser; /** * User profile API interaction. */ - private cheProfile: any; + private cheProfile: CheProfile; /** * Permissions API interaction. */ @@ -50,11 +58,11 @@ export class ListTeamMembersController { /** * Notifications service. */ - private cheNotification: any; + private cheNotification: CheNotification; /** * Confirm dialog service. */ - private confirmDialogService: any; + private confirmDialogService: ConfirmDialogService; /** * Promises service. */ @@ -87,19 +95,25 @@ export class ListTeamMembersController { * The editable (whether current user can edit members list and see invitations) state of the members (comes from outside). */ private editable: any; - /** - * Selection and filtration helper - */ - cheListHelper: che.widget.ICheListHelper; /** * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor(cheTeam: che.api.ICheTeam, chePermissions: che.api.IChePermissions, cheInvite: che.api.ICheInvite, cheUser: any, cheProfile: any, - confirmDialogService: any, $mdDialog: angular.material.IDialogService, $q: ng.IQService, cheNotification: any, - lodash: any, $location: ng.ILocationService, teamDetailsService: TeamDetailsService, - $scope: ng.IScope, cheListHelperFactory: che.widget.ICheListHelperFactory) { + constructor(cheTeam: che.api.ICheTeam, + chePermissions: che.api.IChePermissions, + cheInvite: che.api.ICheInvite, + cheUser: CheUser, + cheProfile: CheProfile, + confirmDialogService: ConfirmDialogService, + $mdDialog: angular.material.IDialogService, + $q: ng.IQService, + cheNotification: CheNotification, + lodash: any, + $location: ng.ILocationService, + teamDetailsService: TeamDetailsService, + $scope: ng.IScope, + cheListHelperFactory: che.widget.ICheListHelperFactory) { this.cheTeam = cheTeam; this.cheInvite = cheInvite; this.chePermissions = chePermissions; diff --git a/dashboard/src/app/teams/team-details/team-members/member-item/member-item.controller.ts b/dashboard/src/app/teams/team-details/team-members/member-item/member-item.controller.ts index 5d631ec264..62a05427cd 100644 --- a/dashboard/src/app/teams/team-details/team-members/member-item/member-item.controller.ts +++ b/dashboard/src/app/teams/team-details/team-members/member-item/member-item.controller.ts @@ -98,7 +98,7 @@ export class MemberItemController { let roles = this.cheTeam.getRolesFromActions(this.member.permissions.actions); let titles = []; - let processedActions = [] + let processedActions = []; roles.forEach((role: any) => { titles.push(role.title); processedActions = processedActions.concat(role.actions); diff --git a/dashboard/src/app/teams/team-details/team-members/member-item/member-item.directive.ts b/dashboard/src/app/teams/team-details/team-members/member-item/member-item.directive.ts index 3cb564ffd2..1a9c2e0fda 100644 --- a/dashboard/src/app/teams/team-details/team-members/member-item/member-item.directive.ts +++ b/dashboard/src/app/teams/team-details/team-members/member-item/member-item.directive.ts @@ -34,6 +34,4 @@ export class MemberItem implements ng.IDirective { isOwner: '=isOwner' }; - constructor() { - } } diff --git a/dashboard/src/app/workspaces/create-workspace/project-source-selector/add-import-project/add-import-project.controller.ts b/dashboard/src/app/workspaces/create-workspace/project-source-selector/add-import-project/add-import-project.controller.ts index 8688b2e3fd..55a34068fd 100644 --- a/dashboard/src/app/workspaces/create-workspace/project-source-selector/add-import-project/add-import-project.controller.ts +++ b/dashboard/src/app/workspaces/create-workspace/project-source-selector/add-import-project/add-import-project.controller.ts @@ -39,7 +39,9 @@ export class AddImportProjectController { * Callback to check uniqueness of project name. * Provided by parent controller. */ + /* tslint:disable */ private isProjectNameUnique: (data: {name: string}) => boolean; + /* tslint:enable */ /** * Callback provided by parent controller. */ diff --git a/dashboard/src/app/workspaces/create-workspace/project-source-selector/edit-project/edit-project.controller.ts b/dashboard/src/app/workspaces/create-workspace/project-source-selector/edit-project/edit-project.controller.ts index 556023aa7b..5264b29de2 100644 --- a/dashboard/src/app/workspaces/create-workspace/project-source-selector/edit-project/edit-project.controller.ts +++ b/dashboard/src/app/workspaces/create-workspace/project-source-selector/edit-project/edit-project.controller.ts @@ -25,7 +25,9 @@ export class EditProjectController { * Callback to check uniqueness of project name. * Provided by parent controller. */ + /* tslint:disable */ private isProjectNameUnique: (data: {name: string}) => boolean; + /* tslint:enable */ /** * Callback which should be called for changes to be saved. * Provided by parent controller. diff --git a/dashboard/src/app/workspaces/create-workspace/project-source-selector/edit-project/project-metadata/project-metadata.controller.ts b/dashboard/src/app/workspaces/create-workspace/project-source-selector/edit-project/project-metadata/project-metadata.controller.ts index da3289aea2..6bc6711222 100644 --- a/dashboard/src/app/workspaces/create-workspace/project-source-selector/edit-project/project-metadata/project-metadata.controller.ts +++ b/dashboard/src/app/workspaces/create-workspace/project-source-selector/edit-project/project-metadata/project-metadata.controller.ts @@ -41,7 +41,9 @@ export class ProjectMetadataController { * Original template name provided from parent controller. * Provided by parent controller. */ + /* tslint:disable */ private templateName: string; + /* tslint:enable */ /** * Callback to check uniqueness of project name. * Provided by parent controller. diff --git a/dashboard/src/app/workspaces/list-workspaces/workspace-item/usage-chart.directive.ts b/dashboard/src/app/workspaces/list-workspaces/workspace-item/usage-chart.directive.ts index f9c7147740..7e51711a27 100644 --- a/dashboard/src/app/workspaces/list-workspaces/workspace-item/usage-chart.directive.ts +++ b/dashboard/src/app/workspaces/list-workspaces/workspace-item/usage-chart.directive.ts @@ -24,7 +24,7 @@ interface IUsageChartScope extends ng.IScope { * Defines a directive for displaying usage of resource: chart + description. * @author Ann Shumilova */ -export class UsageChart { +export class UsageChart implements ng.IDirective { restrict: string; templateUrl: string; replace: boolean; @@ -54,28 +54,28 @@ export class UsageChart { } - link($scope: IUsageChartScope, element: ng.IAugmentedJQuery, attrs: any): void { + link($scope: IUsageChartScope, $element: ng.IAugmentedJQuery, $attrs: ng.IAttributes): void { if ($scope.usedColor) { - element.find('.usage-chart-used-value').css('color', $scope.usedColor); - element.find('.usage-chart-label').css('color', $scope.usedColor); + $element.find('.usage-chart-used-value').css('color', $scope.usedColor); + $element.find('.usage-chart-label').css('color', $scope.usedColor); } $scope.$watch(function () { - return element.is(':visible'); + return $element.is(':visible'); }, function () { - if (element.is(':visible')) { + if ($element.is(':visible')) { $scope.loaded = true; } }); let t = this; - attrs.$observe('cheUsed', function () { + $attrs.$observe('cheUsed', function () { if ($scope.used && $scope.provided) { t.initChart($scope); } }); - attrs.$observe('cheProvided', function () { + $attrs.$observe('cheProvided', function () { if ($scope.used && $scope.provided) { t.initChart($scope); } @@ -92,9 +92,9 @@ export class UsageChart { $scope.config = { tooltips: true, labels: false, - mouseover: () => {}, - mouseout: () => {}, - click: () => {}, + // mouseover: () => {}, + // mouseout: () => {}, + // click: () => {}, legend: { display: false, position: 'right' diff --git a/dashboard/src/app/workspaces/share-workspace/add-developers/add-developers.controller.ts b/dashboard/src/app/workspaces/share-workspace/add-developers/add-developers.controller.ts index 3aba30256c..e2fb02c640 100644 --- a/dashboard/src/app/workspaces/share-workspace/add-developers/add-developers.controller.ts +++ b/dashboard/src/app/workspaces/share-workspace/add-developers/add-developers.controller.ts @@ -27,7 +27,9 @@ export class AddDeveloperController { /** * true if user owns the workspace. */ + /* tslint:disable */ private canShare: boolean; + /* tslint:enable */ /** * List of users to share the workspace. */ diff --git a/dashboard/src/app/workspaces/share-workspace/share-workspace.controller.ts b/dashboard/src/app/workspaces/share-workspace/share-workspace.controller.ts index 4da3ef2b94..93980cd09d 100644 --- a/dashboard/src/app/workspaces/share-workspace/share-workspace.controller.ts +++ b/dashboard/src/app/workspaces/share-workspace/share-workspace.controller.ts @@ -95,8 +95,24 @@ export class ShareWorkspaceController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor(cheWorkspace: CheWorkspace, cheUser: CheUser, chePermissions: che.api.IChePermissions, cheNotification: CheNotification, $mdDialog: ng.material.IDialogService, $document: ng.IDocumentService, $mdConstant: any, $route: ng.route.IRouteService, $q: ng.IQService, lodash: any, confirmDialogService: ConfirmDialogService, cheTeam: che.api.ICheTeam, $log: ng.ILogService, $scope: ng.IScope, cheListHelperFactory: che.widget.ICheListHelperFactory) { + constructor(cheWorkspace: CheWorkspace, + cheUser: CheUser, + chePermissions: che.api.IChePermissions, + cheNotification: CheNotification, + $mdDialog: ng.material.IDialogService, + $document: ng.IDocumentService, + $mdConstant: any, + $route: ng.route.IRouteService, + $q: ng.IQService, + lodash: any, + confirmDialogService: ConfirmDialogService, + cheTeam: che.api.ICheTeam, + $log: ng.ILogService, + $scope: ng.IScope, + cheListHelperFactory: che.widget.ICheListHelperFactory) { + /* tslint:disable */ 'ngInject'; + /* tslint:enable */ this.cheWorkspace = cheWorkspace; this.cheUser = cheUser; diff --git a/dashboard/src/app/workspaces/workspace-details/environments/list-env-variables/list-env-variables.controller.ts b/dashboard/src/app/workspaces/workspace-details/environments/list-env-variables/list-env-variables.controller.ts index 7503493e12..9bbe03b22b 100644 --- a/dashboard/src/app/workspaces/workspace-details/environments/list-env-variables/list-env-variables.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/environments/list-env-variables/list-env-variables.controller.ts @@ -24,7 +24,7 @@ interface IEnvironmentVariable { */ export class ListEnvVariablesController { $mdDialog: ng.material.IDialogService; - lodash: _.LoDashStatic; + lodash: any; isNoSelected: boolean = true; isBulkChecked: boolean = false; @@ -46,7 +46,9 @@ export class ListEnvVariablesController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($mdDialog: ng.material.IDialogService, lodash: _.LoDashStatic, confirmDialogService: ConfirmDialogService) { + constructor($mdDialog: ng.material.IDialogService, + lodash: any, + confirmDialogService: ConfirmDialogService) { this.$mdDialog = $mdDialog; this.lodash = lodash; this.confirmDialogService = confirmDialogService; diff --git a/dashboard/src/app/workspaces/workspace-details/environments/list-servers/edit-server-dialog/edit-server-dialog.controller.ts b/dashboard/src/app/workspaces/workspace-details/environments/list-servers/edit-server-dialog/edit-server-dialog.controller.ts index 7ad4d32707..853bfd0c3b 100644 --- a/dashboard/src/app/workspaces/workspace-details/environments/list-servers/edit-server-dialog/edit-server-dialog.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/environments/list-servers/edit-server-dialog/edit-server-dialog.controller.ts @@ -20,7 +20,7 @@ import {IEnvironmentManagerMachineServer} from '../../../../../../components/api */ export class EditServerDialogController { $mdDialog: ng.material.IDialogService; - lodash: _.LoDashStatic; + lodash: any; popupTitle: string; @@ -44,7 +44,8 @@ export class EditServerDialogController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($mdDialog: ng.material.IDialogService, lodash: _.LoDashStatic) { + constructor($mdDialog: ng.material.IDialogService, + lodash: any) { this.$mdDialog = $mdDialog; this.lodash = lodash; diff --git a/dashboard/src/app/workspaces/workspace-details/environments/list-servers/list-servers.controller.ts b/dashboard/src/app/workspaces/workspace-details/environments/list-servers/list-servers.controller.ts index 56a644ff80..e2bff82b23 100644 --- a/dashboard/src/app/workspaces/workspace-details/environments/list-servers/list-servers.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/environments/list-servers/list-servers.controller.ts @@ -24,7 +24,7 @@ interface IServerListItem extends IEnvironmentManagerMachineServer { */ export class ListServersController { $mdDialog: ng.material.IDialogService; - lodash: _.LoDashStatic; + lodash: any; isNoSelected: boolean = true; isBulkChecked: boolean = false; @@ -46,7 +46,9 @@ export class ListServersController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($mdDialog: ng.material.IDialogService, lodash: _.LoDashStatic, confirmDialogService: ConfirmDialogService) { + constructor($mdDialog: ng.material.IDialogService, + lodash: any, + confirmDialogService: ConfirmDialogService) { this.$mdDialog = $mdDialog; this.lodash = lodash; this.confirmDialogService = confirmDialogService; diff --git a/dashboard/src/app/workspaces/workspace-details/environments/machine-config/machine-config.controller.ts b/dashboard/src/app/workspaces/workspace-details/environments/machine-config/machine-config.controller.ts index 5062458dd5..cdd503a220 100644 --- a/dashboard/src/app/workspaces/workspace-details/environments/machine-config/machine-config.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/environments/machine-config/machine-config.controller.ts @@ -27,7 +27,7 @@ export class WorkspaceMachineConfigController { $mdDialog: ng.material.IDialogService; $q: ng.IQService; $timeout: ng.ITimeoutService; - lodash: _.LoDashStatic; + lodash: any; timeoutPromise; @@ -52,7 +52,12 @@ export class WorkspaceMachineConfigController { * Default constructor that is using resource injection * @ngInject for Dependency injection */ - constructor($mdDialog: ng.material.IDialogService, $q: ng.IQService, $scope: ng.IScope, $timeout: ng.ITimeoutService, lodash: _.LoDashStatic, confirmDialogService: ConfirmDialogService) { + constructor($mdDialog: ng.material.IDialogService, + $q: ng.IQService, + $scope: ng.IScope, + $timeout: ng.ITimeoutService, + lodash: any, + confirmDialogService: ConfirmDialogService) { this.$mdDialog = $mdDialog; this.$q = $q; this.$timeout = $timeout; diff --git a/dashboard/src/app/workspaces/workspace-details/environments/machine-config/machine-config.directive.ts b/dashboard/src/app/workspaces/workspace-details/environments/machine-config/machine-config.directive.ts index 38590e33b7..b419aac3b8 100644 --- a/dashboard/src/app/workspaces/workspace-details/environments/machine-config/machine-config.directive.ts +++ b/dashboard/src/app/workspaces/workspace-details/environments/machine-config/machine-config.directive.ts @@ -24,7 +24,7 @@ * * @author Oleksii Kurinnyi */ -export class WorkspaceMachineConfig { +export class WorkspaceMachineConfig implements ng.IDirective { restrict = 'E'; templateUrl = 'app/workspaces/workspace-details/environments/machine-config/machine-config.html'; @@ -43,10 +43,5 @@ export class WorkspaceMachineConfig { machineIsOpened: '=' }; - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor () { } } diff --git a/dashboard/src/app/workspaces/workspace-details/export-workspace/dialog/export-workspace-dialog.controller.ts b/dashboard/src/app/workspaces/workspace-details/export-workspace/dialog/export-workspace-dialog.controller.ts index df9b75799f..ecbaed7073 100644 --- a/dashboard/src/app/workspaces/workspace-details/export-workspace/dialog/export-workspace-dialog.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/export-workspace/dialog/export-workspace-dialog.controller.ts @@ -26,7 +26,7 @@ export class ExportWorkspaceDialogController { private $mdDialog: ng.material.IDialogService; private cheRemote: CheRemote; private $window: ng.IWindowService; - private lodash: _.LoDashStatic; + private lodash: any; private editorOptions: any; private destination: string; @@ -45,9 +45,15 @@ export class ExportWorkspaceDialogController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($q: ng.IQService, $filter: ng.IFilterService, lodash: _.LoDashStatic, cheRemote: CheRemote, - cheNotification: CheNotification, $mdDialog: ng.material.IDialogService, $log: ng.ILogService, - $window: ng.IWindowService, $scope: ng.IScope) { + constructor($q: ng.IQService, + $filter: ng.IFilterService, + lodash: any, + cheRemote: CheRemote, + cheNotification: CheNotification, + $mdDialog: ng.material.IDialogService, + $log: ng.ILogService, + $window: ng.IWindowService, + $scope: ng.IScope) { this.$q = $q; this.$filter = $filter; this.lodash = lodash; @@ -72,7 +78,7 @@ export class ExportWorkspaceDialogController { this.copyOfConfig = this.getCopyOfConfig(); this.exportConfigContent = this.$filter('json')(angular.fromJson(this.copyOfConfig), 2); - $scope.selectedIndex = this.destination === 'file' ? 0 : 1; + ($scope as any).selectedIndex = this.destination === 'file' ? 0 : 1; } /** @@ -101,7 +107,7 @@ export class ExportWorkspaceDialogController { removeLinks(object: any) { delete object.links; - return this.lodash.forEach(object, (value) => { + return this.lodash.forEach(object, (value: any) => { if (angular.isObject(value)) { return this.removeLinks(value); } else { diff --git a/dashboard/src/app/workspaces/workspace-details/export-workspace/export-workspace.controller.ts b/dashboard/src/app/workspaces/workspace-details/export-workspace/export-workspace.controller.ts index 0c40d74253..37ccb7bb7f 100644 --- a/dashboard/src/app/workspaces/workspace-details/export-workspace/export-workspace.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/export-workspace/export-workspace.controller.ts @@ -18,15 +18,20 @@ */ export class ExportWorkspaceController { + $mdDialog: ng.material.IDialogService; + + workspaceId: string; + workspaceDetails: che.IWorkspace; + /** * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($mdDialog) { + constructor($mdDialog: ng.material.IDialogService) { this.$mdDialog = $mdDialog; } - showExport($event, destination) { + showExport($event: MouseEvent, destination: string) { this.$mdDialog.show({ targetEvent: $event, controller: 'ExportWorkspaceDialogController', diff --git a/dashboard/src/app/workspaces/workspace-details/export-workspace/export-workspace.directive.ts b/dashboard/src/app/workspaces/workspace-details/export-workspace/export-workspace.directive.ts index 5e9dc5a6c7..6d5017fe66 100644 --- a/dashboard/src/app/workspaces/workspace-details/export-workspace/export-workspace.directive.ts +++ b/dashboard/src/app/workspaces/workspace-details/export-workspace/export-workspace.directive.ts @@ -24,26 +24,20 @@ * * @author Florent Benoit */ -export class ExportWorkspace { +export class ExportWorkspace implements ng.IDirective { - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor () { - this.restrict = 'E'; - this.templateUrl = 'app/workspaces/workspace-details/export-workspace/export-workspace.html'; + restrict = 'E'; + templateUrl = 'app/workspaces/workspace-details/export-workspace/export-workspace.html'; - this.controller = 'ExportWorkspaceController'; - this.controllerAs = 'exportWorkspaceCtrl'; - this.bindToController = true; + controller = 'ExportWorkspaceController'; + controllerAs = 'exportWorkspaceCtrl'; + bindToController = true; - // scope values - this.scope = { - workspaceId: '@workspaceId', - workspaceDetails: '=workspaceDetails', - workspaceExportDisabled: '=' - }; - } + // scope values + scope = { + workspaceId: '@workspaceId', + workspaceDetails: '=workspaceDetails', + workspaceExportDisabled: '=' + }; } diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.controller.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.controller.ts index 89b2df5a6d..d716c17864 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.controller.ts @@ -20,7 +20,7 @@ import {CheBranding} from '../../../../../components/branding/che-branding.facto export class ReadyToGoStacksController { private $scope: ng.IScope; - private lodash: _.LoDashStatic; + private lodash: any; private tabName: string; private selectedStackId: string; private allStackTags: Array = []; @@ -35,7 +35,10 @@ export class ReadyToGoStacksController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($scope: ng.IScope, lodash: _.LoDashStatic, cheStack: CheStack, cheBranding: CheBranding) { + constructor($scope: ng.IScope, + lodash: any, + cheStack: CheStack, + cheBranding: CheBranding) { this.$scope = $scope; this.lodash = lodash; this.priorityStacks = cheBranding.getWorkspace().priorityStacks; diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.directive.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.directive.ts index 3d3991db12..c020760360 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.directive.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.directive.ts @@ -24,24 +24,18 @@ * * @author Florent Benoit */ -export class ReadyToGoStacks { +export class ReadyToGoStacks implements ng.IDirective { - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor() { - this.restrict = 'E'; - this.templateUrl = 'app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.html'; + restrict = 'E'; + templateUrl = 'app/workspaces/workspace-details/select-stack/ready-to-go-stacks/ready-to-go-stacks.html'; - this.controller = 'ReadyToGoStacksController'; - this.controllerAs = 'readyToGoStacksCtrl'; - this.bindToController = true; + controller = 'ReadyToGoStacksController'; + controllerAs = 'readyToGoStacksCtrl'; + bindToController = true; - // scope values - this.scope = { - tabName: '@cheTabName' - }; - } + // scope values + scope = { + tabName: '@cheTabName' + }; } diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.controller.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.controller.ts index 9fdb10315f..b89cd3849b 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.controller.ts @@ -19,7 +19,7 @@ import {CheStack} from '../../../../../components/api/che-stack.factory'; export class CreateProjectStackLibraryController { private $scope: ng.IScope; - private lodash: _.LoDashStatic; + private lodash: any; private tabName: string; private selectedStackId: string; private allStackTags: Array = []; @@ -30,7 +30,9 @@ export class CreateProjectStackLibraryController { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($scope: ng.IScope, cheStack: CheStack, lodash: _.LoDashStatic) { + constructor($scope: ng.IScope, + cheStack: CheStack, + lodash: any) { this.$scope = $scope; this.lodash = lodash; @@ -43,7 +45,7 @@ export class CreateProjectStackLibraryController { }); } - $scope.$on('event:library:selectStackId', (event, data) => { + $scope.$on('event:library:selectStackId', (event: ng.IAngularEvent, data: string) => { this.setStackSelectionById(data); }); } diff --git a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.directive.ts b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.directive.ts index 4f44b734b3..b7ea682141 100644 --- a/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.directive.ts +++ b/dashboard/src/app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.directive.ts @@ -21,25 +21,18 @@ * * @author Florent Benoit */ -export class CreateProjectStackLibrary { +export class CreateProjectStackLibrary implements ng.IDirective { - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor() { - this.restrict = 'E'; - this.templateUrl = 'app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.html'; + restrict = 'E'; + templateUrl = 'app/workspaces/workspace-details/select-stack/stack-library/create-project-stack-library.html'; - this.controller = 'CreateProjectStackLibraryController'; - this.controllerAs = 'createProjectStackLibraryCtrl'; - this.bindToController = true; + controller = 'CreateProjectStackLibraryController'; + controllerAs = 'createProjectStackLibraryCtrl'; + bindToController = true; - // scope values - this.scope = { - tabName: '@cheTabName' - }; - - } + // scope values + scope = { + tabName: '@cheTabName' + }; } diff --git a/dashboard/src/app/workspaces/workspace-details/warnings/workspace-warnings.directive.ts b/dashboard/src/app/workspaces/workspace-details/warnings/workspace-warnings.directive.ts index 75cc32ad52..59b48a6ec6 100644 --- a/dashboard/src/app/workspaces/workspace-details/warnings/workspace-warnings.directive.ts +++ b/dashboard/src/app/workspaces/workspace-details/warnings/workspace-warnings.directive.ts @@ -16,14 +16,14 @@ * @description This class is handling the directive for the container with warnings * @author Ann Shumilova */ -export class WorkspaceWarnings { - private restrict: string; - private bindToController:boolean; - private templateUrl: string; - private controller: string; - private controllerAs: string; - private transclude: boolean; - private scope: { +export class WorkspaceWarnings implements ng.IDirective { + restrict: string; + bindToController: boolean; + templateUrl: string; + controller: string; + controllerAs: string; + transclude: boolean; + scope: { [propName: string]: string }; @@ -41,7 +41,7 @@ export class WorkspaceWarnings { this.transclude = true; this.scope = { workspace: '=workspace' - } + }; } } diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-machines/edit-machine-dialog/edit-machine-dialog.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-machines/edit-machine-dialog/edit-machine-dialog.controller.ts index fb2d0a9857..86798e2845 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-machines/edit-machine-dialog/edit-machine-dialog.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-machines/edit-machine-dialog/edit-machine-dialog.controller.ts @@ -210,21 +210,10 @@ export class EditMachineDialogController { this.$mdDialog.hide(); } - /** - * Stringify machine recipe. - */ - private stringifyMachineRecipe(): void { - try { - this.machineRecipeScript = this.environmentManager.stringifyRecipe(this.machine.recipe); - } catch (e) { - this.$log.error('Cannot parse machine\'s recipe, error: ', e); - } - } - /** * Parse machine recipe. */ - private parseMachineRecipe(): void { + parseMachineRecipe(): void { try { this.machine.recipe = this.environmentManager.parseMachineRecipe(this.machineRecipeScript); // checks critical recipe changes @@ -249,6 +238,17 @@ export class EditMachineDialogController { } } + /** + * Stringify machine recipe. + */ + private stringifyMachineRecipe(): void { + try { + this.machineRecipeScript = this.environmentManager.stringifyRecipe(this.machine.recipe); + } catch (e) { + this.$log.error('Cannot parse machine\'s recipe, error: ', e); + } + } + /** * Gets full name. * @param {string} name diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-projects/add-project-popover/add-project-popover.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-projects/add-project-popover/add-project-popover.controller.ts index 170a239b15..128de596cf 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-projects/add-project-popover/add-project-popover.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-projects/add-project-popover/add-project-popover.controller.ts @@ -25,7 +25,9 @@ export class AddProjectPopoverController { * Callback to check uniqueness of project name. * Provided by parent controller. */ + /* tslint:disable */ private isProjectNameUnique: (data: {name: string}) => boolean; + /* tslint:enable */ /** * Callback which is called when project templates are added to the list of ready-to-import projects. * Provided by parent controller. diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-projects/project-details/project-details.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-projects/project-details/project-details.controller.ts index f53ae11f3f..bf7e9cdd05 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-projects/project-details/project-details.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-projects/project-details/project-details.controller.ts @@ -231,7 +231,7 @@ export class ProjectDetailsController { this.cheAPI.getWorkspace().fetchWorkspaceDetails(this.workspace.namespace + ':' + this.workspace.config.name).finally(() => { this.$location.path('/workspace/' + this.workspace.namespace + '/' + this.workspace.config.name).search({tab: 'Projects'}); }); - }, (error) => { + }, (error: any) => { this.$log.log('error', error); }); }); @@ -243,7 +243,9 @@ export class ProjectDetailsController { */ getWorkspaceProjects(): Array { let projects = this.cheAPI.getWorkspace().getWorkspaceProjects()[this.workspace.id]; - let _projects = this.lodash.filter(projects, (project) => { return project.name !== this.projectName}); + let _projects = this.lodash.filter(projects, (project: che.IProject) => { + return project.name !== this.projectName; + }); return _projects; } diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-projects/project-details/repository/project-repository.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-projects/project-details/repository/project-repository.controller.ts index 78c06a3d24..b7b9aeac6d 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-projects/project-details/repository/project-repository.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-projects/project-details/repository/project-repository.controller.ts @@ -70,7 +70,7 @@ export class ProjectRepositoryController { } if (projectDetails.mixins.indexOf(subversionMixinId) !== -1) { - //update remote svn url + // update remote svn url if (!this.wsagent.getSvn().getRemoteUrlByKey(projectDetails.workspaceId, projectDetails.path)) { const promise = this.wsagent.getSvn().fetchRemoteUrl(projectDetails.workspaceId, projectDetails.path); @@ -83,7 +83,7 @@ export class ProjectRepositoryController { } if (projectDetails.mixins.indexOf(gitMixinId) !== -1) { - //update git local url + // update git local url if (!this.wsagent.getGit().getLocalUrlByKey(projectDetails.path)) { const promise = this.wsagent.getGit().fetchLocalUrl(projectDetails.path); @@ -94,7 +94,7 @@ export class ProjectRepositoryController { this.localGitRepository = this.wsagent.getGit().getLocalUrlByKey(projectDetails.path); } - //update git remote urls + // update git remote urls if (!this.wsagent.getGit().getRemoteUrlArrayByKey(projectDetails.path)) { const promise = this.wsagent.getGit().fetchRemoteUrlArray(projectDetails.path); diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.controller.ts b/dashboard/src/app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.controller.ts index 8d87484cfd..978a7fac19 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.controller.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.controller.ts @@ -72,7 +72,13 @@ export class WorkspaceDetailsSshCtrl { * Default constructor that is using resource * @ngInject for Dependency injection */ - constructor($route : ng.route.IRouteService, cheSsh: CheSsh, cheWorkspace: CheWorkspace, cheNotification, $mdDialog : ng.material.IDialogService, $log : ng.ILogService, $q : ng.IQService, $timeout : ng.ITimeoutService) { + constructor($route: ng.route.IRouteService, + cheSsh: CheSsh, + cheWorkspace: CheWorkspace, + cheNotification: CheNotification, + $mdDialog: ng.material.IDialogService, + $log: ng.ILogService, + $q: ng.IQService) { this.cheWorkspace = cheWorkspace; this.cheSsh = cheSsh; this.cheNotification = cheNotification; @@ -80,7 +86,7 @@ export class WorkspaceDetailsSshCtrl { this.$log = $log; this.$q = $q; - this.machineSshAgents = new Array<>(); + this.machineSshAgents = []; this.namespace = $route.current.params.namespace; this.workspaceName = $route.current.params.workspaceName; this.workspaceKey = this.namespace + ':' + this.workspaceName; @@ -121,15 +127,22 @@ export class WorkspaceDetailsSshCtrl { */ removeDefaultKey() { this.cheSsh.removeKey('workspace', this.workspaceId).then( - () => {this.$timeout( this.updateData(), 3000)} - ); + () => { + this.$timeout(() => { + this.updateData(); + }, 3000); + }); } /** * Generate a new default workspace keypair */ generateDefaultKey() { - this.cheSsh.generateKey('workspace', this.workspaceId).then(() => {this.$timeout( this.updateData(), 3000)}); + this.cheSsh.generateKey('workspace', this.workspaceId).then(() => { + this.$timeout(() => { + this.updateData(); + }, 3000); + }); } diff --git a/dashboard/src/app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.directive.ts b/dashboard/src/app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.directive.ts index f26ca2593e..00141e0d17 100644 --- a/dashboard/src/app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.directive.ts +++ b/dashboard/src/app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.directive.ts @@ -24,8 +24,7 @@ * * @author Florent Benoit */ -export class WorkspaceDetailsSsh { - +export class WorkspaceDetailsSsh implements ng.IDirective { restrict: string = 'E'; templateUrl: string = 'app/workspaces/workspace-details/workspace-ssh/workspace-details-ssh.html'; @@ -34,13 +33,4 @@ export class WorkspaceDetailsSsh { controllerAs: string = 'workspaceDetailsSshCtrl'; bindToController: boolean = true; - - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor () { - - } - } diff --git a/dashboard/src/app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.controller.ts b/dashboard/src/app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.controller.ts index 2371e453ce..58944a75c6 100644 --- a/dashboard/src/app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.controller.ts +++ b/dashboard/src/app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.controller.ts @@ -26,7 +26,9 @@ export class CheWorkspaceRamAllocationSliderController { * @ngInject for Dependency injection */ constructor ($timeout: ng.ITimeoutService, $scope: ng.IScope) { - "ngInject"; + /* tslint:disable */ + 'ngInject'; + /* tslint:enable */ this.$timeout = $timeout; $scope.$watch(() => { diff --git a/dashboard/src/app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.directive.ts b/dashboard/src/app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.directive.ts index 67732b3af2..961d6a81e4 100644 --- a/dashboard/src/app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.directive.ts +++ b/dashboard/src/app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.directive.ts @@ -15,30 +15,25 @@ * It will change upon width of the screen * @author Oleksii Kurinnyi */ -export class CheWorkspaceRamAllocationSlider { +export class CheWorkspaceRamAllocationSlider implements ng.IDirective { - /** - * Default constructor that is using resource - * @ngInject for Dependency injection - */ - constructor () { - this.restrict = 'E'; + restrict = 'E'; - this.replace = true; - this.templateUrl = 'app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.html'; + replace = true; + templateUrl = 'app/workspaces/workspace-ram-slider/che-workspace-ram-allocation-slider.html'; - // we require ngModel as we want to use it inside our directive - this.require = 'ngModel'; + // we require ngModel as we want to use it inside our directive + require = 'ngModel'; - this.bindToController = true; + bindToController = true; - this.controller = 'CheWorkspaceRamAllocationSliderController'; - this.controllerAs = 'cheWorkspaceRamAllocationSliderController'; + controller = 'CheWorkspaceRamAllocationSliderController'; + controllerAs = 'cheWorkspaceRamAllocationSliderController'; + + // scope values + scope = { + ngModel: '=', + cheOnChange: '&' + }; - // scope values - this.scope = { - ngModel: '=', - cheOnChange: '&' - }; - } } diff --git a/dashboard/src/app/workspaces/workspace-status/workspace-status-indicator.directive.ts b/dashboard/src/app/workspaces/workspace-status/workspace-status-indicator.directive.ts index 4e38f81d8a..2aa26c6a23 100644 --- a/dashboard/src/app/workspaces/workspace-status/workspace-status-indicator.directive.ts +++ b/dashboard/src/app/workspaces/workspace-status/workspace-status-indicator.directive.ts @@ -14,7 +14,7 @@ * Defines a directive for creating simple indicator of workspace's status. * @author Oleksii Kurinnyi */ -export class WorkspaceStatusIndicator { +export class WorkspaceStatusIndicator implements ng.IDirective { restrict: string; replace: boolean; scope; @@ -35,12 +35,12 @@ export class WorkspaceStatusIndicator { /** * Template for the simple indicator of workspace's status - * @param element - * @param attr + * @param $element + * @param $attrs * @returns {string} the template */ - template (element, attr) { - let emptyCircleOnStopped = attr.cheEmptyCircle; + template ($element: ng.IAugmentedJQuery, $attrs: ng.IAttributes) { + let emptyCircleOnStopped = ($attrs as any).cheEmptyCircle; return '' + '' + diff --git a/dashboard/src/app/workspaces/workspace-status/workspace-status.directive.ts b/dashboard/src/app/workspaces/workspace-status/workspace-status.directive.ts index 31b1f7628f..7e9d216554 100644 --- a/dashboard/src/app/workspaces/workspace-status/workspace-status.directive.ts +++ b/dashboard/src/app/workspaces/workspace-status/workspace-status.directive.ts @@ -27,5 +27,4 @@ export class WorkspaceStatus implements ng.IDirective { status: '=cheStatus', isSupported: '=cheIsSupported' }; - } diff --git a/dashboard/src/components/api/builder/che-workspace-builder.ts b/dashboard/src/components/api/builder/che-workspace-builder.ts index be2cd08197..00d15fe3ae 100644 --- a/dashboard/src/components/api/builder/che-workspace-builder.ts +++ b/dashboard/src/components/api/builder/che-workspace-builder.ts @@ -11,12 +11,6 @@ 'use strict'; import IWorkspaceEnvironment = che.IWorkspaceEnvironment; -export interface IWorkspaceAttributes { - created: number; - updated?: number; - [propName: string]: string | number; -} - /** * This class is providing a builder for Workspace * @author Florent Benoit @@ -44,7 +38,7 @@ export class CheWorkspaceBuilder { return this; } - withAttributes(attributes: IWorkspaceAttributes): CheWorkspaceBuilder { + withAttributes(attributes: che.IWorkspaceAttributes): CheWorkspaceBuilder { this.workspace.attributes = attributes; return this; } diff --git a/dashboard/src/components/api/che-agent.factory.ts b/dashboard/src/components/api/che-agent.factory.ts index e867574cb4..920322e499 100644 --- a/dashboard/src/components/api/che-agent.factory.ts +++ b/dashboard/src/components/api/che-agent.factory.ts @@ -55,12 +55,12 @@ export class CheAgent { // reset global list this.agents.length = 0; - agents.forEach((agent: che.IAgent[]) => { + agents.forEach((agent: che.IAgent) => { this.agents.push(agent); }); defer.resolve(this.agents); }, (error: any) => { - if (error.status != 304) { + if (error.status !== 304) { defer.reject(error); } else { defer.resolve(this.agents); diff --git a/dashboard/src/components/api/environment/compose-parser.ts b/dashboard/src/components/api/environment/compose-parser.ts index 3d719b555b..a55c8a44ea 100644 --- a/dashboard/src/components/api/environment/compose-parser.ts +++ b/dashboard/src/components/api/environment/compose-parser.ts @@ -14,6 +14,9 @@ import {IParser} from './parser'; export interface IComposeServiceRecipe { image: string; + environment: any; + depends_on: any[]; + links: any[]; [propName: string]: any; } diff --git a/dashboard/src/components/typings/che.d.ts b/dashboard/src/components/typings/che.d.ts index b1b0b9cbc6..447381672f 100755 --- a/dashboard/src/components/typings/che.d.ts +++ b/dashboard/src/components/typings/che.d.ts @@ -285,19 +285,21 @@ declare namespace che { temporary?: boolean; status?: string; namespace?: string; - attributes?: { - updated?: number; - created?: number; - stackId?: string; - errorMessage?: string; - [propName: string]: string | number; - }; + attributes?: IWorkspaceAttributes; config: IWorkspaceConfig; runtime?: IWorkspaceRuntime; isLocked?: boolean; usedResources?: string; } + export interface IWorkspaceAttributes { + created: number; + updated?: number; + stackId?: string; + errorMessage?: string; + [propName: string]: string | number; + } + export interface IWorkspaceConfig { name?: string; defaultEnv?: string; diff --git a/dashboard/tsconfig.json b/dashboard/tsconfig.json index 23f09fb521..6b76d7638e 100644 --- a/dashboard/tsconfig.json +++ b/dashboard/tsconfig.json @@ -6,7 +6,8 @@ "exclude": [ "node_modules", - "bower_components" + "bower_components", + "target" ] }