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

BHBC-2153-2156: Remove 'All Areas Surveyed' Component, FOIPA and SEDIS Agreements Selected #923

Merged
merged 4 commits into from
Jan 27, 2023
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
9 changes: 0 additions & 9 deletions api/src/models/survey-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,6 @@ describe('GetSurveyPurposeAndMethodologyData', () => {
it('sets vantage_code_ids', () => {
expect(data.vantage_code_ids).to.eql([]);
});

it('sets surveyed_all_areas', () => {
expect(data.surveyed_all_areas).to.equal('false');
});
});

describe('All values provided with first nations id', () => {
Expand All @@ -454,7 +450,6 @@ describe('GetSurveyPurposeAndMethodologyData', () => {
field_method_id: 2,
ecological_season_id: 3,
vantage_ids: [4, 5],
surveyed_all_areas: true,
revision_count: 'count'
};

Expand Down Expand Up @@ -482,10 +477,6 @@ describe('GetSurveyPurposeAndMethodologyData', () => {
expect(data.vantage_code_ids).to.eql(obj.vantage_ids);
});

it('sets surveyed_all_areas', () => {
expect(data.surveyed_all_areas).to.eql('true');
});

it('sets revision_count', function () {
expect(data.revision_count).to.equal('count');
});
Expand Down
2 changes: 0 additions & 2 deletions api/src/models/survey-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ export class GetSurveyPurposeAndMethodologyData {
ecological_season_id: number;
revision_count: number;
vantage_code_ids: number[];
surveyed_all_areas: string;

constructor(obj?: any) {
this.intended_outcome_id = obj?.intended_outcome_id || null;
this.additional_details = obj?.additional_details || '';
this.field_method_id = obj?.field_method_id || null;
this.ecological_season_id = obj?.ecological_season_id || null;
this.vantage_code_ids = (obj?.vantage_ids?.length && obj.vantage_ids) || [];
this.surveyed_all_areas = (obj?.surveyed_all_areas && 'true') || 'false';
this.revision_count = obj?.revision_count ?? 0;
}
}
Expand Down
4 changes: 0 additions & 4 deletions api/src/paths/project/{projectId}/survey/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,6 @@ POST.apiDoc = {
},
ecological_season_id: {
type: 'number'
},
surveyed_all_areas: {
type: 'string',
enum: ['true', 'false']
}
}
},
Expand Down
5 changes: 0 additions & 5 deletions api/src/paths/project/{projectId}/survey/{surveyId}/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ PUT.apiDoc = {
'field_method_id',
'vantage_code_ids',
'ecological_season_id',
'surveyed_all_areas',
'revision_count'
],
properties: {
Expand All @@ -210,10 +209,6 @@ PUT.apiDoc = {
ecological_season_id: {
type: 'number'
},
surveyed_all_areas: {
type: 'string',
enum: ['true', 'false']
},
revision_count: {
type: 'number'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ describe('getSurveyForUpdate', () => {
funding_sources: []
},
agreements: {
sedis_procedures_accepted: 'false',
foippa_requirements_accepted: 'false'
sedis_procedures_accepted: 'true',
foippa_requirements_accepted: 'true'
}
}
};
Expand Down Expand Up @@ -150,8 +150,8 @@ describe('getSurveyForUpdate', () => {
funding_sources: [1]
},
agreements: {
sedis_procedures_accepted: 'false',
foippa_requirements_accepted: 'false'
sedis_procedures_accepted: 'true',
foippa_requirements_accepted: 'true'
}
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ GET.apiDoc = {
'intended_outcome_id',
'ecological_season_id',
'vantage_code_ids',
'surveyed_all_areas',
'revision_count'
],
properties: {
Expand All @@ -211,10 +210,6 @@ GET.apiDoc = {
items: {
type: 'number'
}
},
surveyed_all_areas: {
type: 'string',
enum: ['true', 'false']
}
}
},
Expand Down Expand Up @@ -340,8 +335,8 @@ export function getSurveyForUpdate(): RequestHandler {
funding_sources: funding
},
agreements: {
sedis_procedures_accepted: 'false',
foippa_requirements_accepted: 'false'
sedis_procedures_accepted: 'true',
foippa_requirements_accepted: 'true'
}
};

Expand Down
5 changes: 0 additions & 5 deletions api/src/paths/project/{projectId}/survey/{surveyId}/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ GET.apiDoc = {
'intended_outcome_id',
'ecological_season_id',
'vantage_code_ids',
'surveyed_all_areas',
'revision_count'
],
properties: {
Expand All @@ -242,10 +241,6 @@ GET.apiDoc = {
items: {
type: 'number'
}
},
surveyed_all_areas: {
type: 'string',
enum: ['true', 'false']
}
}
},
Expand Down
7 changes: 1 addition & 6 deletions api/src/paths/project/{projectId}/surveys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ GET.apiDoc = {
'additional_details',
'intended_outcome_id',
'ecological_season_id',
'vantage_code_ids',
'surveyed_all_areas'
'vantage_code_ids'
],
properties: {
field_method_id: {
Expand All @@ -232,10 +231,6 @@ GET.apiDoc = {
items: {
type: 'number'
}
},
surveyed_all_areas: {
type: 'string',
enum: ['true', 'false']
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion api/src/repositories/project-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export class ProjectRepository extends BaseRepository {
pp.project_role_id,
pr.name project_role_name,
su.user_identifier,
ss.user_guid,
su.user_guid,
su.user_identity_source_id
FROM
project_participation pp
Expand Down
7 changes: 1 addition & 6 deletions api/src/repositories/survey-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ export class SurveyRepository extends BaseRepository {
s.additional_details,
s.ecological_season_id,
s.intended_outcome_id,
s.surveyed_all_areas,
array_remove(array_agg(sv.vantage_id), NULL) as vantage_ids
FROM
survey s
Expand All @@ -168,8 +167,7 @@ export class SurveyRepository extends BaseRepository {
s.field_method_id,
s.additional_details,
s.ecological_season_id,
s.intended_outcome_id,
s.surveyed_all_areas;
s.intended_outcome_id;
`;

const response = await this.connection.sql(sqlStatement);
Expand Down Expand Up @@ -521,7 +519,6 @@ export class SurveyRepository extends BaseRepository {
additional_details,
ecological_season_id,
intended_outcome_id,
surveyed_all_areas,
location_name,
geojson,
geography
Expand All @@ -536,7 +533,6 @@ export class SurveyRepository extends BaseRepository {
${surveyData.purpose_and_methodology.additional_details},
${surveyData.purpose_and_methodology.ecological_season_id},
${surveyData.purpose_and_methodology.intended_outcome_id},
${surveyData.purpose_and_methodology.surveyed_all_areas},
${surveyData.location.survey_area_name},
${JSON.stringify(surveyData.location.geometry)}
`;
Expand Down Expand Up @@ -793,7 +789,6 @@ export class SurveyRepository extends BaseRepository {
additional_details: surveyData.purpose_and_methodology.additional_details,
ecological_season_id: surveyData.purpose_and_methodology.ecological_season_id,
intended_outcome_id: surveyData.purpose_and_methodology.intended_outcome_id,
surveyed_all_areas: surveyData.purpose_and_methodology.surveyed_all_areas,
revision_count: surveyData.purpose_and_methodology.revision_count
};
}
Expand Down
9 changes: 0 additions & 9 deletions api/src/services/eml-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,15 +475,6 @@ export class EmlService extends DBService {
}
});

this.surveyData.forEach((item) => {
data.push({
describes: item.survey_details.uuid,
metadata: {
surveyedAllAreas: item.purpose_and_methodology.surveyed_all_areas === 'true' || false
}
});
});

if (this.projectAttachmentData?.attachmentDetails.length) {
data.push({
describes: this.projectData.project.uuid,
Expand Down
Loading