|
|
@ -1,4 +1,14 @@
|
|
|
|
import {Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild} from "@angular/core";
|
|
|
|
import {
|
|
|
|
|
|
|
|
ChangeDetectorRef,
|
|
|
|
|
|
|
|
Component,
|
|
|
|
|
|
|
|
EventEmitter,
|
|
|
|
|
|
|
|
Input,
|
|
|
|
|
|
|
|
OnChanges,
|
|
|
|
|
|
|
|
OnInit,
|
|
|
|
|
|
|
|
Output,
|
|
|
|
|
|
|
|
SimpleChanges,
|
|
|
|
|
|
|
|
ViewChild
|
|
|
|
|
|
|
|
} from "@angular/core";
|
|
|
|
import {Tag} from "../../../../../api/models/Tag";
|
|
|
|
import {Tag} from "../../../../../api/models/Tag";
|
|
|
|
import {TagService} from "../../../../services/tag/tag.service";
|
|
|
|
import {TagService} from "../../../../services/tag/tag.service";
|
|
|
|
import {File} from "../../../../../api/models/File";
|
|
|
|
import {File} from "../../../../../api/models/File";
|
|
|
@ -29,7 +39,11 @@ export class FilesTabSidebarComponent implements OnInit, OnChanges {
|
|
|
|
public tagsOfSelection: Tag[] = [];
|
|
|
|
public tagsOfSelection: Tag[] = [];
|
|
|
|
public tagsLoading = false;
|
|
|
|
public tagsLoading = false;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private repoService: RepositoryService, private tagService: TagService) {
|
|
|
|
constructor(
|
|
|
|
|
|
|
|
private changeDetector: ChangeDetectorRef,
|
|
|
|
|
|
|
|
private repoService: RepositoryService,
|
|
|
|
|
|
|
|
private tagService: TagService
|
|
|
|
|
|
|
|
) {
|
|
|
|
this.repoService.selectedRepository.subscribe(
|
|
|
|
this.repoService.selectedRepository.subscribe(
|
|
|
|
async (repo) => repo && this.fileSearch && await this.fileSearch.searchForFiles());
|
|
|
|
async (repo) => repo && this.fileSearch && await this.fileSearch.searchForFiles());
|
|
|
|
this.tagService.tags.subscribe(t => this.allTags = t);
|
|
|
|
this.tagService.tags.subscribe(t => this.allTags = t);
|
|
|
@ -79,6 +93,10 @@ export class FilesTabSidebarComponent implements OnInit, OnChanges {
|
|
|
|
this.tagsLoading = false;
|
|
|
|
this.tagsLoading = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public onTabChange(): void {
|
|
|
|
|
|
|
|
this.changeDetector.markForCheck();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async refreshFileSelection() {
|
|
|
|
private async refreshFileSelection() {
|
|
|
|
const filteredSelection = this.selectedFiles.filter(
|
|
|
|
const filteredSelection = this.selectedFiles.filter(
|
|
|
|
file => this.files.findIndex(f => f.id === file.id) >= 0);
|
|
|
|
file => this.files.findIndex(f => f.id === file.id) >= 0);
|
|
|
|