Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHE-12917 Added an indicator to notify that the CHE 6 workspaces will not work anymore #13284

Merged
merged 3 commits into from
May 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion dashboard/e2e/stacks/list-stacks/list-stack.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ exports.listStacksTheeEntries = function () {
'machines': {
'dev-machine': {
'servers': {},
'installers': ['org.eclipse.che.exec', 'org.eclipse.che.terminal', 'org.eclipse.che.ws-agent', 'org.eclipse.che.ssh'],
'attributes': {'memoryLimitBytes': '2147483648'}
}
}, 'recipe': {'content': 'codenvy/node', 'type': 'dockerimage'}
Expand Down
2 changes: 0 additions & 2 deletions dashboard/e2e/stacks/stack-details/stack-details.mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ exports.dockerimageStack = function () {
'machines': {
'dev-machine': {
'servers': {},
'installers': ['org.eclipse.che.exec', 'org.eclipse.che.terminal', 'org.eclipse.che.ws-agent', 'org.eclipse.che.ssh'],
'attributes': {'memoryLimitBytes': '2147483648'}
}
}, 'recipe': {'content': 'eclipse/node', 'type': 'dockerimage'}
Expand Down Expand Up @@ -61,7 +60,6 @@ exports.dockerfileStack = function () {
'machines': {
'dev-machine': {
'servers': {},
'installers': ['org.eclipse.che.ws-agent', 'org.eclipse.che.ssh', 'org.eclipse.che.exec', 'org.eclipse.che.terminal'],
'attributes': {'memoryLimitBytes': '2147483648'}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ export class DiagnosticsWorkspaceStartCheck {
'diagnostics': {
'machines': {
'dev-machine': {
'installers': ['org.eclipse.che.ws-agent'],
'servers': {},
'attributes': {'memoryLimitBytes': '1147483648'}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<div class="che-list-item-secondary workspace-item-not-supported"
ng-if="listOrganizationWorkspacesController.isSupported(workspace) === false">
<div>
<span>Not supported</span>
<span>Not compatible</span>
<span class="che-list-actions"><i class="fa fa-question-circle"
uib-tooltip="Current infrastructure doesn't support this workspace recipe type."></i></span>
</div>
Expand Down
1 change: 0 additions & 1 deletion dashboard/src/app/stacks/stack-details/stack.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ function getTestStack(): che.IStack {
'dev-machine': {
'env': { 'CHE_MACHINE_NAME': 'dev-machine' },
'volumes': {},
'installers': ['org.eclipse.che.ws-agent'],
'servers': {
'tomcat8-debug': {
'protocol': 'http',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class WorkspaceItemCtrl {

workspace: che.IWorkspace;
workspaceName: string;
workspaceSupportIssues = '';

/**
* Default constructor that is using resource
Expand All @@ -42,16 +43,31 @@ export class WorkspaceItemCtrl {
this.lodash = lodash;
this.cheWorkspace = cheWorkspace;
this.workspacesService = workspacesService;
this.workspaceName = this.cheWorkspace.getWorkspaceDataManager().getName(this.workspace);
this.workspaceName = this.cheWorkspace.getWorkspaceDataManager().getName(this.workspace);
}

/**
* Returns `true` if default environment of workspace contains supported recipe type.
* Returns `true` if supported.
*
* @returns {boolean}
*/
get isSupported(): boolean {
return this.workspacesService.isSupported(this.workspace);
if (!this.workspacesService.isSupportedRecipeType(this.workspace)) {
this.workspaceSupportIssues = 'Current infrastructure doesn\'t support this workspace recipe type.';

return false;
}
if (!this.workspacesService.isSupportedVersion(this.workspace)) {
this.workspaceSupportIssues = `This workspace is using old definition format which is not compatible anymore.
Please follow the documentation to update the definition of the workspace and benefits from the latest capabilities.`;

return false;
}
if (!this.workspaceSupportIssues) {
this.workspaceSupportIssues = '';
}

return true;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
<div class="che-list-item-secondary workspace-item-not-supported"
ng-if="workspaceItemCtrl.isSupported === false">
<div>
<span>Not supported</span>
<span class="che-list-actions"><i class="fa fa-question-circle" uib-tooltip="Current infrastructure doesn't support this workspace recipe type."></i></span>
<span>Not compatible</span>
<span class="che-list-actions"><i class="fa fa-question-circle" uib-tooltip="{{workspaceItemCtrl.workspaceSupportIssues}}"></i></span>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ describe('WorkspaceStatus >', () => {
[defaultEnvironment]: {
'machines': {
'dev-machine': {
'installers': ['org.eclipse.che.ws-agent']
}
},
'recipe': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
</div>
</div>
<div class="che-list-empty" ng-show="machineSelectorController.machinesList.length === 0">
<span>There are no machines to display.</span>
<span>There are no containers to display.</span>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {WorkspaceDetailsService} from './workspace-details.service';
import IdeSvc from '../../ide/ide.service';
import {WorkspacesService} from '../workspaces.service';
import {ICheEditModeOverlayConfig} from '../../../components/widget/edit-mode-overlay/che-edit-mode-overlay.directive';
import {IEnvironmentManagerMachine} from '../../../components/api/environment/environment-manager-machine';

export interface IInitData {
namespaceId: string;
Expand Down Expand Up @@ -169,14 +168,22 @@ export class WorkspaceDetailsController {
}

/**
* Returns `true` if the recipe of default environment of the workspace has supported recipe type
* Returns `true` if supported.
*
* @returns {boolean}
*/
get isSupported(): boolean {
return this.workspacesService.isSupported(this.workspaceDetails);
}

isSupportedVersion(): boolean {
return this.workspacesService.isSupportedVersion(this.workspaceDetails);
}

isSupportedRecipeType(): boolean {
return this.workspacesService.isSupportedRecipeType(this.workspaceDetails);
}

/**
* Update tabs.
*/
Expand Down Expand Up @@ -282,7 +289,7 @@ export class WorkspaceDetailsController {
}

this.workspaceDetails.config = config;


if (!this.originWorkspaceDetails || !this.workspaceDetails) {
return;
Expand All @@ -292,7 +299,7 @@ export class WorkspaceDetailsController {
const failedTabs = this.checkForFailedTabs();
// publish changes
this.workspaceDetailsService.publishWorkspaceChange(this.workspaceDetails);

if (!failedTabs || failedTabs.length === 0) {
let runningWorkspace = this.getWorkspaceStatus() === WorkspaceStatus[WorkspaceStatus.STARTING] || this.getWorkspaceStatus() === WorkspaceStatus[WorkspaceStatus.RUNNING];
this.saveConfigChanges(false, runningWorkspace);
Expand All @@ -315,16 +322,16 @@ export class WorkspaceDetailsController {
if (this.newName !== devfile.name) {
this.newName = devfile.name;
}

this.workspaceDetails.devfile = devfile;


if (!this.originWorkspaceDetails || !this.workspaceDetails) {
return;
}

this.workspaceDetailsService.publishWorkspaceChange(this.workspaceDetails);

let runningWorkspace = this.getWorkspaceStatus() === WorkspaceStatus[WorkspaceStatus.STARTING] || this.getWorkspaceStatus() === WorkspaceStatus[WorkspaceStatus.RUNNING];
this.saveConfigChanges(false, runningWorkspace);
}
Expand Down Expand Up @@ -356,10 +363,14 @@ export class WorkspaceDetailsController {
* @returns {string}
*/
getOverlayMessage(failedTabs?: string[]): string {
if (this.isSupported === false) {
if (!this.isSupportedRecipeType()) {
return `Current infrastructure doesn't support this workspace recipe type.`;
}

if (!this.isSupportedVersion()) {
return `This workspace is using old definition format which is not compatible anymore.`;
}

if (failedTabs && failedTabs.length > 0) {
const url = this.$location.absUrl().split('?')[0];
let message = `<i class="error fa fa-exclamation-circle"
Expand Down Expand Up @@ -471,7 +482,7 @@ export class WorkspaceDetailsController {

/**
* Updates workspace with new config.
*
*
*/
saveConfigChanges(refreshPage: boolean, notifyRestart?: boolean): void {
this.editOverlayConfig.disabled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ describe(`WorkspaceDetailsController >`, () => {
'dev-machine': {
'env': {},
'volumes': {},
'installers': ['org.eclipse.che.exec', 'org.eclipse.che.terminal', 'org.eclipse.che.ws-agent'],
'servers': {
'tomcat8-debug': {'protocol': 'http', 'port': '8000'},
'codeserver': {'protocol': 'http', 'port': '9876'},
Expand Down Expand Up @@ -109,6 +108,8 @@ describe(`WorkspaceDetailsController >`, () => {
})
.service('workspacesService', function() {
this.isSupported = () => { return true; };
this.isSupportedVersion = () => { return true; };
this.isSupportedRecipeType = () => { return true; };
})
.service('$route', function() {
this.current = {
Expand Down Expand Up @@ -585,6 +586,11 @@ describe(`WorkspaceDetailsController >`, () => {
compileDirective();

controller.workspacesService.isSupported = jasmine.createSpy('workspaceDetailsController.isSupported')
.and
.callFake(() => {
return false;
});
controller.workspacesService.isSupportedRecipeType = jasmine.createSpy('workspaceDetailsController.isSupportedRecipeType')
.and
.callFake(() => {
return false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<che-row-toolbar
che-title="{{workspaceDetailsController.workspaceName}}"
link-href="#/workspaces" link-title="Workspaces" class="workspace-details-toolbar">
<che-description ng-hide="workspaceDetailsController.isSupportedVersion()" class="workspace-details-warning-info">
This workspace is using old definition format which is not compatible anymore.
Please follow the <a ng-href="{{branding.docs.workspace}}" target="_blank">documentation</a> to update the definition of the workspace and benefits from the latest capabilities.
</che-description>
<che-row-toolbar che-title="{{workspaceDetailsController.workspaceName}}" link-href="#/workspaces"
link-title="Workspaces" class="workspace-details-toolbar">
<div layout="row" layout-align="start center" class="toolbar-info">
<!-- is environment supported -->
<workspace-status che-status="workspaceDetailsController.getWorkspaceStatus()"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
.toolbar-info
display flex

div.workspace-details-warning-info
border none
padding-left 20px
color inherit
background-color $warning-color

.workspace-details-content
md-tab-content
padding 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class WorkspaceMachinesController {
}
this.environmentManager = this.cheEnvironmentRegistry.getEnvironmentManager(this.environment.recipe.type);

this.machines = this.environmentManager.getMachines(this.environment);
this.machines = this.environmentManager.getMachines(this.environment, workspaceDetails.runtime);
this.environment = this.environmentManager.getEnvironment(this.environment, this.machines);

if (!angular.isArray(this.machines)) {
Expand Down Expand Up @@ -295,7 +295,7 @@ export class WorkspaceMachinesController {

if (!machine) {
return;
}
}

const currentMemoryLimitBytes = this.environmentManager.getMemoryLimit(machine);
const currentMemoryLimitGBytes = currentMemoryLimitBytes === -1 ? 0 : this.getNumber(this.$filter('changeMemoryUnit')(currentMemoryLimitBytes, [MemoryUnit[MemoryUnit.B], MemoryUnit[MemoryUnit.GB]]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
-->
<md-content flex layout="column" md-theme="maincontent-theme" class="workspace-machines">
<div class="che-list-empty" ng-if="workspaceMachinesController.machines.length === 0">
<span>There are no machines to display.</span>
<span>There are no containers to display.</span>
</div>
<div class="warning-message" ng-hide="workspaceMachinesController.isScalable() || workspaceMachinesController.machines.length === 0">
<span>Add another machine by changing the environment type to <b>compose</b>, <b>kubernetes</b> or <b>openshift</b></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
ng-show="workspaceDetailsSshCtrl.isLoading"></md-progress-linear>
</div>
<div class="che-list-empty" ng-if="!workspaceDetailsSshCtrl.workspace.config.defaultEnv">
<span>There are no machines to display.</span>
<span>There are no containers to display.</span>
</div>
<md-content flex class="workspace-ssh-content" ng-if="workspaceDetailsSshCtrl.workspace.config.defaultEnv">
<div layout="row" flex class="workspace-ssh-content-invalid-notification" ng-if="workspaceDetailsSshCtrl.workspace.status !== 'RUNNING'">
Expand Down
Loading