+
-
\ No newline at end of file
+
diff --git a/src/portal/src/lib/components/image-name-input/image-name-input.component.scss b/src/portal/src/lib/components/image-name-input/image-name-input.component.scss
index af0e94413..f3e24aa1a 100644
--- a/src/portal/src/lib/components/image-name-input/image-name-input.component.scss
+++ b/src/portal/src/lib/components/image-name-input/image-name-input.component.scss
@@ -42,13 +42,9 @@
width: 100%;
}
}
-
-label.required {
- &:after {
- content: '*';
- font-size: .58479532rem;
- line-height: .5rem;
- color: #c92100;
- margin-left: .25rem;
- }
-}
\ No newline at end of file
+.clr-control-container {
+ width: 60%;
+}
+.w-90 {
+ width: 90%;
+}
diff --git a/src/portal/src/lib/components/image-name-input/image-name-input.component.ts b/src/portal/src/lib/components/image-name-input/image-name-input.component.ts
index f2d29d275..f3b658dc6 100644
--- a/src/portal/src/lib/components/image-name-input/image-name-input.component.ts
+++ b/src/portal/src/lib/components/image-name-input/image-name-input.component.ts
@@ -1,7 +1,7 @@
import { Component, OnDestroy, OnInit } from "@angular/core";
import { Project } from "../project-policy-config/project";
import { Subject } from "rxjs/index";
-import { debounceTime, distinctUntilChanged } from "rxjs/operators";
+import { debounceTime, distinctUntilChanged, switchMap } from "rxjs/operators";
import { ProjectService } from "../../services/project.service";
import { AbstractControl, FormBuilder, FormGroup, Validators } from "@angular/forms";
import { ErrorHandler } from "../../utils/error-handler/error-handler";
@@ -42,36 +42,33 @@ export class ImageNameInputComponent implements OnInit, OnDestroy {
])],
});
}
+
ngOnInit(): void {
this.proNameChecker
.pipe(debounceTime(200))
- .pipe(distinctUntilChanged())
- .subscribe((name: string) => {
- this.noProjectInfo = "";
- this.selectedProjectList = [];
- const prolist: any = this.proService.listProjects(name, undefined);
- if (prolist.subscribe) {
- prolist.subscribe(response => {
- if (response.body) {
- this.selectedProjectList = response.body.slice(0, 10);
- // if input project name exist in the project list
- let exist = response.body.find((data: any) => data.name === name);
- if (!exist) {
- this.noProjectInfo = "REPLICATION.NO_PROJECT_INFO";
- } else {
- this.noProjectInfo = "";
- }
- } else {
- this.noProjectInfo = "REPLICATION.NO_PROJECT_INFO";
- }
- }, (error: any) => {
- this.errorHandler.error(error);
- this.noProjectInfo = "REPLICATION.NO_PROJECT_INFO";
- });
+ .pipe(distinctUntilChanged(),
+ switchMap(name => {
+ this.noProjectInfo = "";
+ this.selectedProjectList = [];
+ return this.proService.listProjects(name, undefined);
+ })
+ ).subscribe(response => {
+ if (response.body) {
+ this.selectedProjectList = response.body.slice(0, 10);
+ // if input project name exist in the project list
+ let exist = response.body.find((data: any) => data.name === this.imageNameForm.controls["projectName"].value);
+ if (!exist) {
+ this.noProjectInfo = "REPLICATION.NO_PROJECT_INFO";
} else {
- this.errorHandler.error("not Observable type");
+ this.noProjectInfo = "";
}
- });
+ } else {
+ this.noProjectInfo = "REPLICATION.NO_PROJECT_INFO";
+ }
+ }, (error: any) => {
+ this.errorHandler.error(error);
+ this.noProjectInfo = "REPLICATION.NO_PROJECT_INFO";
+ });
}
validateProjectName(): void {
diff --git a/src/portal/src/lib/components/replication/replication.component.html b/src/portal/src/lib/components/replication/replication.component.html
index 57e88fb06..e75865bdf 100644
--- a/src/portal/src/lib/components/replication/replication.component.html
+++ b/src/portal/src/lib/components/replication/replication.component.html
@@ -2,7 +2,7 @@
-
@@ -93,4 +93,4 @@
(goToRegistry)="goRegistry()" (reload)="reloadRules($event)">
-
\ No newline at end of file
+
diff --git a/src/portal/src/lib/components/replication/replication.component.ts b/src/portal/src/lib/components/replication/replication.component.ts
index 9f5c60d55..ed03b5a10 100644
--- a/src/portal/src/lib/components/replication/replication.component.ts
+++ b/src/portal/src/lib/components/replication/replication.component.ts
@@ -21,7 +21,7 @@ import {
EventEmitter
} from "@angular/core";
import { Comparator, State } from "../../services/interface";
-import { finalize, catchError, map } from "rxjs/operators";
+import { finalize, catchError, map, debounceTime, distinctUntilChanged, switchMap, delay } from "rxjs/operators";
import { Subscription, forkJoin, timer, Observable, throwError as observableThrowError, observable } from "rxjs";
import { TranslateService } from "@ngx-translate/core";
@@ -62,6 +62,7 @@ import {
import { OperationService } from "../operation/operation.service";
import { Router } from "@angular/router";
import { errorHandler as errorHandFn } from "../../utils/shared/shared.utils";
+import { FilterComponent } from "../filter/filter.component";
const ONE_HOUR_SECONDS: number = 3600;
const ONE_MINUTE_SECONDS: number = 60;
const ONE_DAY_SECONDS: number = 24 * ONE_HOUR_SECONDS;
@@ -146,6 +147,9 @@ export class ReplicationComponent implements OnInit, OnDestroy {
currentState: State;
jobsLoading: boolean = false;
timerDelay: Subscription;
+ @ViewChild(FilterComponent, {static: true})
+ filterComponent: FilterComponent;
+ searchSub: Subscription;
constructor(
private router: Router,
@@ -160,6 +164,23 @@ export class ReplicationComponent implements OnInit, OnDestroy {
}
ngOnInit() {
+ if (!this.searchSub) {
+ this.searchSub = this.filterComponent.filterTerms.pipe(
+ debounceTime(500),
+ distinctUntilChanged(),
+ switchMap( ruleName => {
+ this.loading = true;
+ return this.replicationService.getReplicationRules(this.projectId, ruleName);
+ })
+ ).subscribe(rules => {
+ this.hideJobs();
+ this.listReplicationRule.changedRules = rules || [];
+ this.loading = false;
+ }, error => {
+ this.errorHandler.error(error);
+ this.loading = false;
+ });
+ }
this.currentRuleStatus = this.ruleStatus[0];
}
@@ -167,6 +188,10 @@ export class ReplicationComponent implements OnInit, OnDestroy {
if (this.timerDelay) {
this.timerDelay.unsubscribe();
}
+ if (this.searchSub) {
+ this.searchSub.unsubscribe();
+ this.searchSub = null;
+ }
}
// open replication rule
diff --git a/src/portal/src/lib/components/tag/tag.component.html b/src/portal/src/lib/components/tag/tag.component.html
index 5c5c1c055..e67bc15a9 100644
--- a/src/portal/src/lib/components/tag/tag.component.html
+++ b/src/portal/src/lib/components/tag/tag.component.html
@@ -26,11 +26,11 @@
-
+
-
+
×
diff --git a/src/portal/src/lib/components/tag/tag.component.scss b/src/portal/src/lib/components/tag/tag.component.scss
index 852fee493..b2e96d574 100644
--- a/src/portal/src/lib/components/tag/tag.component.scss
+++ b/src/portal/src/lib/components/tag/tag.component.scss
@@ -126,7 +126,7 @@
.filterLabelPiece {
position: absolute;
- top: 4px;
+ top: 8px;
z-index: 1;
}
@@ -275,4 +275,4 @@ clr-datagrid {
clr-datagrid {
height: auto !important;
-}
\ No newline at end of file
+}