Merge pull request #2784 from steven-zou/master

fix issue 2759
This commit is contained in:
Steven Zou 2017-07-14 16:25:19 +08:00 committed by GitHub
commit c91189a560
5 changed files with 18 additions and 5 deletions

View File

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

View File

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

View File

@ -79,7 +79,7 @@ export class ListProjectComponent {
newReplicationRule(p: Project) {
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;">
<hbr-replication [projectId]="projectIdentify" [withReplicationJob]='true'></hbr-replication>
<hbr-replication #replicationView [projectId]="projectIdentify" [withReplicationJob]='true'></hbr-replication>
</div>

View File

@ -11,19 +11,30 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, ViewChild, AfterViewInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { ReplicationComponent } from 'harbor-ui';
@Component({
selector: 'replicaton',
templateUrl: 'replication-page.component.html'
})
export class ReplicationPageComponent implements OnInit {
export class ReplicationPageComponent implements OnInit, AfterViewInit {
projectIdentify: string | number;
@ViewChild("replicationView") replicationView: ReplicationComponent;
constructor(private route: ActivatedRoute) { }
ngOnInit(): void {
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();
}
}
}
}