diff --git a/classes/components/forms/FieldSlider.php b/classes/components/forms/FieldSlider.php new file mode 100644 index 00000000000..97985274fca --- /dev/null +++ b/classes/components/forms/FieldSlider.php @@ -0,0 +1,78 @@ +min; + $config['max'] = $this->max; + $config['minLabel'] = $this->minLabel; + $config['maxLabel'] = $this->maxLabel; + $config['valueLabel'] = $this->valueLabel; + $config['valueLabelMin'] = $this->valueLabelMin; + $config['valueLabelMax'] = $this->valueLabelMax; + + return $config; + } + +} diff --git a/classes/components/forms/dashboard/SubmissionFilters.php b/classes/components/forms/dashboard/SubmissionFilters.php index 6875c77a16b..92f7370b19a 100644 --- a/classes/components/forms/dashboard/SubmissionFilters.php +++ b/classes/components/forms/dashboard/SubmissionFilters.php @@ -21,6 +21,7 @@ use Illuminate\Support\LazyCollection; use PKP\components\forms\FieldAutosuggestPreset; use PKP\components\forms\FieldOptions; +use PKP\components\forms\FieldSlider; use PKP\components\forms\FieldSelectUsers; use PKP\components\forms\FormComponent; use PKP\context\Context; @@ -50,6 +51,7 @@ public function __construct( ->addAssignedTo() ->addIssues() ->addCategories() + ->addDaysSinceLastActivity() ; } @@ -157,4 +159,19 @@ protected function addCategories(): self return $this->addField(new FieldOptions('categoryIds', $props)); } + + protected function addDaysSinceLastActivity(): self + { + $props = [ + 'min' => 0, + 'max' => 180, + 'label' => __('submission.list.daysSinceLastActivity'), + 'value' => 0, + 'groupId' => 'default', + + ]; + + return $this->addField(new FieldSlider('daysInactive', $props)); + + } } diff --git a/js/load.js b/js/load.js index a91ce652cff..3b875fb2467 100644 --- a/js/load.js +++ b/js/load.js @@ -17,6 +17,8 @@ import GlobalMixins from '@/mixins/global.js'; import VueAnnouncer from '@vue-a11y/announcer'; import FloatingVue from 'floating-vue'; +import PrimeVue from 'primevue/config'; + import VueScrollTo from 'vue-scrollto'; import emitter from 'tiny-emitter/instance'; @@ -92,6 +94,8 @@ import FieldText from '@/components/Form/fields/FieldText.vue'; import FieldTextarea from '@/components/Form/fields/FieldTextarea.vue'; import FieldUpload from '@/components/Form/fields/FieldUpload.vue'; import FieldUploadImage from '@/components/Form/fields/FieldUploadImage.vue'; +import FieldSlider from '@/components/Form/fields/FieldSlider.vue'; + import VueHighlightJS from 'vue3-highlightjs'; import 'highlight.js/styles/default.css'; @@ -192,6 +196,7 @@ VueRegistry.registerComponent('PkpFieldText', FieldText); VueRegistry.registerComponent('PkpFieldTextarea', FieldTextarea); VueRegistry.registerComponent('PkpFieldUpload', FieldUpload); VueRegistry.registerComponent('PkpFieldUploadImage', FieldUploadImage); +VueRegistry.registerComponent('PkpFieldSlider', FieldSlider); // Required by the URN plugin, to be migrated at some point to pkp prefix VueRegistry.registerComponent('field-text', FieldText); @@ -206,6 +211,9 @@ function pkpCreateVueApp(createAppArgs) { // Initialize Vue const vueApp = createApp(createAppArgs); vueApp.use(pinia); + vueApp.use(PrimeVue, { + unstyled: true, + }); // https://github.com/vuejs/pinia/discussions/1197 // to be able globally share stores