diff --git a/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html b/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html index 8f25ca2a1..a5b60302c 100644 --- a/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html +++ b/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.html @@ -2,7 +2,7 @@ @if (resource) {
- @if (!isCollectionsRoute() && isAdmin()) { + @if (!isCollectionsRoute() && isAdmin() && !isRegistration) {
diff --git a/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.ts b/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.ts index 9d506e219..2483cb8e3 100644 --- a/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.ts +++ b/src/app/features/project/overview/components/overview-toolbar/overview-toolbar.component.ts @@ -96,6 +96,10 @@ export class OverviewToolbarComponent { ]; protected readonly ResourceType = ResourceType; + get isRegistration(): boolean { + return this.currentResource()?.resourceType === ResourceType.Registration; + } + constructor() { effect(() => { const bookmarksId = this.bookmarksCollectionId(); diff --git a/src/app/features/registry/pages/registry-overview/registry-overview.component.html b/src/app/features/registry/pages/registry-overview/registry-overview.component.html index d5d4e35bb..90e3c0061 100644 --- a/src/app/features/registry/pages/registry-overview/registry-overview.component.html +++ b/src/app/features/registry/pages/registry-overview/registry-overview.component.html @@ -27,7 +27,7 @@
} @else {
- @if (!schemaResponse()?.isOriginalResponse) { + @if (!schemaResponse()?.isOriginalResponse && !isInitialState) {
diff --git a/src/app/features/registry/pages/registry-overview/registry-overview.component.ts b/src/app/features/registry/pages/registry-overview/registry-overview.component.ts index 598c0fba6..65cc97c19 100644 --- a/src/app/features/registry/pages/registry-overview/registry-overview.component.ts +++ b/src/app/features/registry/pages/registry-overview/registry-overview.component.ts @@ -21,7 +21,7 @@ import { ResourceMetadataComponent, SubHeaderComponent, } from '@osf/shared/components'; -import { ResourceType, RevisionReviewStates, UserPermissions } from '@osf/shared/enums'; +import { RegistrationReviewStates, ResourceType, RevisionReviewStates, UserPermissions } from '@osf/shared/enums'; import { toCamelCase } from '@osf/shared/helpers'; import { MapRegistryOverview } from '@osf/shared/mappers'; import { SchemaResponse, ToolbarResource } from '@osf/shared/models'; @@ -157,6 +157,10 @@ export class RegistryOverviewComponent { return this.userPermissions().includes(UserPermissions.Admin); } + get isInitialState(): boolean { + return this.registry()?.reviewsState === RegistrationReviewStates.Initial; + } + constructor() { this.route.parent?.params.subscribe((params) => { const id = params['id']; diff --git a/src/app/shared/mappers/registration/registration.mapper.ts b/src/app/shared/mappers/registration/registration.mapper.ts index 2a1738589..d9ca3570f 100644 --- a/src/app/shared/mappers/registration/registration.mapper.ts +++ b/src/app/shared/mappers/registration/registration.mapper.ts @@ -107,7 +107,7 @@ export class RegistrationMapper { type: 'registrations', attributes: { embargo_end_date: embargoDate || null, - draft_registration: draftId, + draft_registration_id: draftId, included_node_ids: components, }, relationships: {