-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#984: moved type specific stuff into child class
- Loading branch information
Showing
5 changed files
with
46 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
|
@@ -263,6 +263,33 @@ class ImportFile extends MetadataType { | |
delete metadata.updateTypeId; | ||
return metadata; | ||
} | ||
/** | ||
* helper for {@link MetadataType.upsert} | ||
* | ||
* @param {TYPE.MetadataTypeMap} metadataMap list of metadata | ||
* @param {string} metadataKey key of item we are looking at | ||
* @param {boolean} hasError error flag from previous code | ||
* @param {TYPE.MetadataTypeItemDiff[]} metadataToUpdate list of items to update | ||
* @param {TYPE.MetadataTypeItem[]} metadataToCreate list of items to create | ||
* @returns {'create' | 'update' | 'skip'} action to take | ||
*/ | ||
static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { | ||
if (Util.OPTIONS.clear) { | ||
metadataMap[metadataKey].sendEmailNotification = false; | ||
metadataMap[metadataKey].notificationEmailAddress = ''; | ||
} else if (Util.OPTIONS.completionEmail) { | ||
metadataMap[metadataKey].sendEmailNotification = true; | ||
metadataMap[metadataKey].notificationEmailAddress = Util.OPTIONS.completionEmail; | ||
} | ||
const createOrUpdateAction = super.createOrUpdate( | ||
metadataMap, | ||
metadataKey, | ||
hasError, | ||
metadataToUpdate, | ||
metadataToCreate | ||
); | ||
return createOrUpdateAction; | ||
This comment has been minimized.
Sorry, something went wrong.
JoernBerkefeld
Contributor
|
||
} | ||
} | ||
|
||
// Assign definition to static attributes | ||
|
This file contains 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
did this find its way into the documentation update?