Skip to content

Commit

Permalink
CHE-8776 fix a workspace details namespace link for UD
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Orel <oorel@redhat.com>
  • Loading branch information
olexii4 committed Mar 10, 2018
1 parent 91d1f68 commit 13fb13e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 2 additions & 0 deletions dashboard/src/app/index.styl
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ md-option:hover

.progress-line
position absolute
left 0
right 0
height 5px
z-index 80

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export class WorkspaceDetailsOverviewController {
* Default constructor that is using resource
*/
constructor($q: ng.IQService, $route: ng.route.IRouteService, $timeout: ng.ITimeoutService, $location: ng.ILocationService,
cheWorkspace: CheWorkspace, cheNotification: CheNotification, confirmDialogService: ConfirmDialogService,
namespaceSelectorSvc: NamespaceSelectorSvc, workspaceDetailsService: WorkspaceDetailsService) {
cheWorkspace: CheWorkspace, cheNotification: CheNotification, confirmDialogService: ConfirmDialogService,
namespaceSelectorSvc: NamespaceSelectorSvc, workspaceDetailsService: WorkspaceDetailsService) {
this.$q = $q;
this.$route = $route;
this.$timeout = $timeout;
Expand Down Expand Up @@ -109,13 +109,20 @@ export class WorkspaceDetailsOverviewController {
fillInListOfUsedNames(): void {
this.isLoading = true;
const defer = this.$q.defer();
this.namespaceId = this.namespaceSelectorSvc.getNamespaceId();
if (this.namespaceId) {
let namespace = this.namespaceSelectorSvc.getNamespaceById(this.namespaceId);
if (namespace && namespace.label) {
this.namespaceSelectorSvc.onNamespaceChanged(namespace.label);
defer.resolve();
} else {
this.namespaceSelectorSvc.fetchNamespaces().then((namespaceId: string) => {
this.namespaceId = namespaceId;
defer.resolve();
this.namespaceSelectorSvc.fetchNamespaces().then(() => {
namespace = this.namespaceSelectorSvc.getNamespaceById(this.namespaceId);
if (namespace && namespace.label) {
this.namespaceSelectorSvc.onNamespaceChanged(namespace.label);
defer.resolve();
}
// set default
this.namespaceId = this.namespaceSelectorSvc.getNamespaceId();
defer.reject();
}, (error: any) => {
defer.reject(error);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
ng-pattern="/^[A-Za-z0-9_\-\.]+$/"
custom-validator="workspaceDetailsOverviewController.isNameUnique($value)">
<che-error-messages che-message-scope="workspace-details-settings" che-message-name="Workspace name">
<div ng-message="required" style="display: none;">A name is required.</div>
<div ng-message="pattern">The name should not contain special characters like space, dollar, etc.</div>
<div ng-message="maxlength">The name has to be less than 101 characters long.</div>
<div ng-message="minlength">The name has to be more than 3 characters long.</div>
Expand Down

0 comments on commit 13fb13e

Please sign in to comment.