Skip to content

Commit

Permalink
Renamed LisenceDate Property
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Lessard committed Mar 13, 2024
1 parent 40191c9 commit 353f504
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions contenthub/hydration/hydration-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export function formIsComplete(metadataSchema, formValues) {

if(formValues['gmo:licensedContent'] !== 'no'){
if(!formValues['gmo:usageTerms']) return false;
if(formValues['gmo:licensedContent'] === 'yes-expire' && !formValues['gmo:licenseDateXXX']) return false;
if(formValues['gmo:licensedContent'] === 'yes-expire' && !formValues['gmo:licenseExpiryDate']) return false;
}
return true;
};

export const licenseDateFieldShow = {
mapToProperty: 'gmo:licenseDateXXX',
mapToProperty: 'gmo:licenseExpiryDate',
label: 'Expiration Date',
placeholder: 'Select date',
required: true,
Expand All @@ -55,7 +55,7 @@ licenseExpirePerpitytity.setFullYear(licenseExpirePerpitytity.getFullYear() + 20
licenseExpirePerpitytity.setHours(23,59,59,999);

export const licenseDateFieldHidden = {
mapToProperty: 'gmo:licenseDateXXX',
mapToProperty: 'gmo:licenseExpiryDate',
element: 'hidden',
value: licenseExpirePerpitytity.toISOString()
};
Expand Down Expand Up @@ -401,5 +401,5 @@ export function getMetadataSchema(facetOptions){
value: 'approved',
element: 'hidden',
},
]
];
}
2 changes: 1 addition & 1 deletion contenthub/hydration/hydration.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export async function openUploadDialog() {
},
onMetadataFormChange: (e) => {
if (e.property === 'gmo:licensedContent') {
const licenseExpirationIndex = metadataSchema.findIndex((field) => field.mapToProperty === 'gmo:licenseDateXXX');
const licenseExpirationIndex = metadataSchema.findIndex((field) => field.mapToProperty === 'gmo:licenseExpiryDate');
if (e.value === 'yes-perpetuity') {
metadataSchema[licenseExpirationIndex] = licenseDateFieldHidden;
}else{
Expand Down

0 comments on commit 353f504

Please sign in to comment.