-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1472 from eclipse/CHE-1222
CHE-1222: make workspace details sections extendible
- Loading branch information
Showing
7 changed files
with
112 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
dashboard/src/app/workspaces/workspace-details/workspace-details.service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (c) 2015-2016 Codenvy, S.A. | ||
* 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: | ||
* Codenvy, S.A. - initial API and implementation | ||
*/ | ||
'use strict'; | ||
|
||
/** | ||
* This class is handling the data for workspace details sections (tabs) | ||
* | ||
* @author Ann Shumilova | ||
*/ | ||
export class WorkspaceDetailsService { | ||
|
||
/** | ||
* Default constructor that is using resource | ||
* @ngInject for Dependency injection | ||
*/ | ||
constructor () { | ||
this.sections = []; | ||
} | ||
|
||
/** | ||
* Add new section to the workspace details. | ||
* | ||
* @param title section title | ||
* @param content section html content | ||
* @param icon section icon | ||
* @param index optional section index (order) | ||
*/ | ||
addSection(title, content, icon, index) { | ||
let section = {}; | ||
section.title = title; | ||
section.content = content; | ||
section.icon = icon; | ||
section.index = index || this.sections.length; | ||
this.sections.push(section); | ||
} | ||
|
||
/** | ||
* Returns workspace details sections. | ||
* | ||
* @returns {Array} array of sections | ||
*/ | ||
getSections() { | ||
return this.sections; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
dashboard/src/components/widget/compile/che-compile.directive.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2015-2016 Codenvy, S.A. | ||
* 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: | ||
* Codenvy, S.A. - initial API and implementation | ||
*/ | ||
'use strict'; | ||
|
||
/** | ||
* Defines a directive in html element, which value will be self compiled. | ||
* | ||
* @author Ann Shumilova | ||
*/ | ||
export class CheCompile { | ||
/** | ||
* Default constructor that is using resource | ||
* @ngInject for Dependency injection | ||
*/ | ||
constructor ($compile) { | ||
this.restrict='A'; | ||
|
||
this.$compile = $compile; | ||
} | ||
|
||
link($scope, element, attrs) { | ||
$scope.$watch(attrs.cheCompile, (value) => { | ||
element.html(value); | ||
this.$compile(element.contents())($scope); | ||
}); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters