-
Notifications
You must be signed in to change notification settings - Fork 51
pkp/pkp-lib#11296, pkp/pkp-lib#11366, pkp/pkp-lib#11387 [Versioning] #621
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
Merged
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
00303d4
pkp/pkp-lib#11296 Add publication versions on the left menu for submi…
blesildaramirez 290b172
pkp/pkp-lib#11296 Change selected publication when publication id cha…
blesildaramirez cfff2fc
pkp/pkp-lib#11296 Add expandedKeys in useSideMenu returned data
blesildaramirez 1f8da27
pkp/pkp-lib#11296 Add publication id in expanded keys when submission…
blesildaramirez 59e3a27
pkp/pkp-lib#11296 Remove Versions dropdown Create New Version button …
blesildaramirez 12becea
pkp/pkp-lib#11296 Expand latest publication version instead of curren…
blesildaramirez ea28db4
pkp/pkp-lib#11296 Add closeDialog method in useModal composable api
blesildaramirez 1d72435
pkp/pkp-lib#11296 Update dialog body footer styling if no actions are…
blesildaramirez af80f1d
pkp/pkp-lib#11296 Move createNewVersion method from useWorkflowAction…
blesildaramirez fb5808b
pkp/pkp-lib#11296 Add create new version dialog form
blesildaramirez bf20713
pkp/pkp-lib#11296 Preserve workflow primary and secondary items when …
blesildaramirez b491b49
pkp/pkp-lib#11296 Add options to Versions field when creating new pub…
blesildaramirez ffc38d6
pkp/pkp-lib#11296 Add setSelectOptions method to useForm api
blesildaramirez f1724cf
pkp/pkp-lib#11296 Rename WorkflowCreateNewVersionDialogBody.vue to /W…
blesildaramirez 767ecd8
pkp/pkp-lib#11296 Redirect to new publication once new version is cre…
blesildaramirez 05623f9
pkp/pkp-lib#11366 Add UpdateFile icon
blesildaramirez e81cccc
pkp/pkp-lib#11366 Add locale keys for send file to text editor UI
blesildaramirez ff78db1
pkp/pkp-lib#11366 Add Send File to Text Editor action to submission f…
blesildaramirez 23b5a59
pkp/pkp-lib#11296 Move form handler to useWorkflowVersionForm api
blesildaramirez 19b9137
pkp/pkp-lib#11296 Disable minor revision if version stage selected do…
blesildaramirez e49d96a
pkp/pkp-lib#11296 Improve form fields handling for version form
blesildaramirez e6a0e42
pkp/pkp-lib#11366 Add Send To field to the Send to Text Editor form
blesildaramirez 65bd6ca
pkp/pkp-lib#11366 Add form validations to the Version form
blesildaramirez 282ddc9
pkp/pkp-lib#11366 Add Send to Text Editor action to some other file l…
blesildaramirez 681fef2
pkp/pkp-lib#11366 Add Send to Text Editor action to Revisions Uploade…
blesildaramirez d1aa9f4
pkp/pkp-lib#11366 Expose triggerDataChange function in workflow store
blesildaramirez 197073a
pkp/pkp-lib#11366 Remove onSubmitFn prop in WorkflowVersionDialogBody…
blesildaramirez 8d1dae6
pkp/pkp-lib#11366 Move form submit handler to useWorkflowVersionForm api
blesildaramirez 17562dd
pkp/pkp-lib#11296 Move createNewVersion function back to useWorkflowA…
blesildaramirez cd5abef
pkp/pkp-lib#11296 Change OMP navigation config to apply collapsible m…
blesildaramirez 74e08be
pkp/pkp-lib#11296 Change OPS navigation config to apply collapsible m…
blesildaramirez f65adb3
pkp/pkp-lib#11296 Add field update methods to useForm api
blesildaramirez 8ba71c5
pkp/pkp-lib#11387 Add side modal form to select publication stage bef…
blesildaramirez 741d4b1
pkp/pkp-lib#11296 Remove unused methods in useForm api
blesildaramirez 71ad14a
pkp/pkp-lib#11296 Define versionStageOptions in workflow store
blesildaramirez e62d0ca
pkp/pkp-lib#11296 Fix renamed menu state in useWorkflowMenu api
blesildaramirez 2098a19
pkp/pkp-lib#11296 Use useForm for defining Version form config
blesildaramirez 2fc0fab
pkp/pkp-lib#11296 Only show Create New Version button for users with …
blesildaramirez 92ca06a
pkp/pkp-lib#11296 Simplify workflow menu state handling and improve f…
blesildaramirez dfe5ac5
pkp/pkp-lib#11387 Fix set function for handling version form in side …
blesildaramirez 63fab38
pkp/pkp-lib#11296 Add spacingVariant and footerSpacingVariant props t…
blesildaramirez f45896c
pkp/pkp-lib#11296 Define default value to versionStageOptions
blesildaramirez 97f02d3
pkp/pkp-lib#11296 Update mock data for publications
blesildaramirez 5c44ccc
pkp/pkp-lib#11366 Offer Send File to Text Editor only for users who c…
blesildaramirez 79127a1
pkp/pkp-lib#11296 Add prop displayDefaultFooter for removing default …
blesildaramirez 534cb3c
pkp/pkp-lib#11296 Fix Schedule for Publication not opening latest pub…
blesildaramirez 93f76d6
pkp/pkp-lib#11296 Remove use of publication.version locale key
blesildaramirez f39f171
pkp/pkp-lib#11296 Remove footerSpacingVariant prop
blesildaramirez cd65161
pkp/pkp-lib#11296 Remove closeDialog param
blesildaramirez 196d2fa
pkp/pkp-lib#11296 Move getField method inside useForm api to remove f…
blesildaramirez 128732d
pkp/pkp-lib#11296 Update addFieldSelect to handle select field update…
blesildaramirez e93355b
pkp/pkp-lib#11296 Revert deleted watch function for handling workflow…
blesildaramirez 8b233ad
pkp/pkp-lib#11296 Remove Create New Version button from workflow head…
blesildaramirez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,40 @@ | ||
<template> | ||
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<g clip-path="url(#clip0_800_35)"> | ||
<g clip-path="url(#clip1_800_35)"> | ||
<path | ||
d="M18.277 8.31773H18.2043V3.35856C18.2042 3.16052 18.0437 3 17.8457 3H6.15432C5.95632 3 5.79576 3.16052 5.79576 3.35856V11.8675H5.72303C4.55654 11.8675 3.6075 12.8165 3.6075 13.9831C3.6075 15.1496 4.55654 16.0986 5.72303 16.0986H5.79576V20.6414C5.79576 20.8394 5.95632 21 6.15432 21H17.8457C18.0437 21 18.2042 20.8394 18.2042 20.6414V12.5488H18.277C19.4435 12.5488 20.3925 11.5998 20.3925 10.4333C20.3925 9.26674 19.4435 8.31773 18.277 8.31773ZM5.79573 15.3815H5.72299C4.95191 15.3815 4.32458 14.7542 4.32458 13.9831C4.32458 13.212 4.95191 12.5847 5.72299 12.5847H5.79573V15.3815ZM17.4871 8.31773H16.4589V7.66777C16.4589 7.37548 16.3077 7.1137 16.0546 6.96759C15.8014 6.82145 15.4992 6.82141 15.246 6.96763L13.4995 7.97612C13.2464 8.12227 13.0953 8.38404 13.0953 8.67629C13.0953 8.96855 13.2464 9.23032 13.4995 9.37643L15.246 10.385H15.246C15.3726 10.4581 15.5114 10.4946 15.6503 10.4946C15.7892 10.4946 15.928 10.458 16.0546 10.385C16.3078 10.2388 16.4589 9.97704 16.4589 9.68475V9.03478H17.4871V20.2828H6.51288V16.0986H10.8758V16.7486C10.8758 17.0409 11.0269 17.3027 11.2801 17.4488C11.4066 17.5219 11.5455 17.5584 11.6843 17.5584C11.8232 17.5584 11.9621 17.5219 12.0887 17.4488L13.8352 16.4403C14.0883 16.2941 14.2394 16.0324 14.2394 15.7401C14.2394 15.4478 14.0883 15.1861 13.8352 15.0399L12.0887 14.0314H12.0886C11.8354 13.8852 11.5332 13.8852 11.2801 14.0314C11.0269 14.1775 10.8758 14.4393 10.8758 14.7316V15.3815H6.51292V3.71712H17.4872V8.31773H17.4871ZM15.7417 7.66777V9.68486C15.7417 9.72845 15.7169 9.75197 15.696 9.76399C15.6752 9.77602 15.6424 9.78579 15.6046 9.76399L13.8581 8.75546C13.8203 8.73367 13.8124 8.70038 13.8124 8.67633C13.8124 8.65228 13.8204 8.61899 13.8581 8.59716L15.6046 7.58866C15.6424 7.56687 15.6752 7.57661 15.696 7.58866C15.7168 7.60069 15.7417 7.62417 15.7417 7.66777ZM11.5929 16.7486V14.7315C11.5929 14.6879 11.6178 14.6644 11.6386 14.6523C11.6504 14.6455 11.6661 14.6394 11.6844 14.6394C11.6983 14.6394 11.7137 14.6429 11.73 14.6524L13.4765 15.6609C13.5143 15.6827 13.5222 15.716 13.5222 15.74C13.5222 15.7641 13.5142 15.7974 13.4765 15.8192L11.73 16.8277C11.6922 16.8495 11.6594 16.8397 11.6386 16.8277C11.6178 16.8157 11.5929 16.7921 11.5929 16.7486ZM18.277 11.8317H18.2043V9.03489H18.277C19.0481 9.03489 19.6754 9.66221 19.6754 10.4333C19.6754 11.2044 19.0481 11.8317 18.277 11.8317Z" | ||
fill="currentColor" | ||
/> | ||
<path | ||
d="M15.8008 5.18726H15.5498C15.3518 5.18726 15.1912 5.34778 15.1912 5.54581C15.1912 5.74385 15.3518 5.90437 15.5498 5.90437H15.8008C15.9988 5.90437 16.1593 5.74385 16.1593 5.54581C16.1593 5.34778 15.9988 5.18726 15.8008 5.18726Z" | ||
fill="currentColor" | ||
/> | ||
<path | ||
d="M14.1514 5.18726H8.19919C8.00119 5.18726 7.84063 5.34778 7.84063 5.54581C7.84063 5.74385 8.00119 5.90437 8.19919 5.90437H14.1514C14.3494 5.90437 14.5099 5.74385 14.5099 5.54581C14.5099 5.34778 14.3494 5.18726 14.1514 5.18726Z" | ||
fill="currentColor" | ||
/> | ||
<path | ||
d="M13.0398 11.4263H8.19919C8.00119 11.4263 7.84063 11.5868 7.84063 11.7848C7.84063 11.9829 8.00119 12.1434 8.19919 12.1434H13.0398C13.2378 12.1434 13.3984 11.9829 13.3984 11.7848C13.3984 11.5868 13.2378 11.4263 13.0398 11.4263Z" | ||
fill="currentColor" | ||
/> | ||
<path | ||
d="M11.4263 7.33862H8.19919C8.00119 7.33862 7.84063 7.49915 7.84063 7.69718C7.84063 7.89522 8.00119 8.05574 8.19919 8.05574H11.4263C11.6243 8.05574 11.7848 7.89522 11.7848 7.69718C11.7848 7.49915 11.6243 7.33862 11.4263 7.33862Z" | ||
fill="currentColor" | ||
/> | ||
<path | ||
d="M11.4263 9.2749H8.19919C8.00119 9.2749 7.84063 9.43543 7.84063 9.63346C7.84063 9.8315 8.00119 9.99202 8.19919 9.99202H11.4263C11.6243 9.99202 11.7848 9.8315 11.7848 9.63346C11.7848 9.43543 11.6243 9.2749 11.4263 9.2749Z" | ||
fill="currentColor" | ||
/> | ||
</g> | ||
</g> | ||
<defs> | ||
<clipPath id="clip0_800_35"> | ||
<rect width="24" height="24" fill="white" /> | ||
</clipPath> | ||
<clipPath id="clip1_800_35"> | ||
<rect width="18" height="18" fill="white" transform="translate(3 3)" /> | ||
</clipPath> | ||
</defs> | ||
</svg> | ||
</template> |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,16 +1,5 @@ | ||
import {ref, watch} from 'vue'; | ||
import {useApp} from './useApp'; | ||
/** | ||
* Get a field from a form by name | ||
* @param {Object} form - The form object | ||
* @param {string} name - The field name to find | ||
* @returns {Object|undefined} The field object if found | ||
*/ | ||
function getField(form, name) { | ||
const fields = form.fields; | ||
|
||
return fields.find((field) => field.name === name); | ||
} | ||
|
||
/** | ||
* Check if a field exists in a form | ||
|
@@ -129,13 +118,24 @@ export function useForm(_form = {}, {customSubmit} = {}) { | |
}); | ||
} | ||
|
||
/** | ||
* Get a field from a form by name | ||
* @param {string} name - The field name to find | ||
* @returns {Object|undefined} The field object if found | ||
*/ | ||
function getField(name) { | ||
const fields = form.value.fields; | ||
|
||
return fields.find((field) => field.name === name); | ||
} | ||
|
||
/** | ||
* Get a field's value | ||
* @param {string} name - The field name | ||
* @returns {*} The field's value | ||
*/ | ||
function getValue(name) { | ||
const field = getField(form.value, name); | ||
const field = getField(name); | ||
|
||
return field.value; | ||
} | ||
|
@@ -156,7 +156,7 @@ export function useForm(_form = {}, {customSubmit} = {}) { | |
* @param {*} inputValue - The value to set | ||
*/ | ||
function setValue(name, inputValue) { | ||
const field = getField(form.value, name); | ||
const field = getField(name); | ||
if (!field) { | ||
return; | ||
} | ||
|
@@ -186,7 +186,7 @@ export function useForm(_form = {}, {customSubmit} = {}) { | |
* @param {string} fieldName - The name of the field to clear | ||
*/ | ||
function clearFormField(fieldName) { | ||
const field = getField(form.value, fieldName); | ||
const field = getField(fieldName); | ||
|
||
if (field.isMultilingual) { | ||
const newValueMultilingual = {}; | ||
|
@@ -209,7 +209,7 @@ export function useForm(_form = {}, {customSubmit} = {}) { | |
*/ | ||
function removeFieldValue(fieldName, fieldValue) { | ||
const value = getValue(fieldName); | ||
const field = getField(form.value, fieldName); | ||
const field = getField(fieldName); | ||
if (Array.isArray(value)) { | ||
let newValue = null; | ||
if (field.selected) { | ||
|
@@ -317,7 +317,10 @@ export function useForm(_form = {}, {customSubmit} = {}) { | |
form.value.visibleLocales = visibleLocales; | ||
} | ||
|
||
function initEmptyForm(formId, {action, method, locales}) { | ||
function initEmptyForm( | ||
formId, | ||
{action, method, locales, showErrorFooter, spacingVariant} = {}, | ||
) { | ||
if (!form.value) { | ||
form.value = {}; | ||
} | ||
|
@@ -327,6 +330,8 @@ export function useForm(_form = {}, {customSubmit} = {}) { | |
|
||
form.value.id = formId; | ||
form.value.locales = locales; | ||
form.value.showErrorFooter = showErrorFooter; | ||
form.value.spacingVariant = spacingVariant || 'default'; | ||
setMethod(method || 'POST'); | ||
setAction(action || 'emit'); | ||
setLocales(locales); | ||
|
@@ -393,7 +398,26 @@ export function useForm(_form = {}, {customSubmit} = {}) { | |
}); | ||
} | ||
|
||
function addFieldSelect(fieldName, {options, size, ...commonFields} = {}) { | ||
/** | ||
* Add/update a select field to the form | ||
* @param {string} fieldName - The name of the field | ||
* @param {Object} options - Options for the select field | ||
* @param {Object} commonFields - Common properties for the field | ||
* @param {Object} [override={}] - Override existing field if it exists, set this to true if updating the select options or value | ||
*/ | ||
function addFieldSelect( | ||
fieldName, | ||
{options, size, ...commonFields} = {}, | ||
{override = false} = {}, | ||
) { | ||
const field = getField(fieldName); | ||
if (field && override) { | ||
return Object.assign(field, { | ||
options: options || field.options, | ||
value: commonFields.value || field.value, | ||
}); | ||
} | ||
|
||
return addField(fieldName, { | ||
component: 'field-select', | ||
options, | ||
|
@@ -424,5 +448,6 @@ export function useForm(_form = {}, {customSubmit} = {}) { | |
addGroup, | ||
addFieldText, | ||
addFieldSelect, | ||
getField, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these functions make sense to not accept form argument. You can probably just move the getField inside the useForm so it does not need form as argument. |
||
}; | ||
} |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add comment here to clarify the options, and when someone would use them?
Actually not sure about the footerSpacingVariant purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's some styling that FormPage.vue adds to the bottom of the form, the
footerSpacingVariant
will change that to match the styling with Dialog. But I removed this now and just kept thespacingVariant
prop to handle two computed classes for styling.