Skip to content

Commit

Permalink
Merge pull request #188 from GSA/140-Add-fields-for-M-22-18-requirements
Browse files Browse the repository at this point in the history
#140  add fields for m 22 18 requirements
  • Loading branch information
hatfieldjm4 authored Jan 8, 2024
2 parents c500005 + 13db360 commit baf4808
Show file tree
Hide file tree
Showing 12 changed files with 292 additions and 123 deletions.
18 changes: 15 additions & 3 deletions api/controllers/it-standards.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports.findSystems = (req, res) => {
var query = fs.readFileSync(path.join(__dirname, queryPath, 'GET/get_systems.sql')).toString() +
` LEFT JOIN zk_systems_subsystems_technology AS mappings ON systems.\`ex:GEAR_ID\` = mappings.obj_systems_subsystems_Id
LEFT JOIN obj_technology AS tech ON mappings.obj_technology_Id = tech.Id
WHERE tech.Id = ${req.params.id} GROUP BY systems.\`ex:GEAR_ID\`;`; //removed LEFT JOIN cowboy_ods.obj_technology reference

res = ctrl.sendQuery(query, 'systems using IT Standard', res);
Expand Down Expand Up @@ -104,7 +104,11 @@ exports.update = (req, res) => {
Vendor_Standard_Organization = '${data.itStandVendorOrg}',
obj_deployment_type_Id = ${data.itStandDeployment},
Gold_Image = '${data.itStandGoldImg}',
attestation_required = '${data.itStandReqAtte}',
fedramp = '${data.itStandFedramp}',
open_source = '${data.itStandOpenSource}',
Gold_Image_Comment = '${data.itStandGoldComment}',
attestation_link = '${data.itStandAtteLink}',
Approved_Status_Expiration_Date = ${data.itStandAprvExp},
Comments = '${data.itStandComments}',
Reference_documents = ${data.itStandRefDocs},
Expand All @@ -129,7 +133,7 @@ exports.update = (req, res) => {
res = ctrl.sendQuery(query + ' ' + logStatement, 'update IT Standard', res); //removed sendQuery_cowboy reference
} else {
//console.log('*** API Security Testing - API Auth Validation: FAILED'); //DEBUGGING

//console.log('it-standard update no valid token!!!!');
res.status(502).json({
message: "No authorization token present. Not allowed to update IT-Standards"
Expand Down Expand Up @@ -171,7 +175,11 @@ exports.create = (req, res) => {
Vendor_Standard_Organization,
Available_through_Myview,
Gold_Image,
attestation_required,
fedramp,
open_source,
Gold_Image_Comment,
attestation_link,
Comments,
obj_technology_status_Id,
obj_deployment_type_Id,
Expand All @@ -195,7 +203,11 @@ exports.create = (req, res) => {
'${data.itStandVendorOrg}',
'${data.itStandMyView}',
'${data.itStandGoldImg}',
'${data.itStandReqAtte}',
'${data.itStandFedramp}',
'${data.itStandOpenSource}',
'${data.itStandGoldComment}',
'${data.itStandAtteLink}',
'${data.itStandComments}',
${data.itStandStatus},
${data.itStandDeployment},
Expand Down Expand Up @@ -255,4 +267,4 @@ exports.findTypes = (req, res) => {
var query = fs.readFileSync(path.join(__dirname, queryPath, 'GET/get_it-standard_types.sql')).toString();

res = ctrl.sendQuery(query, 'IT Standard Types', res); //removed sendQuery_cowboy reference
};
};
6 changes: 5 additions & 1 deletion api/models/it-standards.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ export class ITStandards {
public Vendor_Standard_Organization: string = null;
public Available_through_Myview: string = null;
public Gold_Image: string = null;
public attestation_required: string = null;
public fedramp: string = null;
public open_source: string = null;
public Gold_Image_Comment: string = null;
public attestation_link: string = null;
public Comments: string = null;
public old_Id: string = null;
public POCorg: string = null;
Expand All @@ -26,4 +30,4 @@ export class ITStandards {
public Category: string = null;
public OldName: string = null;
public EndOfLifeDate: Date = null;
}
}
11 changes: 7 additions & 4 deletions api/queries/GET/get_it-standards.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SELECT
SELECT
tech.Id AS ID,
-- tech.Keyname AS Name,
IFNULL(tech.softwareReleaseName, tech.Keyname) AS Name,
Expand All @@ -7,7 +7,11 @@ SELECT
tech.Vendor_Standard_Organization,
tech.Available_through_Myview,
tech.Gold_Image,
tech.attestation_required,
tech.fedramp,
tech.open_source,
tech.Gold_Image_Comment,
tech.attestation_link,
tech.Comments,
tech.old_Id,
tech.Reference_Documents AS ReferenceDocument,
Expand All @@ -31,17 +35,16 @@ SELECT
GROUP_CONCAT(DISTINCT obj_standard_category.Keyname SEPARATOR ', ') AS Category,
tech.Keyname AS OldName,
DATE(tech.endOfLifeDate) AS EndOfLifeDate

FROM obj_technology AS tech

LEFT JOIN obj_technology_status ON tech.obj_technology_status_Id = obj_technology_status.Id
LEFT JOIN obj_deployment_type ON tech.obj_deployment_type_Id = obj_deployment_type.Id
LEFT JOIN obj_standard_type ON tech.obj_standard_type_Id = obj_standard_type.Id
LEFT JOIN obj_508_compliance_status ON tech.obj_508_compliance_status_Id = obj_508_compliance_status.Id

LEFT JOIN zk_technology_poc ON tech.Id = zk_technology_poc.obj_technology_Id
LEFT JOIN obj_ldap_poc AS poc ON zk_technology_poc.obj_ldap_SamAccountName = poc.SamAccountName
LEFT JOIN obj_organization AS org ON poc.OrgCode = org.Org_Symbol

LEFT JOIN zk_technology_standard_category ON tech.Id = zk_technology_standard_category.obj_technology_Id
LEFT JOIN obj_standard_category ON zk_technology_standard_category.obj_standard_category_Id = obj_standard_category.Id
LEFT JOIN obj_standard_category ON zk_technology_standard_category.obj_standard_category_Id = obj_standard_category.Id
Loading

0 comments on commit baf4808

Please sign in to comment.