Skip to content

Commit

Permalink
pkp/pkp-lib#9527 Make initPageConfig as props for better documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jardakotesovec committed Dec 14, 2023
1 parent b8c45ba commit 3a9f5ab
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
7 changes: 5 additions & 2 deletions src/pages/example/ExamplePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ import {
} from './examplePageStore';
// Define Page Props
const props = defineProps({pageInitConfig: {required: true, type: Object}});
const props = defineProps({
/** URL to fetch submissions from API */
submissionsApiUrl: {type: String, required: true},
});
// Expose the page server configuration to the store, before its created so it can use is during initialisation
initExamplePageStore(props.pageInitConfig);
initExamplePageStore(props);
// Initialise store
useExamplePageStore();
Expand Down
2 changes: 2 additions & 0 deletions src/pages/submissions/SubmissionsPage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ import * as SubmissionsPage from './SubmissionsPage.stories.js';
<Meta of={SubmissionsPage} />

# Submissions page

<ArgTypes />
4 changes: 1 addition & 3 deletions src/pages/submissions/SubmissionsPage.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ export const init = {
],
},
},
args: {
storeData: PageInitConfigMock,
},
args: PageInitConfigMock,
};
41 changes: 38 additions & 3 deletions src/pages/submissions/SubmissionsPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,44 @@ import {
disposeSubmissionsPageStore,
} from './submissionsPageStore';
/** TODO rename to pageInitConfig */
const props = defineProps({storeData: {required: true, type: Object}});
initSubmissionsPageStore(props.storeData);
const props = defineProps({
/** API url for fetching submissions (should be renamed) */
apiUrl: {
type: String,
required: true,
},
/** API url assigning participant */
assignParticipantUrl: {
type: String,
required: true,
},
/** List of Views */
views: {
type: Array,
required: true,
},
/** Initial view that should be selected*/
currentViewId: {
type: Number,
required: true,
},
/** Filters form config */
filtersForm: {
type: Object,
required: true,
},
/** List of columns */
columns: {
type: Array,
required: true,
},
/** How many submissions to show per page */
countPerPage: {
type: Number,
required: true,
},
});
initSubmissionsPageStore(props);
const store = useSubmissionsPageStore();
onUnmounted(() => {
Expand Down

0 comments on commit 3a9f5ab

Please sign in to comment.