Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Update upstream dependency to 7.3.0 and apply dashboard patches
Browse files Browse the repository at this point in the history
Signed-off-by: Angel Misevski <amisevsk@redhat.com>
  • Loading branch information
amisevsk authored and ibuziuk committed Oct 22, 2019
1 parent 2b54034 commit 3579c2a
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export class CreateWorkspaceController {
private isEphemeralMode: boolean;
/** End rhche-specific changes */

private stackName: string;

/**
* Default constructor that is using resource injection
*/
Expand Down Expand Up @@ -215,6 +217,7 @@ export class CreateWorkspaceController {
this.isEphemeralMode = true;
this.onEphemeralModeChange();
/** End rhche-specific changes */

}

/**
Expand Down Expand Up @@ -340,7 +343,7 @@ export class CreateWorkspaceController {
// update workspace name
let devfileSource = angular.copy(this.selectedDevfile);
devfileSource.metadata.name = this.workspaceName;
return this.createWorkspaceSvc.createWorkspaceFromDevfile(devfileSource, null);
return this.createWorkspaceSvc.createWorkspaceFromDevfile(devfileSource, {stackName: this.stackName});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@

<che-label-container che-label-name="Select Stack"
che-label-description="Choose your workspace runtime environment used to build and run your projects.">
<devfile-selector on-devfile-select="createWorkspaceController.onDevfileSelected(devfile)">
<devfile-selector on-devfile-select="createWorkspaceController.onDevfileSelected(devfile)"
stack-name="createWorkspaceController.stackName">
</devfile-selector>
</che-label-container>
<!-- Project source selector -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import {IObservable, IObservableCallbackFn, Observable} from '../../../component
import {WorkspaceDetailsProjectsService} from './workspace-projects/workspace-details-projects.service';
import {CheWorkspace, WorkspaceStatus} from '../../../components/api/workspace/che-workspace.factory';
import {CheService} from '../../../components/api/che-service.factory';
import {PluginRegistry} from '../../../components/api/plugin-registry.factory';
import {WorkspaceDataManager} from '../../../components/api/workspace/workspace-data-manager';

interface IPage {
title: string;
Expand All @@ -39,7 +41,7 @@ interface ISection {
*/
export class WorkspaceDetailsService {

static $inject = ['$log', '$q', 'cheWorkspace', 'cheNotification', 'ideSvc', 'createWorkspaceSvc', 'workspaceDetailsProjectsService', 'cheService', 'chePermissions'];
static $inject = ['$log', '$q', 'cheWorkspace', 'cheNotification', 'ideSvc', 'createWorkspaceSvc', 'workspaceDetailsProjectsService', 'cheService', 'chePermissions', 'pluginRegistry'];

/**
* Logging service.
Expand Down Expand Up @@ -80,6 +82,22 @@ export class WorkspaceDetailsService {
* This workspaces should be restarted for new config to be applied.
*/
private restartToApply: string[] = [];
/**
* Array of deprecated editors.
*/
private deprecatedEditors: string[] = [];
/**
* Array of deprecated plugins.
*/
private deprecatedPlugins: string[] = [];
/**
* Plugin registry API interaction.
*/
private pluginRegistry: PluginRegistry;
/**
* Workspace data manager.
*/
private workspaceDataManager: WorkspaceDataManager;

/**
* Default constructor that is using resource
Expand All @@ -93,14 +111,16 @@ export class WorkspaceDetailsService {
createWorkspaceSvc: CreateWorkspaceSvc,
workspaceDetailsProjectsService: WorkspaceDetailsProjectsService,
cheService: CheService,
chePermissions: che.api.IChePermissions
chePermissions: che.api.IChePermissions,
pluginRegistry: PluginRegistry
) {
this.$log = $log;
this.$q = $q;
this.cheWorkspace = cheWorkspace;
this.cheNotification = cheNotification;
this.ideSvc = ideSvc;
this.createWorkspaceSvc = createWorkspaceSvc;
this.pluginRegistry = pluginRegistry;
this.workspaceDetailsProjectsService = workspaceDetailsProjectsService;

this.observable = new Observable<any>();
Expand All @@ -109,15 +129,57 @@ export class WorkspaceDetailsService {
this.sections = [];
this.observable = new Observable();


// Begin rhche-specific changes
// Remove "share workspace" tab from overview
// begin rhche-specific changes
// remove "share workspace" tab from overview
// cheService.fetchServices().finally(() => {
// if (cheService.isServiceAvailable(chePermissions.getPermissionsServicePath())) {
// this.addPage('Share', '<share-workspace></share-workspace>', 'icon-ic_folder_shared_24px');
// }
// });
// End rhche-specific changes
// end rhche-specific changes

this.cheWorkspace.fetchWorkspaceSettings().then(workspaceSettings => {
this.pluginRegistry.fetchPlugins(workspaceSettings.cheWorkspacePluginRegistryUrl).then(items => {
if (angular.isArray(items)) {
items.filter(item => !!item.deprecate).forEach(item => {
const target = item.type === PluginRegistry.EDITOR_TYPE ? this.deprecatedEditors : this.deprecatedPlugins;
target.push(item.id);
});
}
});
});
this.workspaceDataManager = this.cheWorkspace.getWorkspaceDataManager();
}

/**
* Returns selected deprecated editor.
*
* @param {che.IWorkspace} workspace
* @returns {string}
*/
getSelectedDeprecatedEditor(workspace: che.IWorkspace): string {
if (this.workspaceDataManager && workspace) {
const editor = this.workspaceDataManager.getEditor(workspace);
if (this.deprecatedEditors.indexOf(editor) !== -1) {
return editor;
}
}
return '';
}

/**
* Returns selected deprecated plugins.
*
* @param {che.IWorkspace} workspace
* @returns {Array<string>}
*/
getSelectedDeprecatedPlugins(workspace: che.IWorkspace): Array<string> {
if (this.workspaceDataManager && workspace) {
return this.workspaceDataManager.getPlugins(workspace).filter(plugin => {
return this.deprecatedPlugins.indexOf(plugin) !== -1
});
}
return [];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<artifactId>che-parent</artifactId>
<groupId>org.eclipse.che</groupId>
<version>7.3.0-SNAPSHOT</version>
<version>7.3.0</version>
</parent>
<groupId>com.redhat.che</groupId>
<artifactId>fabric8-ide-parent</artifactId>
Expand Down

0 comments on commit 3579c2a

Please sign in to comment.