fix issue 2759

This commit is contained in:
Steven Zou 2017-07-14 15:58:35 +08:00
parent a1a36a4cc4
commit fae35add8f
5 changed files with 18 additions and 5 deletions

View File

@ -1,6 +1,8 @@
import { Type } from '@angular/core'; import { Type } from '@angular/core';
import { ReplicationComponent } from './replication.component'; import { ReplicationComponent } from './replication.component';
export * from './replication.component';
export const REPLICATION_DIRECTIVES: Type<any>[] = [ export const REPLICATION_DIRECTIVES: Type<any>[] = [
ReplicationComponent ReplicationComponent
]; ];

View File

@ -31,7 +31,7 @@
"clarity-icons": "^0.9.8", "clarity-icons": "^0.9.8",
"clarity-ui": "^0.9.8", "clarity-ui": "^0.9.8",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"harbor-ui": "0.2.81", "harbor-ui": "0.2.85",
"intl": "^1.2.5", "intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2", "mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0", "ngx-cookie": "^1.0.0",

View File

@ -79,7 +79,7 @@ export class ListProjectComponent {
newReplicationRule(p: Project) { newReplicationRule(p: Project) {
if (p) { if (p) {
this.router.navigateByUrl(`/harbor/projects/${p.project_id}/replication?is_create=true`); this.router.navigateByUrl(`/harbor/projects/${p.project_id}/replications?is_create=true`);
} }
} }

View File

@ -1,3 +1,3 @@
<div style="margin-top: 24px;"> <div style="margin-top: 24px;">
<hbr-replication [projectId]="projectIdentify" [withReplicationJob]='true'></hbr-replication> <hbr-replication #replicationView [projectId]="projectIdentify" [withReplicationJob]='true'></hbr-replication>
</div> </div>

View File

@ -11,19 +11,30 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { Component, OnInit } from '@angular/core'; import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
import { ReplicationComponent } from 'harbor-ui';
@Component({ @Component({
selector: 'replicaton', selector: 'replicaton',
templateUrl: 'replication-page.component.html' templateUrl: 'replication-page.component.html'
}) })
export class ReplicationPageComponent implements OnInit { export class ReplicationPageComponent implements OnInit, AfterViewInit {
projectIdentify: string | number; projectIdentify: string | number;
@ViewChild("replicationView") replicationView: ReplicationComponent;
constructor(private route: ActivatedRoute) { } constructor(private route: ActivatedRoute) { }
ngOnInit(): void { ngOnInit(): void {
this.projectIdentify = +this.route.snapshot.parent.params['id']; this.projectIdentify = +this.route.snapshot.parent.params['id'];
} }
ngAfterViewInit(): void {
let isCreated: boolean = this.route.snapshot.queryParams['is_create'];
if (isCreated) {
if (this.replicationView) {
this.replicationView.openModal();
}
}
}
} }