Skip to content
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

QA-15315 Backport from jcontent, clearing multiple localized props #1783

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<yarn.arguments>build:production</yarn.arguments>
<require-capability>osgi.extender;filter:="(osgi.extender=org.jahia.bundles.blueprint.extender.config)"</require-capability>
<jahia-module-signature>MC0CFQCB6Tj/KAJ69o/12IxKX1yVVKkChwIUK3E0DtOtg4CPyj37SoctBH0yMFI=</jahia-module-signature>
<jahia-depends>app-shell=2.7,graphql-dxm-provider=2.19.1,jcontent=2.9</jahia-depends>
<jahia-depends>app-shell=2.7,graphql-dxm-provider=2.22.0,jcontent=2.9</jahia-depends>
<jahia.plugin.version>6.9</jahia.plugin.version>
<import-package>
com.fasterxml.jackson.annotation;version="[2.10,3)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ export const SavePropertiesMutation = gql`
mutation saveNodeProperties(
$uuid:String!,
$propertiesToSave: [InputJCRProperty],
$propertiesToDelete: [String],
$propertiesToDelete: [InputJCRDeletedProperty],
$mixinsToAdd: [String]!,
$mixinsToDelete: [String]!,
$language: String,
$shouldModifyChildren: Boolean!,
$childrenOrder: [String]!,
$shouldRename: Boolean!,
Expand All @@ -27,9 +26,7 @@ export const SavePropertiesMutation = gql`
setPropertiesBatch(properties: $propertiesToSave) {
path
}
mutateProperties(names: $propertiesToDelete) {
delete(language: $language)
}
deletePropertiesBatch(properties: $propertiesToDelete)
reorderChildren(names: $childrenOrder) @include(if: $shouldModifyChildren)
node {
...NodeCacheRequiredFields
Expand Down
5 changes: 4 additions & 1 deletion src/javascript/utils/fields.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,10 @@ function updateValue({field, value, lang, nodeData, sections, mixinsToMutate, pr
(fieldSetName &&
!mixinsToMutate.mixinsToDelete.includes(fieldSetName) &&
(hasNodeMixin(nodeData, fieldSetName) || mixinsToMutate.mixinsToAdd.includes(fieldSetName)))) {
propsToDelete.push(field.propertyName);
propsToDelete.push({
name: field.propertyName,
language: lang
});
}
}
}
Expand Down
15 changes: 12 additions & 3 deletions src/javascript/utils/fields.utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,10 @@ describe('EditPanel utils', () => {
formValues: {
[sections[0].fieldSets[2].name + '_prop']: ''
},
ExpectedPropsToDelete: ['prop'],
ExpectedPropsToDelete: [{
language: 'fr',
name: 'prop'
}],
expectedPropsFieldMapping: {
prop: sections[0].fieldSets[2].name + '_prop'
}
Expand All @@ -299,7 +302,10 @@ describe('EditPanel utils', () => {
formValues: {
[sections[0].fieldSets[2].name + '_prop']: null
},
ExpectedPropsToDelete: ['prop'],
ExpectedPropsToDelete: [{
language: 'fr',
name: 'prop'
}],
expectedPropsFieldMapping: {
prop: sections[0].fieldSets[2].name + '_prop'
}
Expand All @@ -317,7 +323,10 @@ describe('EditPanel utils', () => {
formValues: {
[sections[0].fieldSets[2].name + '_prop']: undefined
},
ExpectedPropsToDelete: ['prop'],
ExpectedPropsToDelete: [{
language: 'fr',
name: 'prop'
}],
expectedPropsFieldMapping: {
prop: sections[0].fieldSets[2].name + '_prop'
}
Expand Down
1 change: 1 addition & 0 deletions tests/provisioning-manifest-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- 'mvn:org.jahia.modules/dx-base-demo-components/2.4.0'
- 'mvn:org.jahia.modules/digitall/2.3.0'
- 'mvn:org.jahia.modules/jcontent/2.15.0'
- 'mvn:org.jahia.modules/graphql-dxm-provider/2.22.0-SNAPSHOT'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok with snapshot like that I think, but if I recall correctly it should take snapshot if you just pass 2.22.0, so when it's released we don't have to modify this file gain. You can run provisioning locally to verify, it's probably a good idea to update if it works that way.

autoStart: true
uninstallPreviousVersion: true

Expand Down
1 change: 1 addition & 0 deletions tests/provisioning-manifest-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- 'mvn:org.jahia.modules/dx-base-demo-templates/3.4.0'
- 'mvn:org.jahia.modules/dx-base-demo-components/2.4.0'
- 'mvn:org.jahia.modules/digitall/2.3.0'
- 'mvn:org.jahia.modules/graphql-dxm-provider/2.22.0-SNAPSHOT'
autoStart: true
uninstallPreviousVersion: true

Expand Down
Loading