Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove in-publication status #382

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ import {
getDocumentStatusLabel,
isDraftEquivalent,
isReviewEquivalent,
isPublication,
isPublished,
DRAFT,
OPEN_REVIEW,
PUBLICATION,
PUBLISHED
} from '../documents/status';
import { computeAtbdVersion } from '../../context/atbds-list';
Expand Down Expand Up @@ -67,10 +65,6 @@ const statusOptions = [
id: OPEN_REVIEW,
filterFn: isReviewEquivalent
},
{
id: PUBLICATION,
filterFn: isPublication
},
{
id: PUBLISHED,
filterFn: isPublished
Expand Down
5 changes: 1 addition & 4 deletions app/assets/scripts/components/dashboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ import {
DRAFT,
getDocumentStatusLabel,
isDraftEquivalent,
isPublication,
isPublished,
isReviewEquivalent,
OPEN_REVIEW,
PUBLICATION,
PUBLISHED
} from '../documents/status';
import { round } from '../../utils/format';
Expand Down Expand Up @@ -262,7 +260,6 @@ function CuratorInsights() {
total: docAcc.total + 1,
DRAFT: docAcc.DRAFT + Number(isDraftEquivalent(ver)),
OPEN_REVIEW: docAcc.OPEN_REVIEW + Number(isReviewEquivalent(ver)),
PUBLICATION: docAcc.PUBLICATION + Number(isPublication(ver)),
PUBLISHED: docAcc.PUBLISHED + Number(isPublished(ver))
};
}, acc);
Expand All @@ -275,7 +272,7 @@ function CuratorInsights() {
<InsightsBlock>
<InsightsBlockTitle>Insights</InsightsBlockTitle>
<InsightsBlockContent>
{[DRAFT, OPEN_REVIEW, PUBLICATION, PUBLISHED].map((status) => (
{[DRAFT, OPEN_REVIEW, PUBLISHED].map((status) => (
<Insight
key={status}
id={status.toLowerCase()}
Expand Down
26 changes: 0 additions & 26 deletions app/assets/scripts/components/documents/document-tracker-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ import {
isDraft,
isDraftEquivalent,
isOpenReview,
isPublication,
isPublicationRequested,
isPublished,
isStatusAfter,
OPEN_REVIEW,
PUBLICATION,
PUBLICATION_REQUESTED,
PUBLISHED,
REVIEW_DONE
Expand Down Expand Up @@ -211,8 +209,6 @@ export default function DocumentTrackerModal(props) {
isClosedReview(atbd),
// Fold index 2:
isOpenReview(atbd) || isPublicationRequested(atbd),
// Fold index 3:
isPublication(atbd),
// Fold index 4:
isPublished(atbd)
],
Expand Down Expand Up @@ -333,28 +329,6 @@ export default function DocumentTrackerModal(props) {
</TrackerItem>
</SubTracker>
</TrackerItem>
<TrackerItem status={checkStatusProgress(PUBLICATION)}>
<TrackerEntryFold
index={3}
checkExpanded={checkExpanded}
setExpanded={setExpanded}
swatchColor={statusMapping[PUBLICATION]}
title={getDocumentStatusLabel(PUBLICATION)}
titleIcon={
isPublication(atbd)
? journalStatusIcons[atbd.journal_status]
: undefined
}
content={
<p>
If the document was scheduled to be published in the
Journal, it goes through the journal publication process
outside of APT, otherwise the the last actions are taken
to have the document published on the platform.
</p>
}
/>
</TrackerItem>
<TrackerItem status={checkStatusProgress(PUBLISHED)}>
<TrackerEntryFold
index={4}
Expand Down
11 changes: 5 additions & 6 deletions app/assets/scripts/components/documents/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const CLOSED_REVIEW_REQUESTED = 'CLOSED_REVIEW_REQUESTED';
export const CLOSED_REVIEW = 'CLOSED_REVIEW';
export const OPEN_REVIEW = 'OPEN_REVIEW';
export const PUBLICATION_REQUESTED = 'PUBLICATION_REQUESTED';
export const PUBLICATION = 'PUBLICATION';
export const PUBLISHED = 'PUBLISHED';

export const DOCUMENT_STATUS = [
Expand All @@ -27,8 +26,7 @@ export const DOCUMENT_STATUS = [
{ id: CLOSED_REVIEW, label: 'In closed review' },
{ id: OPEN_REVIEW, label: 'In review' },
{ id: PUBLICATION_REQUESTED, label: 'In review' },
{ id: PUBLICATION, label: 'In publication' },
{ id: PUBLISHED, label: 'Published' }
{ id: PUBLISHED, label: 'Public' }
];

/**
Expand Down Expand Up @@ -141,12 +139,13 @@ export const isPublicationRequested = (versionOrStatus) => {
};

/**
* Checks that the given document or status string is in Publication

* Checks that the given document or status string is in Publication or after
* @param {object|string} versionOrStatus The doc version or the status string
* @returns boolean
*/
export const isPublication = (versionOrStatus) => {
return isInStatus(versionOrStatus, [PUBLICATION]);
export const isPublicationOrAfter = (versionOrStatus) => {
return isInStatus(versionOrStatus, [PUBLISHED]);
};

/**
Expand Down