diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5fcbe706..482e4166 100755
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## Unreleased
+- Updated metadata mapper for DAAC specific questions
+- Updated email notification text formatting to accommodate special characters
- Updated contact information label to full name from first and last name
- Renames improperly named /api/data/submission/{operation} endpoints back to the intended /api/submission/{operation}.
- Add DAAC onboard/offboard endpoints
diff --git a/src/nodejs/lambda-handlers/submission.js b/src/nodejs/lambda-handlers/submission.js
index c9ce2616..6aa4e878 100755
--- a/src/nodejs/lambda-handlers/submission.js
+++ b/src/nodejs/lambda-handlers/submission.js
@@ -148,28 +148,31 @@ async function submitMethod(event, user) {
}
async function reviewMethod(event, user) {
+ const approvedUserPrivileges = ['ADMIN', 'REQUEST_REVIEW', 'REQUEST_REVIEW_MANAGER'];
const { id, approve } = event;
const status = await db.submission.getState({ id });
- const stepType = status.step.type;
- let eventType;
- if (approve === 'false' || !approve) {
- eventType = 'review_rejected';
- } else if (stepType === 'review') {
- eventType = 'review_approved';
- } else {
- eventType = 'workflow_promote_step';
+ if (user.user_privileges.some((privilege) => approvedUserPrivileges.includes(privilege))) {
+ const stepType = status.step.type;
+ let eventType;
+ if (approve === 'false' || !approve) {
+ eventType = 'review_rejected';
+ } else if (stepType === 'review') {
+ eventType = 'review_approved';
+ } else {
+ eventType = 'workflow_promote_step';
+ }
+ const eventMessage = {
+ event_type: eventType,
+ submission_id: id,
+ conversation_id: status.conversation_id,
+ workflow_id: status.workflow_id,
+ user_id: user.id,
+ data: status.step.data,
+ step_name: status.step_name
+ };
+ if (status.step.step_message) eventMessage.step_message = status.step.step_message;
+ await msg.sendEvent(eventMessage);
}
- const eventMessage = {
- event_type: eventType,
- submission_id: id,
- conversation_id: status.conversation_id,
- workflow_id: status.workflow_id,
- user_id: user.id,
- data: status.step.data,
- step_name: status.step_name
- };
- if (status.step.step_message) eventMessage.step_message = status.step.step_message;
- await msg.sendEvent(eventMessage);
return status;
}
diff --git a/src/nodejs/lambda-handlers/submission/metadata-mapper.js b/src/nodejs/lambda-handlers/submission/metadata-mapper.js
index 64018858..1dfa4414 100644
--- a/src/nodejs/lambda-handlers/submission/metadata-mapper.js
+++ b/src/nodejs/lambda-handlers/submission/metadata-mapper.js
@@ -23,14 +23,22 @@ const mapEDPubToUmmc = async (formData) => {
}
} : {};
+ delete formData.data_processing_level;
+ delete formData.data_processing_other_info;
+
// Previously data producer, POC, and long term contact were mapped to DataCenter
// but are being remapped to Contact Persons to avoid assumption that person is
// affiliated with a DAAC
const dataProducerSplitName = formData.data_producer_info_name?.split(' ') || [];
+ delete formData.data_producer_info_name;
+
const dataProducerAffiliation = formData.data_producer_info_organization
&& formData.data_producer_info_department
? `${formData.data_producer_info_organization} - ${formData.data_producer_info_department}`
: formData.data_producer_info_organization || formData.data_producer_info_department;
+ delete formData.data_producer_info_organization;
+ delete formData.data_producer_info_department;
+
const contactPerson = {
ContactPersons: [
{
@@ -52,11 +60,17 @@ const mapEDPubToUmmc = async (formData) => {
}
]
};
+ delete formData.data_producer_info_email;
+ delete formData.data_producer_info_orcid;
+
if (!stringToBool(formData.same_as_poc_name_data_producer_info_name)) {
const pocSplitName = formData.poc_name.split(' ') || [];
+ delete formData.poc_name;
const pocAffiliation = formData.poc_organization && formData.poc_department
? `${formData.poc_organization} - ${formData.poc_department}`
: formData.poc_organization || formData.poc_department;
+ delete formData.poc_organization;
+ delete formData.poc_department;
contactPerson.ContactPersons.push({
Roles: ['Science Contact'],
@@ -75,13 +89,22 @@ const mapEDPubToUmmc = async (formData) => {
},
NonDataCenterAffiliation: pocAffiliation
});
+ delete formData.poc_email;
+ delete formData.poc_orcid;
}
+ delete formData.same_as_poc_name_data_producer_info_name;
+
if (!stringToBool(formData.same_as_long_term_support_poc_name_data_producer_info_name) && formData.long_term_support_poc_name) {
const ltsPocSplitName = formData.long_term_support_poc_name?.split(' ') || [];
+ delete formData.long_term_support_poc_name;
+
const ltsPocAffiliation = formData.long_term_support_poc_organization
&& formData.long_term_support_poc_department
? `${formData.long_term_support_poc_organization} - ${formData.long_term_support_poc_department}`
: formData.long_term_support_poc_organization || formData.long_term_support_poc_department;
+ delete formData.long_term_support_poc_organization;
+ delete formData.long_term_support_poc_department;
+
contactPerson.ContactPersons.push({
Roles: ['Science Contact'],
FirstName: ltsPocSplitName[0] || '',
@@ -99,7 +122,11 @@ const mapEDPubToUmmc = async (formData) => {
},
NonDataCenterAffiliation: ltsPocAffiliation
});
+ delete formData.long_term_support_poc_email;
+ delete formData.long_term_support_poc_orcid;
}
+ delete formData.same_as_long_term_support_poc_name_data_producer_info_name;
+
// Previously data producer citations were mapped to additional attributes but
// is being remapped to Collection Citations since this is where it should exist
let creatorsString = '';
@@ -107,21 +134,26 @@ const mapEDPubToUmmc = async (formData) => {
const creatorString = [creator?.producer_first_name, creator.producer_middle_initial || '', creator?.producer_last_name_or_organization].join(' ');
creatorsString = creatorsString ? [creatorsString, creatorString].join(', ') : creatorString;
});
+ delete formData.data_producers_table;
+
const dataProducersTableCitations = creatorsString ? {
CollectionCitations: [{ Creator: creatorsString }]
} : {};
const abstract = { Abstract: formData.data_product_description };
+ delete formData.data_product_description;
const doi = formData.data_product_doi_value ? {
DOI: { DOI: formData.data_product_doi_value }
} : {
DOI: { MissingReason: 'Not Applicable' }
};
+ delete formData.data_product_doi_value;
const entryTitle = {
EntryTitle: formData.data_product_name_value || 'Entry Title Not Provided'
};
+ delete formData.data_product_name_value;
const temporalExtent = {
TemporalExtents: [{
@@ -133,6 +165,8 @@ const mapEDPubToUmmc = async (formData) => {
}]
}]
};
+ delete formData.product_temporal_coverage_start;
+ delete formData.product_temporal_coverage_end;
const spatialExtent = {
SpatialExtent: {
@@ -151,6 +185,11 @@ const mapEDPubToUmmc = async (formData) => {
}
}
};
+ delete formData.spatial_vertical_answer;
+ delete formData.spatial_horizontal_1_west;
+ delete formData.spatial_horizontal_1_north;
+ delete formData.spatial_horizontal_1_east;
+ delete formData.spatial_horizontal_1_south;
if (formData.spatial_horizontal_2_east || formData.spatial_horizontal_2_north
|| formData.spatial_horizontal_2_south || formData.spatial_horizontal_2_west) {
@@ -161,6 +200,10 @@ const mapEDPubToUmmc = async (formData) => {
SouthBoundingCoordinate: Number(formData.spatial_horizontal_2_south)
});
}
+ delete formData.spatial_horizontal_2_west;
+ delete formData.spatial_horizontal_2_north;
+ delete formData.spatial_horizontal_2_east;
+ delete formData.spatial_horizontal_2_south;
if (formData.spatial_horizontal_3_east || formData.spatial_horizontal_3_north
|| formData.spatial_horizontal_3_south || formData.spatial_horizontal_3_west) {
@@ -171,6 +214,10 @@ const mapEDPubToUmmc = async (formData) => {
SouthBoundingCoordinate: Number(formData.spatial_horizontal_3_south)
});
}
+ delete formData.spatial_horizontal_3_west;
+ delete formData.spatial_horizontal_3_north;
+ delete formData.spatial_horizontal_3_east;
+ delete formData.spatial_horizontal_3_south;
if (spatialExtent.SpatialExtent.SpatialCoverageType === 'HORIZONTAL_VERTICAL') {
const isDepth = formData.spatial_vertical_details_lower > formData.spatial_vertical_details_upper;
@@ -187,6 +234,10 @@ const mapEDPubToUmmc = async (formData) => {
}
];
}
+ delete formData.spatial_vertical_details_lower;
+ delete formData.spatial_vertical_details_upper;
+ delete formData.spatial_vertical_details_lower_units;
+ delete formData.spatial_vertical_details_upper_units;
// Additional Attributes
const additionalAttributes = [];
@@ -197,6 +248,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.browse_images_other
});
+ delete formData.browse_images_other;
formData.browse_images_provided && additionalAttributes.push({
Name: 'browse_images_provided',
@@ -204,6 +256,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.browse_images_provided)
});
+ delete formData.browse_images_provided;
formData.data_accession_approval_dependencies_radios && additionalAttributes.push({
Name: 'data_accession_approval_dependencies_radios',
@@ -211,6 +264,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.data_accession_approval_dependencies_radios
});
+ delete formData.data_accession_approval_dependencies_radios;
formData.data_accession_reason_description && additionalAttributes.push({
Name: 'data_accession_reason_description',
@@ -218,6 +272,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.data_accession_reason_description
});
+ delete formData.data_accession_reason_description;
formData.data_delivery_frequency && additionalAttributes.push({
Name: 'data_delivery_frequency',
@@ -225,6 +280,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.data_delivery_frequency
});
+ delete formData.data_delivery_frequency;
formData.data_file_compression_answer && additionalAttributes.push({
Name: 'data_file_compression_answer',
@@ -232,6 +288,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_file_compression_answer)
});
+ delete formData.data_file_compression_answer;
formData.data_format_ascii && additionalAttributes.push({
Name: 'data_format_ascii',
@@ -239,6 +296,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_format_ascii)
});
+ delete formData.data_format_ascii;
formData.data_format_geotiff && additionalAttributes.push({
Name: 'data_format_geotiff',
@@ -246,6 +304,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_format_geotiff)
});
+ delete formData.data_format_geotiff;
formData.data_format_hdf5 && additionalAttributes.push({
Name: 'data_format_hdf5',
@@ -253,6 +312,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_format_hdf5)
});
+ delete formData.data_format_hdf5;
formData.data_format_hdf_eos && additionalAttributes.push({
Name: 'data_format_hdf_eos',
@@ -260,6 +320,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_format_hdf_eos)
});
+ delete formData.data_format_hdf_eos;
formData.data_format_ogc_kml && additionalAttributes.push({
Name: 'data_format_ogc_kml',
@@ -267,6 +328,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_format_ogc_kml)
});
+ delete formData.data_format_ogc_kml;
formData.data_format_netcdf_4 && additionalAttributes.push({
Name: 'data_format_netcdf_4',
@@ -274,6 +336,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_format_netcdf_4)
});
+ delete formData.data_format_netcdf_4;
formData.data_format_netcdf_classic && additionalAttributes.push({
Name: 'data_format_netcdf_classic',
@@ -281,6 +344,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_format_netcdf_classic)
});
+ delete formData.data_format_netcdf_classic;
formData.data_format_other && formData.data_format_other_info && additionalAttributes.push({
Name: 'data_format_other',
@@ -288,6 +352,8 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_format_other)
});
+ delete formData.data_format_other;
+ delete formData.data_format_other_info;
formData.data_product_documentation_url && additionalAttributes.push({
Name: 'data_product_documentation_url',
@@ -295,6 +361,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.data_product_documentation_url
});
+ delete formData.data_product_documentation_url;
// The Additional Attributes value property in UMMC v1.17.0 must be a string
// even if the data type is not a string
@@ -304,6 +371,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'INT',
Value: formData.data_product_number_of_files
});
+ delete formData.data_product_number_of_files;
// Added more context to question in description field
formData.data_product_restrictions_explanation && additionalAttributes.push({
@@ -312,6 +380,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.data_product_restrictions_explanation
});
+ delete formData.data_product_restrictions_explanation;
formData.data_product_restrictions_public && additionalAttributes.push({
Name: 'data_product_restrictions_public',
@@ -319,6 +388,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.data_product_restrictions_public
});
+ delete formData.data_product_restrictions_public;
formData.data_product_status && additionalAttributes.push({
Name: 'data_product_status',
@@ -326,6 +396,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_product_status)
});
+ delete formData.data_product_status;
formData.data_product_type_model && additionalAttributes.push({
Name: 'data_product_type_model',
@@ -333,6 +404,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_product_type_model)
});
+ delete formData.data_product_type_model;
formData.data_product_type_observational && additionalAttributes.push({
Name: 'data_product_type_observational',
@@ -340,6 +412,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.data_product_type_observational)
});
+ delete formData.data_product_type_observational;
// The Additional Attributes value property in UMMC v1.17.0 must be a string
// even if the data type is not a string
@@ -350,6 +423,8 @@ const mapEDPubToUmmc = async (formData) => {
Value: formData.data_product_volume_amount,
ParameterUnitsOfMeasure: formData.data_product_volume_units
});
+ delete formData.data_product_volume_amount;
+ delete formData.data_product_volume_units;
formData.data_production_latency_units && additionalAttributes.push({
Name: 'data_production_latency_units',
@@ -357,6 +432,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.data_production_latency_units
});
+ delete formData.data_production_latency_units;
formData.example_file_url && additionalAttributes.push({
Name: 'example_file_url',
@@ -364,6 +440,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.example_file_url
});
+ delete formData.example_file_url;
// The Additional Attributes value property in UMMC v1.17.0 must be a string
// even if the data type is not a string
@@ -374,6 +451,8 @@ const mapEDPubToUmmc = async (formData) => {
Value: formData.file_temporal_coverage_answer,
ParameterUnitsOfMeasure: formData.file_temporal_coverage_units
});
+ delete formData.file_temporal_coverage_answer;
+ delete formData.file_temporal_coverage_units;
formData.funding_grant_number && additionalAttributes.push({
Name: 'funding_grant_number',
@@ -381,6 +460,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.funding_grant_number
});
+ delete formData.funding_grant_number;
formData.funding_nasa && additionalAttributes.push({
Name: 'funding_nasa',
@@ -388,6 +468,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.funding_nasa)
});
+ delete formData.funding_nasa;
formData.funding_noaa && additionalAttributes.push({
Name: 'funding_noaa',
@@ -395,6 +476,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.funding_noaa)
});
+ delete formData.funding_noaa;
formData.funding_nsf && additionalAttributes.push({
Name: 'funding_nsf',
@@ -402,6 +484,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.funding_nsf)
});
+ delete formData.funding_nsf;
formData.funding_organization_other && additionalAttributes.push({
Name: 'funding_organization_other',
@@ -409,6 +492,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.funding_organization_other
});
+ delete formData.funding_organization_other;
formData.funding_other && additionalAttributes.push({
Name: 'funding_other',
@@ -416,6 +500,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.funding_other)
});
+ delete formData.funding_other;
formData.funding_program_name && additionalAttributes.push({
Name: 'funding_program_name',
@@ -423,6 +508,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.funding_program_name
});
+ delete formData.funding_program_name;
formData.funding_university && additionalAttributes.push({
Name: 'funding_university',
@@ -430,6 +516,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.funding_university)
});
+ delete formData.funding_university;
formData.funding_usgs && additionalAttributes.push({
Name: 'funding_usgs',
@@ -437,6 +524,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'BOOLEAN',
Value: stringToBoolString(formData.funding_usgs)
});
+ delete formData.funding_usgs;
formData.model_data_product && additionalAttributes.push({
Name: 'model_data_product',
@@ -444,6 +532,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.model_data_product
});
+ delete formData.model_data_product;
formData.platform_instrument && additionalAttributes.push({
Name: 'platform_instrument',
@@ -451,6 +540,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.platform_instrument
});
+ delete formData.platform_instrument;
formData.science_value_description && additionalAttributes.push({
Name: 'science_value_description',
@@ -458,6 +548,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.science_value_description
});
+ delete formData.science_value_description;
// The Additional Attributes value property in UMMC v1.17.0 must be a string
// even if the data type is not a string
@@ -468,6 +559,8 @@ const mapEDPubToUmmc = async (formData) => {
Value: formData.value_temporal_resolution_answer,
ParameterUnitsOfMeasure: formData.value_temporal_resolution_units
});
+ delete formData.value_temporal_resolution_answer;
+ delete formData.value_temporal_resolution_units;
formData.variables_text && additionalAttributes.push({
Name: 'variables_text',
@@ -475,6 +568,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.variables_text
});
+ delete formData.variables_text;
// The following were mapped to variables which don't actually exist in UMM-C so
// they have been remapped to the additional attributes section
@@ -484,6 +578,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.data_accession_approval_dependencies_explanation
});
+ delete formData.data_accession_approval_dependencies_explanation;
formData.spatial_data_file && additionalAttributes.push({
Name: 'spatial_data_file',
@@ -491,6 +586,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.spatial_data_file
});
+ delete formData.spatial_data_file;
formData.spatial_general_region && additionalAttributes.push({
Name: 'spatial_general_region',
@@ -498,6 +594,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.spatial_general_region
});
+ delete formData.spatial_general_region;
formData.spatial_notes_textarea && additionalAttributes.push({
Name: 'spatial_notes_textarea',
@@ -505,6 +602,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.spatial_notes_textarea
});
+ delete formData.spatial_notes_textarea;
formData.spatial_resolution && additionalAttributes.push({
Name: 'spatial_resolution',
@@ -512,6 +610,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.spatial_resolution
});
+ delete formData.spatial_resolution;
formData.temporal_coverage_notes_textarea && additionalAttributes.push({
Name: 'temporal_coverage_notes_textarea',
@@ -519,6 +618,7 @@ const mapEDPubToUmmc = async (formData) => {
DataType: 'STRING',
Value: formData.temporal_coverage_notes_textarea
});
+ delete formData.temporal_coverage_notes_textarea;
const metadataDates = {
MetadataDates: [
@@ -541,6 +641,17 @@ const mapEDPubToUmmc = async (formData) => {
}
};
+ // Added to capture DAAC specific questions
+ Object.keys(formData).forEach((extra) => {
+ additionalAttributes.push({
+ Name: extra,
+ Description: `Additional EDPub Form Response with id: ${extra}`,
+ DataType: 'STRING',
+ Value: typeof formData[extra] === 'object' ? JSON.stringify(formData[extra]) : `${formData[extra]}`
+ });
+ delete formData[extra];
+ });
+
// Stringify then parse to avoid errors with undefined in JSON by removing attributes
// with undefined value
// TODO- Test how CMR handles this in case some are required attributes
diff --git a/src/nodejs/lambda-handlers/test/handlers/submission.test.js b/src/nodejs/lambda-handlers/test/handlers/submission.test.js
index a713cd9d..c3f40d29 100644
--- a/src/nodejs/lambda-handlers/test/handlers/submission.test.js
+++ b/src/nodejs/lambda-handlers/test/handlers/submission.test.js
@@ -177,6 +177,7 @@ describe('submission', () => {
id: 'test id',
approve: true
};
+ db.user.findById.mockReturnValue({ id: 'test user', user_privileges: ['REQUEST_REVIEW'] });
db.submission.getState.mockReturnValue({
conversation_id: 'test conversation',
workflow_id: 'test workflow',
diff --git a/src/nodejs/lambda-handlers/user.js b/src/nodejs/lambda-handlers/user.js
index 19bb8635..4994cff9 100644
--- a/src/nodejs/lambda-handlers/user.js
+++ b/src/nodejs/lambda-handlers/user.js
@@ -77,6 +77,12 @@ async function createMethod(params, privileges) {
return { error: 'No privilege' };
}
+async function updateUsername(params) {
+ const { name, id } = params;
+ const resp = await db.user.updateUsername({ name, id });
+ return resp;
+}
+
async function findMethod(params, privileges) {
if (privileges.includes('ADMIN')
|| privileges.includes('USER_READ')) {
@@ -144,7 +150,8 @@ const operations = {
remove_group: removeGroupMethod,
add_role: addRoleMethod,
remove_role: removeRoleMethod,
- get_users: getUsersMethod
+ get_users: getUsersMethod,
+ update_username: updateUsername
};
async function handler(event) {
diff --git a/src/nodejs/lambda-layers/database-util/src/query/parsers.js b/src/nodejs/lambda-layers/database-util/src/query/parsers.js
index 65f6a2ec..d4081d5b 100755
--- a/src/nodejs/lambda-layers/database-util/src/query/parsers.js
+++ b/src/nodejs/lambda-layers/database-util/src/query/parsers.js
@@ -8,6 +8,7 @@ function many({ rows }) {
module.exports.find = many;
module.exports.findById = one;
+module.exports.updateUsername = one;
module.exports.findByName = one;
module.exports.findAll = many;
module.exports.findAllEx = many;
diff --git a/src/nodejs/lambda-layers/database-util/src/query/user.js b/src/nodejs/lambda-layers/database-util/src/query/user.js
index e74f3c70..95b33176 100755
--- a/src/nodejs/lambda-layers/database-util/src/query/user.js
+++ b/src/nodejs/lambda-layers/database-util/src/query/user.js
@@ -394,6 +394,12 @@ detailed = {{detailed}}
WHERE edpuser.id = {{id}}
RETURNING *`;
+const updateUsername = () => `
+UPDATE edpuser SET
+name = {{name}}
+WHERE edpuser.id = {{id}}
+RETURNING *`;
+
const getUnknownStaffIds = (params) => sql.select({
fields: ['id'],
from: {
@@ -431,4 +437,5 @@ module.exports.getEmails = getEmails;
module.exports.findByEmail = findByEmail;
module.exports.getUsers = getUsers;
module.exports.setDetail = setDetail;
-module.exports.getUnknownStaffIds = getUnknownStaffIds;
\ No newline at end of file
+module.exports.updateUsername = updateUsername;
+module.exports.getUnknownStaffIds = getUnknownStaffIds;
diff --git a/src/nodejs/lambda-layers/message-util/src/templates/direct-message.js b/src/nodejs/lambda-layers/message-util/src/templates/direct-message.js
index 3e3217a6..4d1d738f 100644
--- a/src/nodejs/lambda-layers/message-util/src/templates/direct-message.js
+++ b/src/nodejs/lambda-layers/message-util/src/templates/direct-message.js
@@ -21,7 +21,7 @@ const getDMTemplate = (params, envUrl) => {
Hello ${params.user.name},
You have received a direct message on the Earthdata Pub Dashboard.
- Message:${params.eventMessage.conversation_last_message}
+ Message:${decodeURI(params.eventMessage.conversation_last_message)}
${envUrl}/dashboard
|
diff --git a/src/openapi/openapi.json b/src/openapi/openapi.json
index cc5f5036..3812c3f6 100755
--- a/src/openapi/openapi.json
+++ b/src/openapi/openapi.json
@@ -7506,7 +7506,7 @@
"required": true,
"schema": {
"type": "string",
- "enum": ["find", "add_group", "remove_group", "add_role", "remove_role", "add_permission", "create", "get_users"]
+ "enum": ["find", "add_group", "remove_group", "add_role", "remove_role", "add_permission", "create", "get_users", "update_username"]
}
}
],
diff --git a/src/postgres/7-seed.sql b/src/postgres/7-seed.sql
index 47c2da47..df6b8780 100755
--- a/src/postgres/7-seed.sql
+++ b/src/postgres/7-seed.sql
@@ -5,7 +5,7 @@ INSERT INTO form VALUES ('19025579-99ca-4344-8610-704dae626343', 'data_publicati
INSERT INTO form VALUES ('de7e5c40-584a-493b-919d-8f7f3f1e9e3c', 'confirmation_form', 1, 'Confirmation Form', 'This form is used to confirm request information which might be used for external applications such as collection metadata curation.');
-- Action(id, short_name, version, long_name, description, source)
-INSERT INTO action VALUES ('3fe93672-cd91-45d4-863b-c6d0d63f8c8c', 'send_to_meditor', 1, 'Send To mEditor Action', 'This action is used to send collection metadata from EDPub to mEditor.', 'sendToMeditor.js');
+INSERT INTO action VALUES ('3fe93672-cd91-45d4-863b-c6d0d63f8c8c', 'send_to_mmt', 1, 'Send To MMT Action', 'This action is used to send collection metadata from EDPub to MMT.', 'sendToMMT.js');
INSERT INTO action VALUES ('f812eb99-7c4a-46a8-8d8f-30ae509fe21c', 'map_edpub_to_ummc', 1, 'Map EDPub To UMMC Action', 'This action is map EDPub question reponses to a JSON UMMC format.', 'mapEDPubToUmmc.js');
-- Section(id, form_id, heading, list_order, daac_id)
@@ -58,14 +58,14 @@ INSERT INTO question VALUES ('7fd7bccf-5065-4033-9956-9e80bc99c205', 'science_va
INSERT INTO question VALUES ('bd00dbb7-1d3c-46fa-82a4-734236f4e06c', 'data_accession_reason', 1, 'Reason for Data Accession Request', 'Why are you requesting to have this data product archived and distributed at the DAAC?', 'For example, you are publishing a paper and the publisher requires data to be archived in a trusted repository, you have been instructed by a NASA program manager to archive your data at a DAAC, or you want this data product to be distributed with related data products.');
INSERT INTO question VALUES ('f40956c3-9af8-400e-8dd8-c5e2965dcb8a', 'data_accession_approval_dependencies', 1, 'Dependencies for Data Accession Approval', 'Do you have any dependencies related to this data product being approved to be published at the DAAC?', 'For example, you are publishing a paper, you are presenting at a conference, or your project has a requirement to publish data by a certain time.');
INSERT INTO question VALUES ('2dd6c8b1-22a8-4866-91c3-da9b4ce849dc', 'data_product_restrictions', 1, 'Open Data Policy', 'Can this data product be publicly released in compliance with NASA''s Open Data Policy?', 'For a description of the open data policy, please refer to the NASA Earthdata Data and Information Policy web page .');
-INSERT INTO question VALUES ('ad568b2f-89fe-4afd-a0bf-9e5832b71ce9', 'data_product_documentation', 1, 'Data Product Documentation', 'Are there any existing documents that you would like to have included in the review of your data product? If "Yes", please provide URLs to the documents.', 'For example, these documents may include descriptions of the variables, filename conventions, processing steps, and/or data quality.');
+INSERT INTO question VALUES ('ad568b2f-89fe-4afd-a0bf-9e5832b71ce9', 'data_product_documentation', 1, 'Data Product Documentation', 'Are there any existing documents that you would like to have included in the review of your data product? If "Yes", please upload the document(s).', 'For example, these documents may include descriptions of the variables, filename conventions, processing steps, and/or data quality. If you have more than 5 documents, please contact the DAAC for assistance. Files must be less than 5 GB and cannot include .exe or .dll extensions.');
INSERT INTO question VALUES ('50e8d566-b9ab-4bd9-9adc-92a3c8fb5d27', 'data_format', 1, 'Data Format', 'What file format(s) does this data product include?', 'For a list of NASA-approved data formats, please refer to the NASA Earthdata Standards and Practices web page .', True);
INSERT INTO question VALUES ('228cb0d6-78fb-449a-8061-b1e6fb3f59d1', 'spatial_general', 1, 'Data Product Spatial Region', 'What is the general geographic region covered by this data product?', 'Examples include Global, Northern Hemisphere, Alaska, Korean Peninsula, East Tropical Pacific, or Gulf Stream.');
INSERT INTO question VALUES ('4f2dd369-d865-47ba-8504-8694493f129f', 'product_temporal_coverage', 1, 'Data Product Temporal Coverage', 'What period of time is covered by the entire data product, upon planned delivery to the DAAC?', 'The temporal coverage should encompass the beginning date of the first data file and the ending date of the last data file at the time of initial delivery to the DAAC, even if there are time gaps or data production will be ongoing.');
INSERT INTO question VALUES ('dbf70495-433a-439e-8173-0cb20f972c16', 'data_product_status', 1, 'Ongoing Data Production', 'After this data product has been published at the DAAC, will you continue to collect or produce new data files to extend the temporal coverage?', '');
INSERT INTO question VALUES ('4c42796a-8ff1-444e-8fc5-82ccad82e5fb', 'data_delivery_frequency', 1, 'Frequency of Data Deliveries', 'What is the anticipated frequency of additional data deliveries to the DAAC?', '');
INSERT INTO question VALUES ('40672516-2220-4edc-8c1b-fd9f7e0b978f', 'data_product_volume', 1, 'Data Product Volume', 'What is the estimated or actual total volume of this data product?', 'The DAAC uses the total volume of the final data product to plan data storage requirements. If the final data product is not complete, please provide your best estimate for the total data volume.');
-INSERT INTO question VALUES ('53a0faa7-f7d4-4ce9-a9dc-a13cef44e1f3', 'sample_data_file', 1, 'Sample Data File(s)', 'Please provide a URL to a sample file(s).', 'Providing sample data files that are representative of the range of data within this data product will help the DAAC understand and provide feedback on the data format, structure, and content.');
+INSERT INTO question VALUES ('53a0faa7-f7d4-4ce9-a9dc-a13cef44e1f3', 'sample_data_file', 1, 'Sample Data File(s)', 'Please upload a sample file(s).', 'Providing sample data files that are representative of the range of data within this data product will help the DAAC understand and provide feedback on the data format, structure, and content. If more than 5 sample data files are necessary to represent the data product, please contact the DAAC for assistance. Files must be less than 5 GB and cannot include .exe or .dll extensions.', True);
INSERT INTO question VALUES ('f3e2eab9-6375-4e53-9cc2-3d16f318d332', 'long_term_support_point_of_contact', 1, 'Long-term Support Point of Contact', 'Once publication is completed, who should the DAAC contact with questions regarding this data product?', 'DAACs may need assistance in answering questions from data product users. For example, questions related to data algorithm and processing approaches, calibration/validation assessments, or instrumentation.');
INSERT INTO question VALUES ('d2bc7af7-211e-494a-a0bd-11b44f112eaa', 'funding_grant', 1, 'Grant Number', 'If available, please provide the grant number for the funding that supported the creation of this data product.', 'For example, NNX08AZ90A.');
INSERT INTO question VALUES ('8a364184-42ac-48fe-b831-acb2eb08c729', 'list_of_data_producers_and_groups', 1, 'Data Producers for Data Citation', 'Please list the people or groups that were involved in the creation of this data product in the order that they should be credited in the data product citation.', 'The DAAC will use this information to construct a data product citation, which is a reference to data for the purpose of credit attribution and facilitation of data access.
Example data product citations:
McGill, Matthew , Dennis L Hlavka, John E. Yorks and Patrick A. Selmer. 2019. GOES-R PLT Cloud Physics LiDAR (CPL). Dataset available online from the NASA Global Hydrometeorology Resource Center DAAC, Huntsville, Alabama, U.S.A. DOI: http://dx.doi.org/10.5067/GOESRPLT/CPL/DATA101
CARVE Science Team. 2017. CARVE: In-flight Photos from the CARVE Aircraft, Alaska, 2013-2015. ORNL DAAC, Oak Ridge, Tennessee, USA. https://doi.org/10.3334/ORNLDAAC/1435');
@@ -186,7 +186,8 @@ INSERT INTO input VALUES ('f40956c3-9af8-400e-8dd8-c5e2965dcb8a', 'data_accessio
INSERT INTO input VALUES ('f40956c3-9af8-400e-8dd8-c5e2965dcb8a', 'data_accession_approval_dependencies_explanation', 1, 'If Yes, please provide a brief explanation.', 'text', '{}', '{}', '[{"field": "data_accession_approval_dependencies_radios","value": "Yes"}]','[]', False);
INSERT INTO input VALUES ('2dd6c8b1-22a8-4866-91c3-da9b4ce849dc', 'data_product_restrictions_public', 0, '', 'radio', '["Yes","No","Not sure"]', '{}', '[]','[]', True);
INSERT INTO input VALUES ('2dd6c8b1-22a8-4866-91c3-da9b4ce849dc', 'data_product_restrictions_explanation', 1, 'If No or Not sure, please provide a brief explanation.', 'text', '{}', '{}', '[{"field": "data_product_restrictions_public","value": "No"},{"field": "data_product_restrictions_public","value": "Not sure"}]','[]', False);
-INSERT INTO input VALUES ('ad568b2f-89fe-4afd-a0bf-9e5832b71ce9', 'data_product_documentation_url', 0, '', 'text', '{}', '{}', '[]','[]', False);
+INSERT INTO input VALUES ('ad568b2f-89fe-4afd-a0bf-9e5832b71ce9', 'data_product_documentation_url', 1, 'Alternatively provide a URL to the document(s)', 'text', '{}', '{}', '[]','[]', False);
+INSERT INTO input VALUES ('ad568b2f-89fe-4afd-a0bf-9e5832b71ce9', 'data_product_documentation', 0, '', 'file', '{}', '{}', '[]','[]', False);
INSERT INTO input VALUES ('50e8d566-b9ab-4bd9-9adc-92a3c8fb5d27', 'data_format_ascii', 0, 'ASCII', 'checkbox', '{}', '{}', '[]','[]', False);
INSERT INTO input VALUES ('50e8d566-b9ab-4bd9-9adc-92a3c8fb5d27', 'data_format_geotiff', 1, 'GeoTIFF', 'checkbox', '{}', '{}', '[]','[]', False);
INSERT INTO input VALUES ('50e8d566-b9ab-4bd9-9adc-92a3c8fb5d27', 'data_format_hdf5', 2, 'HDF 5', 'checkbox', '{}', '{}', '[]','[]', False);
@@ -203,7 +204,8 @@ INSERT INTO input VALUES ('dbf70495-433a-439e-8173-0cb20f972c16', 'data_product_
INSERT INTO input VALUES ('4c42796a-8ff1-444e-8fc5-82ccad82e5fb', 'data_delivery_frequency', 0, '', 'radio', '["Sub-Daily","Daily","Weekly","Monthly","Quarterly","Yearly","Varies"]', '{}', '[]','[]', False);
INSERT INTO input VALUES ('40672516-2220-4edc-8c1b-fd9f7e0b978f', 'data_product_volume_amount', 0, '', 'number', '{}', '{"min": "1"}', '[]','[]', True);
INSERT INTO input VALUES ('40672516-2220-4edc-8c1b-fd9f7e0b978f', 'data_product_volume_units', 1, '', 'radio', '["KB","MB","GB","TB","PB"]', '{}', '[]','[]', True);
-INSERT INTO input VALUES ('53a0faa7-f7d4-4ce9-a9dc-a13cef44e1f3', 'example_file_url', 0, '', 'text', '{}', '{}', '[]','[]', False);
+INSERT INTO input VALUES ('53a0faa7-f7d4-4ce9-a9dc-a13cef44e1f3', 'example_file_url', 1, 'Alternatively provide a URL to a sample file(s)', 'text', '{}', '{}', '[]','[]', False);
+INSERT INTO input VALUES ('53a0faa7-f7d4-4ce9-a9dc-a13cef44e1f3', 'example_files', 0, '', 'file', '{}', '{}', '[]','[]', False);
INSERT INTO input VALUES ('f3e2eab9-6375-4e53-9cc2-3d16f318d332', 'long_term_support_poc_name', 0, 'Full Name', 'text', '{}', '{}', '[]','[]', True);
INSERT INTO input VALUES ('f3e2eab9-6375-4e53-9cc2-3d16f318d332', 'long_term_support_poc_organization', 1, 'Organization', 'text', '{}', '{}', '[]','[]', True);
INSERT INTO input VALUES ('f3e2eab9-6375-4e53-9cc2-3d16f318d332', 'long_term_support_poc_department', 2, 'Department', 'text', '{}', '{}', '[]','[]', False);
@@ -285,6 +287,7 @@ INSERT INTO privilege VALUES ('REQUEST_RESUME');
INSERT INTO privilege VALUES ('REQUEST_SUBMIT');
INSERT INTO privilege VALUES ('REQUEST_APPLY');
INSERT INTO privilege VALUES ('REQUEST_REVIEW');
+INSERT INTO privilege VALUES ('REQUEST_REVIEW_MANAGER');
INSERT INTO privilege VALUES ('REQUEST_REASSIGN');
INSERT INTO privilege VALUES ('REQUEST_LOCK');
INSERT INTO privilege VALUES ('REQUEST_UNLOCK');
@@ -398,6 +401,7 @@ INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'R
INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'REQUEST_LOCK');
INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'REQUEST_UNLOCK');
INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'REQUEST_REASSIGN');
+INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'REQUEST_REVIEW_MANAGER');
INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'DAAC_READ');
INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'USER_READ');
INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'USER_ADDGROUP');
@@ -439,17 +443,17 @@ INSERT INTO step(step_name, type, data) VALUES ('data_publication_request_form_r
INSERT INTO step(step_name, type, data) VALUES ('assign_a_workflow', 'action', '{"rollback":"init","type": "init"}');
INSERT INTO step(step_name, type, data) VALUES ('start_qa', 'action', '{"rollback":"data_publication_request_form_review","type": "review","form_id":"19025579-99ca-4344-8610-704dae626343"}');
INSERT INTO step(step_name, type, data) VALUES ('complete_qa', 'action', '{"rollback":"start_qa","type": "action"}');
-INSERT INTO step(step_name, type, data) VALUES ('map_to_meditor', 'action', '{"rollback":"complete_qa","type": "action"}');
-INSERT INTO step(step_name, type, data) VALUES ('start_meditor_editing', 'action', '{"rollback":"send_to_meditor","type": "action"}');
-INSERT INTO step(step_name, type, data) VALUES ('complete_meditor_editing', 'action', '{"rollback":"start_meditor_editing","type": "action"}');
-INSERT INTO step(step_name, type, data) VALUES ('get_from_meditor', 'action', '{"rollback":"complete_meditor_editing","type": "action"}');
-INSERT INTO step(step_name, type, data) VALUES ('map_from_meditor', 'action', '{"rollback":"get_from_meditor","type": "action"}');
-INSERT INTO step(step_name, type, data) VALUES ('publish_to_cmr', 'action', '{"rollback":"map_from_meditor","type": "action"}');
-INSERT INTO step(step_name, type, action_id) VALUES ('send_to_meditor', 'action', '3fe93672-cd91-45d4-863b-c6d0d63f8c8c');
+INSERT INTO step(step_name, type, data) VALUES ('map_to_mmt', 'action', '{"rollback":"complete_qa","type": "action"}');
+INSERT INTO step(step_name, type, data) VALUES ('start_mmt_editing', 'action', '{"rollback":"send_to_mmt","type": "action"}');
+INSERT INTO step(step_name, type, data) VALUES ('complete_mmt_editing', 'action', '{"rollback":"start_mmt_editing","type": "action"}');
+INSERT INTO step(step_name, type, data) VALUES ('get_from_mmt', 'action', '{"rollback":"complete_mmt_editing","type": "action"}');
+INSERT INTO step(step_name, type, data) VALUES ('map_from_mmt', 'action', '{"rollback":"get_from_mmt","type": "action"}');
+INSERT INTO step(step_name, type, data) VALUES ('publish_to_cmr', 'action', '{"rollback":"map_from_mmt","type": "action"}');
+INSERT INTO step(step_name, type, action_id) VALUES ('send_to_mmt', 'action', '3fe93672-cd91-45d4-863b-c6d0d63f8c8c');
INSERT INTO step(step_name, type, form_id) VALUES ('confirmation_form', 'form', 'de7e5c40-584a-493b-919d-8f7f3f1e9e3c');
INSERT INTO step(step_name, type, action_id, data) VALUES ('map_question_response_to_ummc', 'action', 'f812eb99-7c4a-46a8-8d8f-30ae509fe21c', '{"rollback":"confirmation_form","type": "action"}');
-INSERT INTO step(step_id, step_name, type, data) VALUES ('d1cbc4a8-ce4c-4734-8e71-a824d30c401a', 'edit_metadata_in_meditor_after_publication_form_review', 'action', '{"rollback":"send_to_meditor_after_publication_form_review","type": "action"}');
-INSERT INTO step(step_id, step_name, type, data) VALUES ('c628d63b-93b9-45ae-8e7b-a903554b6726', 'send_to_meditor_after_publication_form_review', 'action', '{"rollback":"map_question_response_to_ummc","type": "action"}');
+INSERT INTO step(step_id, step_name, type, data) VALUES ('d1cbc4a8-ce4c-4734-8e71-a824d30c401a', 'edit_metadata_in_mmt_after_publication_form_review', 'action', '{"rollback":"send_to_mmt_after_publication_form_review","type": "action"}');
+INSERT INTO step(step_id, step_name, type, data) VALUES ('c628d63b-93b9-45ae-8e7b-a903554b6726', 'send_to_mmt_after_publication_form_review', 'action', '{"rollback":"map_question_response_to_ummc","type": "action"}');
-- Unknown DAAC
-- StepEdge(workflow_id, step_name, next_step_name)
@@ -485,14 +489,16 @@ INSERT INTO step_edge VALUES ('a218f99d-cfc1-44e5-b203-3e447e1c1275', 'push_to_o
-- GES DISC
-- Step(step_id, step_name, type, action_id, form_id, service_id, data)
-INSERT INTO step(step_id, step_name, type, data) VALUES ('c81066db-0566-428d-87e8-94169ce5a9b9', 'data_publication_request_form_uwg_review', 'review', '{"rollback":"data_publication_request_form_review","type": "review","form_id":"19025579-99ca-4344-8610-704dae626343"}');
+INSERT INTO step(step_id, step_name, type, data) VALUES ('e62e9548-b350-40ec-b1bc-21a75e5f0407', 'data_publication_request_form_management_review', 'review', '{"rollback":"data_publication_request_form_review","type": "review","form_id":"19025579-99ca-4344-8610-704dae626343"}');
+INSERT INTO step(step_id, step_name, type, data) VALUES ('c81066db-0566-428d-87e8-94169ce5a9b9', 'data_publication_request_form_uwg_review', 'review', '{"rollback":"data_publication_request_form_management_review","type": "review","form_id":"19025579-99ca-4344-8610-704dae626343"}');
INSERT INTO step(step_id, step_name, type, data) VALUES ('7838ed18-4ecd-499e-9a47-91fd181cbfc7', 'data_publication_request_form_esdis_review', 'review', '{"rollback":"data_publication_request_form_uwg_review","type": "review","form_id":"19025579-99ca-4344-8610-704dae626343"}');
-- StepEdge(workflow_id, step_name, next_step_name)
INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'init', 'data_accession_request_form');
INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_accession_request_form', 'data_accession_request_form_review');
INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_accession_request_form_review', 'data_publication_request_form');
INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_publication_request_form', 'data_publication_request_form_review');
-INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_publication_request_form_review', 'data_publication_request_form_uwg_review');
+INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_publication_request_form_review', 'data_publication_request_form_management_review');
+INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_publication_request_form_management_review', 'data_publication_request_form_uwg_review');
INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_publication_request_form_uwg_review', 'data_publication_request_form_esdis_review');
INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_publication_request_form_esdis_review', 'close');
@@ -534,13 +540,13 @@ INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'data_acce
INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'data_publication_request_form', 'data_publication_request_form_review');
INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'data_publication_request_form_review', 'start_qa');
INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'start_qa', 'complete_qa');
-INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'complete_qa', 'map_to_meditor');
-INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'map_to_meditor', 'send_to_meditor');
-INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'send_to_meditor', 'start_meditor_editing');
-INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'start_meditor_editing', 'complete_meditor_editing');
-INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'complete_meditor_editing', 'get_from_meditor');
-INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'get_from_meditor', 'map_from_meditor');
-INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'map_from_meditor', 'publish_to_cmr');
+INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'complete_qa', 'map_to_mmt');
+INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'map_to_mmt', 'send_to_mmt');
+INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'send_to_mmt', 'start_mmt_editing');
+INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'start_mmt_editing', 'complete_mmt_editing');
+INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'complete_mmt_editing', 'get_from_mmt');
+INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'get_from_mmt', 'map_from_mmt');
+INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'map_from_mmt', 'publish_to_cmr');
INSERT INTO step_edge VALUES ('c1690729-b67e-4675-a1a5-b2323f347dff', 'publish_to_cmr', 'close');
-- PODAAC
diff --git a/src/postgres/9-updates.sql b/src/postgres/9-updates.sql
index ff5ecdd3..9ff5e222 100644
--- a/src/postgres/9-updates.sql
+++ b/src/postgres/9-updates.sql
@@ -106,3 +106,103 @@ INSERT INTO step_edge VALUES ('3335970e-8a9b-481b-85b7-dfaaa3f5dbd9', 'data_acce
INSERT INTO step_edge VALUES ('3335970e-8a9b-481b-85b7-dfaaa3f5dbd9', 'data_accession_request_form_review', 'assign_a_workflow');
UPDATE daac SET workflow_id = '3335970e-8a9b-481b-85b7-dfaaa3f5dbd9', edpgroup_id ='5be24b44-d66b-4396-9266-a9d066000d9e' WHERE id= '1c36f0b9-b7fd-481b-9cab-3bc3cea35413';
+
+--4/15/2024 Updating Upload Questions
+UPDATE question SET text = 'Are there any existing documents that you would like to have included in the review of your data product? If "Yes", please upload the document(s).', help = 'For example, these documents may include descriptions of the variables, filename conventions, processing steps, and/or data quality. If you have more than 5 documents, please contact the DAAC for assistance. Files must be less than 5 GB and cannot include .exe or .dll extensions.' WHERE id = 'ad568b2f-89fe-4afd-a0bf-9e5832b71ce9';
+UPDATE question SET text = 'Please upload a sample file(s).', help = 'Providing sample data files that are representative of the range of data within this data product will help the DAAC understand and provide feedback on the data format, structure, and content. If more than 5 sample data files are necessary to represent the data product, please contact the DAAC for assistance. Files must be less than 5 GB and cannot include .exe or .dll extensions.', required = True WHERE id = '53a0faa7-f7d4-4ce9-a9dc-a13cef44e1f3';
+UPDATE input SET list_order=1, label= 'Alternatively provide a URL to the document(s)' WHERE question_id = 'ad568b2f-89fe-4afd-a0bf-9e5832b71ce9' and control_id = 'data_product_documentation_url';
+UPDATE input SET list_order=1, label= 'Alternatively provide a URL to a sample file(s)' WHERE question_id = '53a0faa7-f7d4-4ce9-a9dc-a13cef44e1f3' and control_id = 'example_file_url';
+INSERT INTO input VALUES ('ad568b2f-89fe-4afd-a0bf-9e5832b71ce9', 'data_product_documentation', 0, '', 'file', '{}', '{}', '[]','[]', False);
+INSERT INTO input VALUES ('53a0faa7-f7d4-4ce9-a9dc-a13cef44e1f3', 'example_files', 0, '', 'file', '{}', '{}', '[]','[]', False);
+
+--4/18/2024 Adding management approval step to GES DISC workflow
+INSERT INTO privilege VALUES ('REQUEST_REVIEW_MANAGER');
+INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'REQUEST_REVIEW_MANAGER');
+INSERT INTO step(step_id, step_name, type, data) VALUES ('e62e9548-b350-40ec-b1bc-21a75e5f0407', 'data_publication_request_form_management_review', 'review', '{"rollback":"data_publication_request_form_review","type": "review","form_id":"19025579-99ca-4344-8610-704dae626343"}');
+INSERT INTO step_edge VALUES ('7843dc6d-f56d-488a-9193-bb7c0dc3696d', 'data_publication_request_form_management_review', 'data_publication_request_form_uwg_review');
+
+UPDATE step SET data = '{"rollback":"data_publication_request_form_management_review","type": "review","form_id":"19025579-99ca-4344-8610-704dae626343"}' WHERE step_id = 'c81066db-0566-428d-87e8-94169ce5a9b9';
+UPDATE step_edge SET next_step_name = 'data_publication_request_form_management_review' WHERE workflow_id = '7843dc6d-f56d-488a-9193-bb7c0dc3696d' AND step_name = 'data_publication_request_form_review';
+
+-- 4/22/2024 Adding new previlage REQUEST_REVIEW_MANAGER for the Daac manager task EDPUB-1263
+INSERT INTO privilege VALUES ('REQUEST_REVIEW_MANAGER');
+INSERT INTO edprole_privilege VALUES ('2aa89c57-85f1-4611-812d-b6760bb6295c', 'REQUEST_REVIEW_MANAGER');
+
+-- Task EDPUB-1244
+-- Update existing records to reflect changes for mapping to MMT
+UPDATE action SET short_name = 'send_to_mmt', long_name = 'Send To MMT Action', description = 'This action is used to send collection metadata from EDPub to MMT.', source = 'sendToMMT.js' WHERE id = '3fe93672-cd91-45d4-863b-c6d0d63f8c8c';
+
+ALTER TABLE step DISABLE TRIGGER ALL;
+
+UPDATE step
+SET step_name = 'map_to_mmt'
+WHERE step_name = 'map_to_meditor';
+
+UPDATE step
+SET step_name = 'start_mmt_editing',
+ data = '{"rollback":"send_to_mmt","type": "action"}'
+WHERE step_name = 'start_meditor_editing';
+
+UPDATE step
+SET step_name = 'complete_mmt_editing',
+ data = '{"rollback":"start_mmt_editing","type": "action"}'
+WHERE step_name = 'complete_meditor_editing';
+
+UPDATE step
+SET step_name = 'get_from_mmt',
+ data = '{"rollback":"complete_mmt_editing","type": "action"}'
+WHERE step_name = 'get_from_meditor';
+
+UPDATE step
+SET step_name = 'map_from_mmt',
+ data = '{"rollback":"get_from_mmt","type": "action"}'
+WHERE step_name = 'map_from_meditor';
+
+UPDATE step
+SET data = '{"rollback":"map_from_mmt","type": "action"}'
+WHERE step_name = 'publish_to_cmr';
+
+UPDATE step
+SET step_name = 'send_to_mmt'
+WHERE action_id = '3fe93672-cd91-45d4-863b-c6d0d63f8c8c';
+
+UPDATE step
+SET step_name = 'edit_metadata_in_mmt_after_publication_form_review',
+ data = '{"rollback":"send_to_mmt_after_publication_form_review","type": "action"}'
+WHERE step_id = 'd1cbc4a8-ce4c-4734-8e71-a824d30c401a';
+
+UPDATE step
+SET step_name = 'send_to_mmt_after_publication_form_review'
+WHERE step_id = 'c628d63b-93b9-45ae-8e7b-a903554b6726';
+
+ALTER TABLE step ENABLE TRIGGER ALL;
+
+-- StepEdge(workflow_id, step_name, next_step_name)
+UPDATE step_edge
+SET next_step_name = 'map_to_mmt'
+WHERE step_name = 'complete_qa' and workflow_id = 'c1690729-b67e-4675-a1a5-b2323f347dff';
+
+UPDATE step_edge
+SET step_name = 'map_to_mmt', next_step_name= 'send_to_mmt'
+WHERE step_name = 'map_to_meditor' and next_step_name = 'send_to_meditor' and workflow_id = 'c1690729-b67e-4675-a1a5-b2323f347dff';
+
+UPDATE step_edge
+SET step_name = 'send_to_mmt', next_step_name= 'start_mmt_editing'
+WHERE step_name = 'send_to_meditor' and next_step_name = 'start_meditor_editing' and workflow_id = 'c1690729-b67e-4675-a1a5-b2323f347dff';
+
+UPDATE step_edge
+SET step_name = 'start_mmt_editing', next_step_name= 'complete_mmt_editing'
+WHERE step_name = 'start_meditor_editing' and next_step_name = 'complete_meditor_editing' and workflow_id = 'c1690729-b67e-4675-a1a5-b2323f347dff';
+
+UPDATE step_edge
+SET step_name = 'complete_mmt_editing', next_step_name= 'get_from_mmt'
+WHERE step_name = 'complete_meditor_editing' and next_step_name = 'get_from_meditor' and workflow_id = 'c1690729-b67e-4675-a1a5-b2323f347dff';
+
+UPDATE step_edge
+SET step_name = 'get_from_mmt', next_step_name= 'map_from_mmt'
+WHERE step_name = 'get_from_meditor' and next_step_name = 'map_from_meditor' and workflow_id = 'c1690729-b67e-4675-a1a5-b2323f347dff';
+
+UPDATE step_edge
+SET step_name = 'map_from_mmt'
+WHERE step_name = 'map_from_meditor' and workflow_id = 'c1690729-b67e-4675-a1a5-b2323f347dff';
+
diff --git a/terraform/aws_secrets/main.tf b/terraform/aws_secrets/main.tf
index 0483dbaf..38cc0ee8 100644
--- a/terraform/aws_secrets/main.tf
+++ b/terraform/aws_secrets/main.tf
@@ -10,4 +10,17 @@ resource "aws_secretsmanager_secret_version" "ses_access_creds" {
"ses_access_key_id" = var.ses_access_key_id
"ses_secret_access_key" = var.ses_secret_access_key
})
+}
+
+resource "aws_secretsmanager_secret" "ornl_endpoint" {
+ name = "ornl_endpoint"
+ description = "ORNL endpoint and credentials"
+}
+
+resource "aws_secretsmanager_secret_version" "ornl_endpoint" {
+ secret_id = aws_secretsmanager_secret.ornl_endpoint.id
+ secret_string = jsonencode({
+ "ornl_endpoint_url" = var.ornl_endpoint_url
+ "ornl_endpoint_access_token" = var.ornl_endpoint_access_token
+ })
}
\ No newline at end of file
diff --git a/terraform/aws_secrets/outputs.tf b/terraform/aws_secrets/outputs.tf
index d0e8cce0..3b8fdffc 100644
--- a/terraform/aws_secrets/outputs.tf
+++ b/terraform/aws_secrets/outputs.tf
@@ -1,3 +1,7 @@
output "ses_access_creds_arn" {
value = aws_secretsmanager_secret.ses_access_creds.arn
+}
+
+output "ornl_endpoint_arn"{
+ value = aws_secretsmanager_secret.ornl_endpoint.arn
}
\ No newline at end of file
diff --git a/terraform/aws_secrets/variables.tf b/terraform/aws_secrets/variables.tf
index 514a33a8..7c736266 100644
--- a/terraform/aws_secrets/variables.tf
+++ b/terraform/aws_secrets/variables.tf
@@ -4,4 +4,12 @@ variable "ses_access_key_id" {
variable "ses_secret_access_key" {
type = string
+}
+
+variable "ornl_endpoint_url" {
+ type = string
+}
+
+variable "ornl_endpoint_access_token" {
+ type = string
}
\ No newline at end of file
diff --git a/terraform/iam/edpub_lambda_policy.json b/terraform/iam/edpub_lambda_policy.json
index d4343b1c..5ac5fce6 100755
--- a/terraform/iam/edpub_lambda_policy.json
+++ b/terraform/iam/edpub_lambda_policy.json
@@ -71,7 +71,8 @@
"secretsmanager:GetSecretValue"
],
"Resource":[
- "${ses_access_creds_arn}"
+ "${ses_access_creds_arn}",
+ "${ornl_endpoint_arn}"
]
}
]
diff --git a/terraform/iam/template_files.tf b/terraform/iam/template_files.tf
index fd395664..9e2ff119 100755
--- a/terraform/iam/template_files.tf
+++ b/terraform/iam/template_files.tf
@@ -21,6 +21,7 @@ data "template_file" "edpub_lambda_policy" {
edpub_notification_sqs_arn = var.edpub_notification_sqs_arn
edpub_workflow_sqs_arn = var.edpub_workflow_sqs_arn
ses_access_creds_arn = var.ses_access_creds_arn
+ ornl_endpoint_arn = var.ornl_endpoint_arn
}
}
diff --git a/terraform/iam/variables.tf b/terraform/iam/variables.tf
index 4a230c8e..026f06c0 100755
--- a/terraform/iam/variables.tf
+++ b/terraform/iam/variables.tf
@@ -57,3 +57,7 @@ variable "permissions_boundary_arn" {
variable "ses_access_creds_arn" {
type = string
}
+
+variable "ornl_endpoint_arn" {
+ type = string
+}
\ No newline at end of file
diff --git a/terraform/lambda/variables.tf b/terraform/lambda/variables.tf
index 7af1169d..43c0aeed 100755
--- a/terraform/lambda/variables.tf
+++ b/terraform/lambda/variables.tf
@@ -184,4 +184,8 @@ variable "ses_from_email" {
variable "ses_access_creds_arn" {
type = string
+}
+
+variable "ornl_endpoint_arn" {
+ type = string
}
\ No newline at end of file
diff --git a/terraform/modules.tf b/terraform/modules.tf
index 060f812c..614abf02 100755
--- a/terraform/modules.tf
+++ b/terraform/modules.tf
@@ -16,6 +16,7 @@ module "iam_roles" {
lambda_execution_policy_arn = var.lambda_execution_policy_arn
permissions_boundary_arn = var.permissions_boundary_arn
ses_access_creds_arn = module.aws_secrets.ses_access_creds_arn
+ ornl_endpoint_arn = module.aws_secrets.ornl_endpoint_arn
}
module "s3" {
@@ -29,6 +30,8 @@ module "aws_secrets" {
ses_access_key_id = var.ses_access_key_id
ses_secret_access_key = var.ses_secret_access_key
+ ornl_endpoint_url = var.ornl_endpoint_url
+ ornl_endpoint_access_token = var.ornl_endpoint_access_token
}
module "lambda_functions" {
@@ -81,6 +84,7 @@ module "lambda_functions" {
meditor_service_password = var.meditor_service_password
ses_from_email = var.ses_from_email
ses_access_creds_arn = module.aws_secrets.ses_access_creds_arn
+ ornl_endpoint_arn = module.aws_secrets.ornl_endpoint_arn
}
module "apigateway_endpoints" {
diff --git a/terraform/variables.tf b/terraform/variables.tf
index 6e100be5..e117041f 100755
--- a/terraform/variables.tf
+++ b/terraform/variables.tf
@@ -114,4 +114,12 @@ variable "ses_access_key_id" {
variable "ses_secret_access_key" {
type = string
+}
+
+variable "ornl_endpoint_url" {
+ type = string
+}
+
+variable "ornl_endpoint_access_token" {
+ type = string
}
\ No newline at end of file