Skip to content

pkp/pkp-lib#10263 Relax editing metadata on published/posted materials #398

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
19 changes: 3 additions & 16 deletions src/components/ListPanel/contributors/ContributorsListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
<Spinner v-if="isLoading" />
<template #actions>
<PkpButton
v-if="
publication.status !== getConstant('STATUS_PUBLISHED') &&
canEditPublication
"
v-if="canEditPublication"
icon="Sort"
:is-active="isOrdering"
:disabled="isLoading"
Expand All @@ -39,11 +36,7 @@
{{ t('contributor.listPanel.preview') }}
</PkpButton>
<PkpButton
v-if="
!isOrdering &&
publication.status !== getConstant('STATUS_PUBLISHED') &&
canEditPublication
"
v-if="!isOrdering && canEditPublication"
:disabled="isLoading"
@click="openAddModal"
>
Expand All @@ -65,13 +58,7 @@
{{ localize(item.affiliation) }}
</div>
</template>
<template
v-if="
publication.status !== getConstant('STATUS_PUBLISHED') &&
canEditPublication
"
#item-actions="{item}"
>
<template v-if="canEditPublication" #item-actions="{item}">
<template v-if="isOrdering">
<Orderer
:item-id="item.id"
Expand Down
15 changes: 0 additions & 15 deletions src/managers/GalleyManager/useGalleyManagerConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ export const GalleyManagerConfiguration = {
Actions.GALLEY_EDIT,
Actions.GALLEY_SORT,
],
actionsRequiresUnpublishedState: [
Actions.GALLEY_ADD,
Actions.GALLEY_CHANGE_FILE,
Actions.GALLEY_DELETE,
Actions.GALLEY_SORT,
],
};

export function useGalleyManagerConfig() {
Expand Down Expand Up @@ -84,15 +78,6 @@ export function useGalleyManagerConfig() {
function getManagerConfig({submission, publication}) {
const permittedActions = GalleyManagerConfiguration.actions
.filter((action) => {
if (
publication.value.status === pkp.const.STATUS_PUBLISHED &&
GalleyManagerConfiguration.actionsRequiresUnpublishedState.includes(
action,
)
) {
return false;
}

return true;
})
.filter((action) => {
Expand Down
2 changes: 2 additions & 0 deletions src/pages/workflow/WorkflowPageOJS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import WorkflowPublicationVersionControl from './components/publication/Workflow
import WorkflowChangeSubmissionLanguage from './components/publication/WorkflowChangeSubmissionLanguage.vue';
import WorkflowPrimaryBasicMetadata from './components/primary/WorkflowPrimaryBasicMetadata.vue';
import WorkflowSubmissionStatus from './components/primary/WorkflowSubmissionStatus.vue';
import WorkflowPublicationEditWarning from './components/publication/WorkflowPublicationEditWarning.vue';
import WorkflowPublicationEditDisabled from './components/publication/WorkflowPublicationEditDisabled.vue';

import {useWorkflowConfigOJS as useWorkflowConfig} from './composables/useWorkflowConfig/useWorkflowConfigOJS';
Expand Down Expand Up @@ -57,6 +58,7 @@ const Components = markRaw({
WorkflowPublicationVersionControl,
WorkflowChangeSubmissionLanguage,
WorkflowSubmissionStatus,
WorkflowPublicationEditWarning,
WorkflowPublicationEditDisabled,
});

Expand Down
4 changes: 2 additions & 2 deletions src/pages/workflow/WorkflowPageOMP.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import WorkflowPublicationVersionControl from './components/publication/Workflow
import WorkflowChangeSubmissionLanguage from './components/publication/WorkflowChangeSubmissionLanguage.vue';
import WorkflowPrimaryBasicMetadata from './components/primary/WorkflowPrimaryBasicMetadata.vue';
import WorkflowSubmissionStatus from './components/primary/WorkflowSubmissionStatus.vue';
import WorkflowPublicationEditDisabled from './components/publication/WorkflowPublicationEditDisabled.vue';
import WorkflowPublicationEditWarning from './components/publication/WorkflowPublicationEditWarning.vue';

const props = defineProps({
submissionId: {type: Number, required: true},
Expand Down Expand Up @@ -60,7 +60,7 @@ const Components = markRaw({
WorkflowPublicationVersionControl,
WorkflowChangeSubmissionLanguage,
WorkflowSubmissionStatus,
WorkflowPublicationEditDisabled,
WorkflowPublicationEditWarning,
WorkflowMarketingForm,
WorkflowWorkTypeOMP,
});
Expand Down
4 changes: 2 additions & 2 deletions src/pages/workflow/WorkflowPageOPS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import WorkflowChangeSubmissionLanguage from './components/publication/WorkflowC
import WorkflowPrimaryBasicMetadata from './components/primary/WorkflowPrimaryBasicMetadata.vue';
import WorkflowPublicationRelationDropdownOPS from './components/publication/WorkflowPublicationRelationDropdownOPS.vue';
import WorkflowSubmissionStatus from './components/primary/WorkflowSubmissionStatus.vue';
import WorkflowPublicationEditDisabled from './components/publication/WorkflowPublicationEditDisabled.vue';
import WorkflowPublicationEditWarning from './components/publication/WorkflowPublicationEditWarning.vue';

const props = defineProps({
submissionId: {type: Number, required: true},
Expand All @@ -49,7 +49,7 @@ const Components = markRaw({
WorkflowPublicationVersionControl,
WorkflowChangeSubmissionLanguage,
WorkflowSubmissionStatus,
WorkflowPublicationEditDisabled,
WorkflowPublicationEditWarning,
});

const store = useWorkflowStore({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- file: WorkflowPublicationEditDisbabled.vue -->
<template>
<div
class="bg -mx-5 -mt-5 bg-attention p-5 text-center text-base-normal text-on-dark"
Expand All @@ -8,6 +9,5 @@

<script setup>
import {useLocalize} from '@/composables/useLocalize';

const {t} = useLocalize();
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- file: WorkflowPublicationEditWarning.vue -->
<template>
<div
class="bg -mx-5 -mt-5 bg-attention p-5 text-center text-base-normal text-on-dark"
>
{{ t('publication.editorEditWarning') }}
</div>
</template>

<script setup>
import {useLocalize} from '@/composables/useLocalize';
const {t} = useLocalize();
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ export const PublicationConfig = {
const items = [];
if (selectedPublication.status === pkp.const.STATUS_PUBLISHED) {
items.push({
component: 'WorkflowPublicationEditDisabled',
component: 'WorkflowPublicationEditWarning',
props: {},
});
}
Expand Down Expand Up @@ -963,6 +963,7 @@ export const PublicationConfig = {
props: {
submission,
publication: selectedPublication,
canEdit: permissions.canEditPublication,
},
},
];
Expand Down
7 changes: 0 additions & 7 deletions src/pages/workflow/composables/useWorkflowPermissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,6 @@ export function useWorkflowPermissions({submission, selectedPublication}) {

canEditPublication = submission.value.canCurrentUserChangeMetadata;

if (
selectedPublication.value &&
selectedPublication.value?.status === pkp.const.STATUS_PUBLISHED
) {
canEditPublication = false;
}

if (
hasIntersection(activeStage.currentUserAssignedRoles, [...EditorialRoles])
) {
Expand Down