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

Commit

Permalink
#289 add todo comments
Browse files Browse the repository at this point in the history
  • Loading branch information
wowshakhov committed Aug 7, 2017
1 parent 52b6cbc commit b0966e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/app/tags/tags.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { KeyValuePair, TagEditAction } from './tags-view/tags-view.component';
import { WithUnsubscribe } from '../utils/mixins/with-unsubscribe';


export abstract class TagsComponent extends WithUnsubscribe() implements OnInit {
export abstract class TagsComponent<T extends Taggable> extends WithUnsubscribe() implements OnInit {
public abstract entity: Taggable;

public tags$: BehaviorSubject<Array<Tag>>;
Expand All @@ -23,6 +23,7 @@ export abstract class TagsComponent extends WithUnsubscribe() implements OnInit
}

public ngOnInit(): void {
// todo: remove unsubscribe after migration to ngrx
this.tags$.next(this.entity.tags);
this.tags$
.takeUntil(this.unsubscribe$)
Expand Down
5 changes: 3 additions & 2 deletions src/app/template/template-tags/template-tags.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import { DialogService } from '../../dialog/dialog-module/dialog.service';
import { Tag } from '../../shared/models';
import { TagService } from '../../shared/services';
import { TagsComponent } from '../../tags/tags.component';
import { BaseTemplateModel, IsoService, TemplateService } from '../shared';
import { IsoService, TemplateService } from '../shared';
import { BaseTemplateService } from '../shared/base-template.service';
import { BaseTemplateModel } from '../shared/base-template.model';


@Component({
selector: 'cs-template-tags',
templateUrl: 'template-tags.component.html'
})
export class TemplateTagsComponent extends TagsComponent {
export class TemplateTagsComponent extends TagsComponent<BaseTemplateModel> {
@Input() public entity: BaseTemplateModel;

constructor(
Expand Down
3 changes: 2 additions & 1 deletion src/app/vm/vm-tags/vm-tags.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { VirtualMachine } from '../shared/vm.model';
selector: 'cs-vm-tags',
templateUrl: 'vm-tags.component.html'
})
export class VmTagsComponent extends TagsComponent implements OnInit {
export class VmTagsComponent extends TagsComponent<VirtualMachine> implements OnInit {
@Input() public entity: VirtualMachine;

constructor(
Expand All @@ -24,6 +24,7 @@ export class VmTagsComponent extends TagsComponent implements OnInit {
}

public ngOnInit(): void {
// todo: remove unsubscribe after migration to ngrx
super.ngOnInit();
this.tags$
.takeUntil(this.unsubscribe$)
Expand Down

0 comments on commit b0966e8

Please sign in to comment.