From 5ec544ffea5aadc081033c632ef7274d7b8ef4ea Mon Sep 17 00:00:00 2001 From: Ben Bosman Date: Wed, 18 Mar 2020 11:43:20 +0100 Subject: [PATCH 1/3] Moving create community to the top so "create" is not interpreted as an ID --- .../+community-page/community-page-routing.module.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/+community-page/community-page-routing.module.ts b/src/app/+community-page/community-page-routing.module.ts index 976a4ad0fe..876e85c554 100644 --- a/src/app/+community-page/community-page-routing.module.ts +++ b/src/app/+community-page/community-page-routing.module.ts @@ -33,6 +33,11 @@ const COMMUNITY_EDIT_PATH = 'edit'; @NgModule({ imports: [ RouterModule.forChild([ + { + path: COMMUNITY_CREATE_PATH, + component: CreateCommunityPageComponent, + canActivate: [AuthenticatedGuard, CreateCommunityPageGuard] + }, { path: ':id', resolve: { @@ -58,11 +63,6 @@ const COMMUNITY_EDIT_PATH = 'edit'; } ] }, - { - path: COMMUNITY_CREATE_PATH, - component: CreateCommunityPageComponent, - canActivate: [AuthenticatedGuard, CreateCommunityPageGuard] - }, ]) ], providers: [ From f49007e2f65ed51e4283c9dd9fc2cbfc3a0639bd Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 18 Mar 2020 16:12:35 +0100 Subject: [PATCH 2/3] 69920: Move collection create route on top of ID + fix non-static ViewChild --- .../+collection-page/collection-page-routing.module.ts | 10 +++++----- .../comcol-forms/comcol-form/comcol-form.component.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/+collection-page/collection-page-routing.module.ts b/src/app/+collection-page/collection-page-routing.module.ts index 61cfda0d9e..353e3ee9f2 100644 --- a/src/app/+collection-page/collection-page-routing.module.ts +++ b/src/app/+collection-page/collection-page-routing.module.ts @@ -34,6 +34,11 @@ const COLLECTION_EDIT_PATH = 'edit'; @NgModule({ imports: [ RouterModule.forChild([ + { + path: COLLECTION_CREATE_PATH, + component: CreateCollectionPageComponent, + canActivate: [AuthenticatedGuard, CreateCollectionPageGuard] + }, { path: ':id', resolve: { @@ -65,11 +70,6 @@ const COLLECTION_EDIT_PATH = 'edit'; } ] }, - { - path: COLLECTION_CREATE_PATH, - component: CreateCollectionPageComponent, - canActivate: [AuthenticatedGuard, CreateCollectionPageGuard] - }, ]) ], providers: [ diff --git a/src/app/shared/comcol-forms/comcol-form/comcol-form.component.ts b/src/app/shared/comcol-forms/comcol-form/comcol-form.component.ts index 35c6f50969..f8199d2aad 100644 --- a/src/app/shared/comcol-forms/comcol-form/comcol-form.component.ts +++ b/src/app/shared/comcol-forms/comcol-form/comcol-form.component.ts @@ -39,7 +39,7 @@ export class ComColFormComponent implements OnInit, OnDe /** * The logo uploader component */ - @ViewChild(UploaderComponent, {static: true}) uploaderComponent: UploaderComponent; + @ViewChild(UploaderComponent, {static: false}) uploaderComponent: UploaderComponent; /** * DSpaceObject that the form represents From 1f984c4c40406255dfa88ecc50354c7d32ea286a Mon Sep 17 00:00:00 2001 From: Kristof De Langhe Date: Wed, 1 Apr 2020 13:29:25 +0200 Subject: [PATCH 3/3] 69920: Test fix --- .../comcol-forms/comcol-form/comcol-form.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/shared/comcol-forms/comcol-form/comcol-form.component.spec.ts b/src/app/shared/comcol-forms/comcol-form/comcol-form.component.spec.ts index 06f9843c6d..454a036b15 100644 --- a/src/app/shared/comcol-forms/comcol-form/comcol-form.component.spec.ts +++ b/src/app/shared/comcol-forms/comcol-form/comcol-form.component.spec.ts @@ -137,7 +137,7 @@ describe('ComColFormComponent', () => { type: Community.type }, ), - uploader: {} as any, + uploader: undefined, deleteLogo: false } );