Skip to content

Commit

Permalink
Add primaryItemActions to ReviewerManager
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Sep 11, 2024
1 parent 7825040 commit bf2883f
Show file tree
Hide file tree
Showing 6 changed files with 300 additions and 95 deletions.
20 changes: 16 additions & 4 deletions src/components/Icon/icons/History.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
<template>
<svg viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_7755_18921)">
<svg
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="24" height="24" />
<g clip-path="url(#clip0_7755_18920)">
<path
d="M11.9999 6.55371C11.8231 6.55371 11.6535 6.62395 11.5285 6.74897C11.4035 6.874 11.3333 7.04357 11.3333 7.22038V13.0337L15.2666 15.7004C15.4142 15.7941 15.5928 15.8261 15.7638 15.7895C15.9348 15.7528 16.0846 15.6504 16.1808 15.5043C16.277 15.3583 16.3119 15.1803 16.2781 15.0087C16.2443 14.8371 16.1444 14.6857 15.9999 14.587L12.6666 12.327V7.22038C12.6666 7.04357 12.5963 6.874 12.4713 6.74897C12.3463 6.62395 12.1767 6.55371 11.9999 6.55371Z"
d="M11.9999 7.46094C11.8525 7.46094 11.7112 7.51947 11.6071 7.62366C11.5029 7.72784 11.4443 7.86915 11.4443 8.01649V12.8609L14.7221 15.0832C14.8451 15.1613 14.9939 15.188 15.1365 15.1574C15.279 15.1269 15.4038 15.0415 15.4839 14.9198C15.5641 14.7981 15.5932 14.6497 15.565 14.5067C15.5368 14.3638 15.4536 14.2376 15.3332 14.1554L12.5554 12.272V8.01649C12.5554 7.86915 12.4969 7.72784 12.3927 7.62366C12.2885 7.51947 12.1472 7.46094 11.9999 7.46094Z"
fill="currentColor"
/>
<path
d="M11.9999 1.33301C10.0954 1.33968 8.22703 1.85329 6.58674 2.82106C4.94644 3.78884 3.59338 5.17588 2.66659 6.83967V3.46634C2.66659 3.28953 2.59635 3.11996 2.47132 2.99494C2.3463 2.86991 2.17673 2.79967 1.99992 2.79967C1.82311 2.79967 1.65354 2.86991 1.52851 2.99494C1.40349 3.11996 1.33325 3.28953 1.33325 3.46634V9.33301H7.19992C7.37673 9.33301 7.5463 9.26277 7.67132 9.13775C7.79635 9.01272 7.86659 8.84315 7.86659 8.66634C7.86659 8.48953 7.79635 8.31996 7.67132 8.19494C7.5463 8.06991 7.37673 7.99967 7.19992 7.99967H3.56659C4.40741 6.22514 5.7865 4.761 7.50762 3.81563C9.22873 2.87025 11.2042 2.4918 13.1528 2.73414C15.1015 2.97647 16.9241 3.82724 18.3612 5.16537C19.7983 6.5035 20.7768 8.26082 21.1574 10.1873C21.538 12.1137 21.3012 14.1111 20.4809 15.8952C19.6606 17.6793 18.2984 19.1592 16.5883 20.1243C14.8782 21.0895 12.9073 21.4906 10.9559 21.2708C9.00463 21.0509 7.17237 20.2212 5.71992 18.8997C5.65513 18.8406 5.57934 18.7948 5.49687 18.765C5.41441 18.7352 5.32687 18.7219 5.23928 18.726C5.15168 18.73 5.06573 18.7512 4.98635 18.7885C4.90696 18.8257 4.83568 18.8782 4.77659 18.943C4.71749 19.0078 4.67173 19.0836 4.64193 19.1661C4.61213 19.2485 4.59886 19.3361 4.60288 19.4236C4.6069 19.5112 4.62814 19.5972 4.66538 19.6766C4.70262 19.756 4.75513 19.8272 4.81992 19.8863C6.10135 21.0532 7.64783 21.8903 9.32553 22.3252C11.0032 22.76 12.7616 22.7795 14.4485 22.3819C16.1354 21.9844 17.7001 21.1817 19.0071 20.0435C20.314 18.9053 21.324 17.4657 21.9495 15.8494C22.575 14.2331 22.7972 12.4887 22.5969 10.7671C22.3967 9.04561 21.7799 7.39882 20.8001 5.96924C19.8203 4.53967 18.5069 3.37038 16.9735 2.56256C15.4402 1.75474 13.7331 1.33272 11.9999 1.33301Z"
d="M12 3.11133C10.4129 3.11689 8.8559 3.54489 7.48899 4.35137C6.12207 5.15785 4.99452 6.31372 4.2222 7.70022V4.88911C4.2222 4.74176 4.16366 4.60046 4.05948 4.49627C3.95529 4.39208 3.81398 4.33355 3.66664 4.33355C3.5193 4.33355 3.37799 4.39208 3.2738 4.49627C3.16962 4.60046 3.11108 4.74176 3.11108 4.88911V9.778H7.99997C8.14732 9.778 8.28862 9.71946 8.39281 9.61528C8.497 9.51109 8.55553 9.36978 8.55553 9.22244C8.55553 9.0751 8.497 8.93379 8.39281 8.8296C8.28862 8.72542 8.14732 8.66688 7.99997 8.66688H4.9722C5.67288 7.1881 6.82213 5.96799 8.25639 5.18018C9.69065 4.39236 11.3369 4.07699 12.9607 4.27893C14.5846 4.48088 16.1034 5.18985 17.301 6.30496C18.4986 7.42007 19.314 8.88451 19.6312 10.4899C19.9483 12.0952 19.7511 13.7597 19.0675 15.2465C18.3839 16.7332 17.2487 17.9665 15.8236 18.7708C14.3985 19.575 12.7561 19.9094 11.13 19.7261C9.5039 19.5429 7.97702 18.8515 6.76664 17.7502C6.71265 17.701 6.64949 17.6628 6.58077 17.638C6.51205 17.6132 6.4391 17.6021 6.36611 17.6055C6.29311 17.6088 6.22149 17.6265 6.15533 17.6575C6.08917 17.6886 6.02977 17.7323 5.98053 17.7863C5.93128 17.8403 5.89315 17.9035 5.86832 17.9722C5.84348 18.0409 5.83242 18.1139 5.83578 18.1869C5.83913 18.2599 5.85683 18.3315 5.88786 18.3976C5.91889 18.4638 5.96265 18.5232 6.01664 18.5724C7.0845 19.5449 8.37323 20.2424 9.77131 20.6048C11.1694 20.9672 12.6347 20.9834 14.0405 20.6521C15.4462 20.3208 16.7501 19.6519 17.8393 18.7034C18.9284 17.7549 19.77 16.5552 20.2913 15.2083C20.8125 13.8614 20.9977 12.4077 20.8308 10.9731C20.6639 9.5385 20.15 8.16617 19.3335 6.97486C18.5169 5.78355 17.4224 4.80914 16.1446 4.13596C14.8668 3.46277 13.4443 3.11108 12 3.11133Z"
fill="currentColor"
/>
</g>
<defs>
<clipPath id="clip0_7755_18920">
<rect width="20" height="20" transform="translate(2 2)" />
</clipPath>
</defs>
</svg>
</template>
17 changes: 13 additions & 4 deletions src/managers/ReviewerManager/ReviewerManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
{{ t('dashboard.summary.reviewerStatus') }}
</TableColumn>
<TableColumn>{{ t('common.type') }}</TableColumn>
<TableColumn>{{ t('common.action') }}</TableColumn>
<TableColumn>{{ t('grid.columns.actions') }}</TableColumn>
<TableColumn>
<span class="sr-only">{{ t('common.moreActions') }}</span>
</TableColumn>
</TableHeader>
<TableBody>
<TableRow
Expand Down Expand Up @@ -53,10 +56,14 @@
/>
</span>
</TableCell>
<ReviewerCellActions
<ReviewerManagerCellPrimaryActions
:review-assignment="reviewAssignment"
:submission="submission"
></ReviewerManagerCellPrimaryActions>
<ReviewerManagerCellActions
:review-assignment="reviewAssignment"
:submission="submission"
></ReviewerCellActions>
></ReviewerManagerCellActions>
</TableRow>
</TableBody>
</PkpTable>
Expand All @@ -70,7 +77,8 @@ import TableHeader from '@/components/TableNext/TableHeader.vue';
import TableBody from '@/components/TableNext/TableBody.vue';
import TableRow from '@/components/TableNext/TableRow.vue';
import TableCell from '@/components/TableNext/TableCell.vue';
import ReviewerCellActions from './ReviewerCellActions.vue';
import ReviewerManagerCellPrimaryActions from './ReviewerManagerCellPrimaryActions.vue';
import ReviewerManagerCellActions from './ReviewerManagerCellActions.vue';
import PkpButton from '@/components/Button/Button.vue';
import Icon from '@/components/Icon/Icon.vue';
Expand All @@ -90,3 +98,4 @@ const props = defineProps({
const reviewerStore = useReviewerManagerStore(props);
</script>
./ReviewerManagerCellActions.vue
39 changes: 39 additions & 0 deletions src/managers/ReviewerManager/ReviewerManagerCellPrimaryActions.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<template>
<TableCell>
<div class="-ms-3 flex flex-col">
<PkpButton
v-for="item in itemPrimaryActions"
:key="item.name"
is-link
@click="handleAction(item.name)"
>
{{ item.label }}
</PkpButton>
</div>
</TableCell>
</template>

<script setup>
import TableCell from '@/components/TableNext/TableCell.vue';
import PkpButton from '@/components/Button/Button.vue';
import {useReviewerManagerStore} from './reviewerManagerStore';
import {computed} from 'vue';
const props = defineProps({
reviewAssignment: {type: Object, required: true},
submission: {type: Object, required: true},
});
const reviewerManagerStore = useReviewerManagerStore();
const itemPrimaryActions = computed(() =>
reviewerManagerStore.getItemPrimaryActions({
reviewAssignment: props.reviewAssignment,
}),
);
function handleAction(actionName) {
reviewerManagerStore.handleAction(actionName, {
reviewAssignment: props.reviewAssignment,
});
}
</script>
5 changes: 5 additions & 0 deletions src/managers/ReviewerManager/reviewerManagerStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,17 @@ export const useReviewerManagerStore = defineComponentStore(
return _actionFns.getItemActions(args);
}

function getItemPrimaryActions(args) {
return _actionFns.getItemPrimaryActions(args);
}

return {
getReviewMethodIcons,
reviewAssignments,
topActions,
handleAction,
getItemActions,
getItemPrimaryActions,
_actionFns,
};
},
Expand Down
Loading

0 comments on commit bf2883f

Please sign in to comment.