-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#10067 Dashboard add extensibility for columns, left contr…
…ols, right controls
- Loading branch information
1 parent
b121af6
commit 3903d2e
Showing
8 changed files
with
240 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<PkpButton | ||
:is-primary="isPrimary" | ||
:is-secondary="isSecondary" | ||
:is-warnable="isWarnable" | ||
:is-link="isLink" | ||
@click="() => dashboardStore[action](actionArgs)" | ||
> | ||
{{ label }} | ||
</PkpButton> | ||
</template> | ||
<script setup> | ||
import PkpButton from '@/components/Button/Button.vue'; | ||
import {useDashboardPageStore} from '../dashboardPageStore'; | ||
const dashboardStore = useDashboardPageStore(); | ||
defineProps({ | ||
isPrimary: {type: Boolean, required: false, default: false}, | ||
isSecondary: {type: Boolean, required: false, default: false}, | ||
isWarnable: {type: Boolean, required: false, default: false}, | ||
action: {type: String, required: true}, | ||
actionArgs: {type: Object, required: false, default: () => {}}, | ||
isLink: {type: Boolean, default: false}, | ||
label: {type: String, required: true}, | ||
}); | ||
</script> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<Search | ||
:search-phrase="store.searchPhrase" | ||
:search-label="t('editor.submission.search')" | ||
@search-phrase-changed="(...args) => store.setSearchPhrase(...args)" | ||
></Search> | ||
</template> | ||
<script setup> | ||
import Search from '@/components/Search/Search.vue'; | ||
import {useLocalize} from '@/composables/useLocalize'; | ||
const {t} = useLocalize(); | ||
import {useDashboardPageStore} from '../dashboardPageStore'; | ||
const store = useDashboardPageStore(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
src/pages/dashboard/composables/useDashboardConfiguration.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
import {useLocalize} from '@/composables/useLocalize'; | ||
import {DashboardPageTypes} from '../dashboardPageStore'; | ||
|
||
export function useDashboardConfiguration() { | ||
const {t} = useLocalize(); | ||
|
||
function getLeftControls() { | ||
const items = []; | ||
|
||
items.push({ | ||
component: 'DashboardActionButton', | ||
props: {label: t('common.filter'), action: 'openFiltersModal'}, | ||
}); | ||
|
||
items.push({ | ||
component: 'DashboardControlBulkActions', | ||
props: {}, | ||
}); | ||
|
||
items.push({ | ||
component: 'DashboardControlBulkDeleteButton', | ||
props: {}, | ||
}); | ||
|
||
return items; | ||
} | ||
function getRightControls() { | ||
const items = []; | ||
|
||
items.push({component: 'DashboardControlSearch', props: {}}); | ||
|
||
return items; | ||
} | ||
|
||
function getColumns({dashboardPage}) { | ||
const columns = []; | ||
if (dashboardPage === DashboardPageTypes.MY_REVIEW_ASSIGNMENTS) { | ||
columns.push({ | ||
id: 'id', | ||
header: t('common.id'), | ||
component: 'CellReviewAssignmentId', | ||
sortable: true, | ||
}); | ||
|
||
columns.push({ | ||
id: 'title', | ||
header: t('navigation.submissions'), | ||
component: 'CellReviewAssignmentTitle', | ||
sortable: false, | ||
}); | ||
|
||
columns.push({ | ||
id: 'activity', | ||
header: t('stats.editorialActivity'), | ||
component: 'CellReviewAssignmentActivity', | ||
sortable: false, | ||
}); | ||
|
||
columns.push({ | ||
id: 'actions', | ||
header: t('admin.jobs.list.actions'), | ||
component: 'CellReviewAssignmentActions', | ||
sortable: false, | ||
}); | ||
} else if (dashboardPage === DashboardPageTypes.MY_SUBMISSIONS) { | ||
columns.push({ | ||
id: 'id', | ||
header: t('common.id'), | ||
component: 'CellSubmissionId', | ||
sortable: true, | ||
}); | ||
|
||
columns.push({ | ||
id: 'title', | ||
header: t('navigation.submissions'), | ||
component: 'CellSubmissionTitle', | ||
sortable: false, | ||
}); | ||
|
||
columns.push({ | ||
id: 'stage', | ||
header: t('workflow.stage'), | ||
component: 'CellSubmissionStage', | ||
sortable: false, | ||
}); | ||
|
||
columns.push({ | ||
id: 'activity', | ||
header: t('stats.editorialActivity'), | ||
component: 'CellSubmissionActivity', | ||
sortable: false, | ||
}); | ||
|
||
columns.push({ | ||
id: 'actions', | ||
header: t('admin.jobs.list.actions'), | ||
component: 'CellSubmissionActions', | ||
sortable: false, | ||
}); | ||
} else { | ||
columns.push({ | ||
id: 'id', | ||
header: t('common.id'), | ||
component: 'CellSubmissionId', | ||
sortable: true, | ||
}); | ||
|
||
columns.push({ | ||
id: 'title', | ||
header: t('navigation.submissions'), | ||
component: 'CellSubmissionTitle', | ||
sortable: false, | ||
}); | ||
|
||
columns.push({ | ||
id: 'stage', | ||
header: t('workflow.stage'), | ||
component: 'CellSubmissionStage', | ||
sortable: false, | ||
}); | ||
|
||
columns.push({ | ||
id: 'lastActivity', | ||
header: t('editor.submission.days'), | ||
component: 'CellSubmissionDays', | ||
sortable: true, | ||
}); | ||
|
||
columns.push({ | ||
id: 'activity', | ||
header: t('stats.editorialActivity'), | ||
component: 'CellSubmissionActivity', | ||
sortable: false, | ||
}); | ||
|
||
columns.push({ | ||
id: 'actions', | ||
header: t('admin.jobs.list.actions'), | ||
component: 'CellSubmissionActions', | ||
sortable: false, | ||
}); | ||
} | ||
|
||
return columns; | ||
} | ||
|
||
return {getLeftControls, getRightControls, getColumns}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters