+ @if (item().description) {
{{ 'resourceCard.labels.description' | translate }} {{ item().description }}
} diff --git a/src/app/shared/components/resource-card/resource-card.component.scss b/src/app/shared/components/resource-card/resource-card.component.scss index 572744b3b..77961708f 100644 --- a/src/app/shared/components/resource-card/resource-card.component.scss +++ b/src/app/shared/components/resource-card/resource-card.component.scss @@ -84,8 +84,12 @@ .content { display: flex; flex-direction: column; - row-gap: 1.7rem; + gap: 1.7rem; + padding-top: 1.7rem; + } + + .break-line { + border: none; border-top: 1px solid var.$grey-2; - padding-top: 1rem; } } diff --git a/src/app/shared/components/resource-card/resource-card.component.ts b/src/app/shared/components/resource-card/resource-card.component.ts index 8a2c0bc21..e867f5726 100644 --- a/src/app/shared/components/resource-card/resource-card.component.ts +++ b/src/app/shared/components/resource-card/resource-card.component.ts @@ -10,6 +10,7 @@ import { ChangeDetectionStrategy, Component, inject, model } from '@angular/core import { toSignal } from '@angular/core/rxjs-interop'; import { Router } from '@angular/router'; +import { DataResourcesComponent } from '@shared/components/data-resources/data-resources.component'; import { ResourceType } from '@shared/enums'; import { Resource } from '@shared/models'; import { ResourceCardService } from '@shared/services'; @@ -26,6 +27,7 @@ import { IS_XSMALL } from '@shared/utils'; NgOptimizedImage, Skeleton, TranslatePipe, + DataResourcesComponent, ], templateUrl: './resource-card.component.html', styleUrl: './resource-card.component.scss', diff --git a/src/app/shared/enums/index.ts b/src/app/shared/enums/index.ts index 5af34c16c..c2e42104c 100644 --- a/src/app/shared/enums/index.ts +++ b/src/app/shared/enums/index.ts @@ -9,9 +9,12 @@ export * from './file-menu-type.enum'; export * from './filter-type.enum'; export * from './get-resources-request-type.enum'; export * from './profile-addons-stepper.enum'; +export * from './registration-review-states.enum'; +export * from './registry-status.enum'; export * from './resource-tab.enum'; export * from './resource-type.enum'; export * from './reusable-filter-type.enum'; +export * from './revision-review-states.enum'; export * from './share-indexing.enum'; export * from './sort-order.enum'; export * from './sort-type.enum'; diff --git a/src/app/shared/enums/registration-review-states.enum.ts b/src/app/shared/enums/registration-review-states.enum.ts new file mode 100644 index 000000000..9f03aeed5 --- /dev/null +++ b/src/app/shared/enums/registration-review-states.enum.ts @@ -0,0 +1,10 @@ +export enum RegistrationReviewStates { + Initial = 'initial', + Pending = 'pending', + Accepted = 'accepted', + Rejected = 'rejected', + Withdrawn = 'withdrawn', + PendingEmbargoTermination = 'pending_embargo_termination', + PendingWithdrawRequest = 'pending_withdraw_request', + PendingWithdraw = 'pending_withdraw', +} diff --git a/src/app/shared/enums/registry-status.enum.ts b/src/app/shared/enums/registry-status.enum.ts new file mode 100644 index 000000000..96bc210eb --- /dev/null +++ b/src/app/shared/enums/registry-status.enum.ts @@ -0,0 +1,14 @@ +export enum RegistryStatus { + None = 'None', + PendingRegistrationApproval = 'pendingRegistrationApproval', + PendingEmbargoApproval = 'pendingEmbargoApproval', + Pending = 'pending', + Accepted = 'accepted', + Embargo = 'embargo', + PendingEmbargoTerminationApproval = 'pendingEmbargoTermination', + PendingWithdrawRequest = 'pendingWithdrawRequest', + PendingWithdraw = 'pendingWithdraw', + Unapproved = 'unapproved', + InProgress = 'inProgress', + PendingModeration = 'pendingModeration', +} diff --git a/src/app/shared/enums/revision-review-states.enum.ts b/src/app/shared/enums/revision-review-states.enum.ts new file mode 100644 index 000000000..8ede37c87 --- /dev/null +++ b/src/app/shared/enums/revision-review-states.enum.ts @@ -0,0 +1,6 @@ +export enum RevisionReviewStates { + Unapproved = 'unapproved', + RevisionInProgress = 'in_progress', + RevisionPendingModeration = 'pending_moderation', + Approved = 'approved', +} diff --git a/src/app/shared/mappers/index.ts b/src/app/shared/mappers/index.ts index 711de153a..dd0b841b1 100644 --- a/src/app/shared/mappers/index.ts +++ b/src/app/shared/mappers/index.ts @@ -2,6 +2,7 @@ export * from './addon.mapper'; export * from './filters'; export * from './institutions'; export * from './licenses.mapper'; +export * from './registry'; export * from './resource-card'; export * from './resource-overview.mappers'; export * from './subjects'; diff --git a/src/app/shared/mappers/registry/index.ts b/src/app/shared/mappers/registry/index.ts new file mode 100644 index 000000000..b4034dc67 --- /dev/null +++ b/src/app/shared/mappers/registry/index.ts @@ -0,0 +1 @@ +export * from './map-registry-status.mapper'; diff --git a/src/app/shared/mappers/registry/map-registry-status.mapper.ts b/src/app/shared/mappers/registry/map-registry-status.mapper.ts new file mode 100644 index 000000000..d34b52371 --- /dev/null +++ b/src/app/shared/mappers/registry/map-registry-status.mapper.ts @@ -0,0 +1,30 @@ +import { RegistryOverviewJsonApiAttributes } from '@osf/features/registry/models'; +import { RegistrationReviewStates, RegistryStatus, RevisionReviewStates } from '@shared/enums'; + +export function MapRegistryStatus(registry: RegistryOverviewJsonApiAttributes): RegistryStatus { + if (registry.pending_embargo_approval) { + return RegistryStatus.PendingEmbargoApproval; + } else if (registry.pending_embargo_termination_approval) { + return RegistryStatus.PendingEmbargoTerminationApproval; + } else if (registry.embargoed) { + return RegistryStatus.Embargo; + } else if (registry.pending_registration_approval) { + return RegistryStatus.PendingRegistrationApproval; + } else if (registry.revision_state === RevisionReviewStates.Unapproved) { + return RegistryStatus.Unapproved; + } else if (registry.revision_state === RevisionReviewStates.RevisionInProgress) { + return RegistryStatus.InProgress; + } else if (registry.revision_state === RevisionReviewStates.RevisionPendingModeration) { + return RegistryStatus.PendingModeration; + } else if (registry.review_state === RegistrationReviewStates.Accepted) { + return RegistryStatus.Accepted; + } else if (registry.review_state === RegistrationReviewStates.Pending) { + return RegistryStatus.Pending; + } else if (registry.review_state === RegistrationReviewStates.PendingWithdraw) { + return RegistryStatus.PendingWithdraw; + } else if (registry.review_state === RegistrationReviewStates.PendingWithdrawRequest) { + return RegistryStatus.PendingWithdrawRequest; + } else { + return RegistryStatus.None; + } +} diff --git a/src/app/shared/models/confirmation-options.model.ts b/src/app/shared/models/confirmation-options.model.ts index 01b0d28e8..8afbb57e5 100644 --- a/src/app/shared/models/confirmation-options.model.ts +++ b/src/app/shared/models/confirmation-options.model.ts @@ -19,7 +19,7 @@ export interface AcceptConfirmationOptions { messageParams?: any; acceptLabelKey?: string; onConfirm: () => void; - onReject: () => void; + onReject?: () => void; } export interface ContinueConfirmationOptions { diff --git a/src/app/shared/services/custom-confirmation.service.ts b/src/app/shared/services/custom-confirmation.service.ts index 49028e7d5..51451e050 100644 --- a/src/app/shared/services/custom-confirmation.service.ts +++ b/src/app/shared/services/custom-confirmation.service.ts @@ -50,7 +50,11 @@ export class CustomConfirmationService { options.onConfirm(); }, reject: () => { - options.onReject(); + if (options.onReject) { + options.onReject(); + } else { + this.confirmationService.close(); + } }, }); } diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 0b763e9d1..6dab2f2a8 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -28,7 +28,9 @@ "deselect": "Deselect", "yes": "Yes", "no": "No", - "update": "Update" + "update": "Update", + "continue update": "Continue update", + "withdraw": "Withdraw" }, "search": { "title": "Search", @@ -65,7 +67,9 @@ "public": "Public", "title": "Title", "description": "Description", - "year": "Year" + "year": "Year", + "optional": "Optional", + "makePublic": "Make Public" }, "deleteConfirmation": { "header": "Delete", @@ -658,10 +662,12 @@ "confirmation": "Type the following to continue:" }, "fork": { - "header": "Fork This Project", + "headerProject": "Fork This Project", + "headerRegistry": "Fork This Registry", "confirmButton": "Fork", "cancelButton": "Cancel", - "message": "Are you sure you want to fork this project?" + "messageProject": "Are you sure you want to fork this project?", + "messageRegistry": "Are you sure you want to fork this registry?" }, "duplicate": { "header": "Duplicate Template", @@ -1641,10 +1647,67 @@ }, "registry": { "overview": { - "public": "Public Registration", "updates": "Updates", + "withdrawRegistration": "Withdraw registration", + "withdrawDescription": "Withdrawing a registration will remove its content from the OSF, but leave basic metadata behind. The title of a withdrawn registration and its contributor list will remain, as will justification or explanation of the withdrawal, should you wish to provide it. Withdrawn registrations will be marked with a \"withdrawn\" tag. This action is irreversible.", + "withdrawJustificationLabel": "Please provide your justification for withdrawing this registration.", + "makePublicMessage": "Are you sure you want make this registration public ?", "statuses": { - "frozen": "This public registration is a frozen, non-editable version of this" + "pendingRegistrationApproval": { + "text": "Pending approval", + "short": "Pending registration approval", + "long": "This registration is waiting for approval from its contributors." + }, + "pendingEmbargoApproval": { + "text": "Pending approval", + "short": "Pending embargo approval", + "long": "This registration is waiting for approval from its contributors. Once approved, the registration will remain private until the embargo ends." + }, + "pending": { + "text": "Pending moderation", + "short": "Pending moderator approval", + "long": "This registration is awaiting a decision by the registry moderators. An email will notify all registration contributors of the decision." + }, + "accepted": { + "text": "Public registration", + "short": "Public", + "long": "This public registration is a frozen, non-editable version of this." + }, + "embargo": { + "text": "Embargoed registration", + "short": "Embargoed", + "long": "This registration is embargoed. It will remain private until {embargoEndDate}." + }, + "pendingEmbargoTermination": { + "text": "Embargoed registration", + "short": "Pending embargo termination", + "long": "This registration is waiting for approval from its contributors to terminate its embargo and be made public." + }, + "pendingWithdrawRequest": { + "text": "Pending withdrawal", + "short": "Pending withdraw request", + "long": "This registration is waiting for approval to be withdrawn by its contributors." + }, + "pendingWithdraw": { + "text": "Pending withdrawal", + "short": "Pending withdrawal moderation", + "long": "This registration is waiting for approval to be withdrawn by registry moderators." + }, + "unapproved": { + "text": "Update pending", + "short": "Update pending approval", + "long": "This registration has an update that is waiting for approval from its contributors. Updates will be made available once approved." + }, + "inProgress": { + "text": "Update in progress", + "short": "Updates being made", + "long": "This registration is currently being updated by its contributors. Updates will be made available once approved." + }, + "pendingModeration": { + "text": "Update pending review", + "short": "Update pending moderator approval", + "long": "This registration has an update that is waiting for moderation. Updates will be made available once approved." + } }, "metadata": { "type": "Registration Type", @@ -1653,7 +1716,7 @@ "associatedProject": "Associated project" }, "original": "Original", - "last": "Last" + "latest": "Latest" } }, "truncatedText": {