Skip to content

Commit

Permalink
fix GroupByNamespace issue
Browse files Browse the repository at this point in the history
Signed-off-by: Philipp Meyer <meyer.github@gmail.com>
  • Loading branch information
meyerpp committed Sep 25, 2017
1 parent 9c42306 commit b17f63a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -16,6 +16,7 @@ This is similar to [Angular's CHANGELOG.md](https://github.com/angular/angular/b

### Changed

- Fixed GroupByNamespace issue. Each tosca type has its own namespace state.
- Add artifact source editor to create/upload and edit source files
- Initial support for BPMN4TOSCA implemented using Angular
- Added initial CLI. Current funtionality: Consistency check of the repository.
Expand Down
Expand Up @@ -98,6 +98,8 @@ export class SectionComponent implements OnInit, OnDestroy {
this.changeViewButtonTitle = showAll;
this.showNamespace = 'group';
}

localStorage.setItem(this.toscaType + '_showNamespace', this.showNamespace);
}

onAdd() {
Expand Down Expand Up @@ -153,7 +155,10 @@ export class SectionComponent implements OnInit, OnDestroy {
const resolved: SectionResolverData = data.resolveData;

this.toscaType = resolved.section;
this.showNamespace = resolved.namespace !== 'undefined' ? resolved.namespace : this.showNamespace;

const storedNamepsapce = localStorage.getItem(this.toscaType + '_showNamespace') !== null ?
localStorage.getItem(this.toscaType + '_showNamespace') : 'all';
this.showNamespace = resolved.namespace !== 'undefined' ? resolved.namespace : storedNamepsapce;
this.types = null;

this.service.setPath(resolved.path);
Expand All @@ -167,7 +172,12 @@ export class SectionComponent implements OnInit, OnDestroy {
this.showNamespace = 'group';
this.changeViewButtonTitle = showAll;
} else if (!this.showSpecificNamespaceOnly()) {
this.showNamespace = 'all';
if (this.showNamespace === 'group') {
this.changeViewButtonTitle = showAll;
} else {
this.changeViewButtonTitle = showGrouped;
}
} else {
this.changeViewButtonTitle = showGrouped;
}

Expand Down

0 comments on commit b17f63a

Please sign in to comment.