Skip to content

Commit

Permalink
SIMSBIOHUB-276: Remove Lead Biologist from survey edit and create page (
Browse files Browse the repository at this point in the history
#1108)

Removed lead biologist from survey edit and create page
  • Loading branch information
curtisupshall authored Oct 5, 2023
1 parent 73681f3 commit d4aa9c4
Show file tree
Hide file tree
Showing 24 changed files with 147 additions and 219 deletions.
20 changes: 1 addition & 19 deletions api/src/models/survey-create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,6 @@ describe('PostSurveyDetailsData', () => {
it('sets start_date', () => {
expect(data.start_date).to.equal(null);
});

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

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

describe('All values provided', () => {
Expand All @@ -169,9 +161,7 @@ describe('PostSurveyDetailsData', () => {
const obj = {
survey_name: 'survey name',
end_date: '2020/04/04',
start_date: '2020/03/03',
biologist_first_name: 'first',
biologist_last_name: 'last'
start_date: '2020/03/03'
};

before(() => {
Expand All @@ -189,14 +179,6 @@ describe('PostSurveyDetailsData', () => {
it('sets start_date', () => {
expect(data.start_date).to.equal(obj.start_date);
});

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

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

Expand Down
4 changes: 0 additions & 4 deletions api/src/models/survey-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,12 @@ export class PostSurveyDetailsData {
survey_name: string;
start_date: string;
end_date: string;
biologist_first_name: string;
biologist_last_name: string;
survey_types: number[];

constructor(obj?: any) {
this.survey_name = obj?.survey_name || null;
this.start_date = obj?.start_date || null;
this.end_date = obj?.end_date || null;
this.biologist_first_name = obj?.biologist_first_name || null;
this.biologist_last_name = obj?.biologist_last_name || null;
this.survey_types = (obj?.survey_types?.length && obj.survey_types) || [];
}
}
Expand Down
18 changes: 0 additions & 18 deletions api/src/models/survey-update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ describe('PutSurveyDetailsData', () => {
expect(data.start_date).to.equal(null);
});

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

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

it('sets revision_count', () => {
expect(data.revision_count).to.equal(null);
});
Expand All @@ -122,8 +114,6 @@ describe('PutSurveyDetailsData', () => {
survey_name: 'survey name',
end_date: '2020/04/04',
start_date: '2020/03/03',
biologist_first_name: 'first',
biologist_last_name: 'last',
revision_count: 0
};

Expand All @@ -143,14 +133,6 @@ describe('PutSurveyDetailsData', () => {
expect(data.start_date).to.equal(obj.start_date);
});

it('sets lead_first_name', () => {
expect(data.lead_first_name).to.equal(obj.biologist_first_name);
});

it('sets lead_last_name', () => {
expect(data.lead_last_name).to.equal(obj.biologist_last_name);
});

it('sets revision_count', () => {
expect(data.revision_count).to.equal(obj.revision_count);
});
Expand Down
4 changes: 0 additions & 4 deletions api/src/models/survey-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,13 @@ export class PutSurveyDetailsData {
name: string;
start_date: string;
end_date: string;
lead_first_name: string;
lead_last_name: string;
survey_types: number[];
revision_count: number;

constructor(obj?: any) {
this.name = obj?.survey_name || null;
this.start_date = obj?.start_date || null;
this.end_date = obj?.end_date || null;
this.lead_first_name = obj?.biologist_first_name || null;
this.lead_last_name = obj?.biologist_last_name || null;
this.survey_types = (obj?.survey_types?.length && obj.survey_types) || [];
this.revision_count = obj?.revision_count ?? null;
}
Expand Down
18 changes: 0 additions & 18 deletions api/src/models/survey-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ describe('GetSurveyData', () => {
it('sets geojson', () => {
expect(data.geometry).to.eql([]);
});

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

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

describe('All values provided', () => {
Expand All @@ -53,9 +45,7 @@ describe('GetSurveyData', () => {
name: 'survey name',
end_date: '2020/04/04',
start_date: '2020/03/03',
lead_first_name: 'first',
geojson: [{ data: 'data' }],
lead_last_name: 'last',
revision_count: 'count'
};

Expand All @@ -79,14 +69,6 @@ describe('GetSurveyData', () => {
expect(data.geometry).to.equal(obj.geojson);
});

it('sets biologist_first_name', () => {
expect(data.biologist_first_name).to.equal(obj.lead_first_name);
});

it('sets biologist_last_name', () => {
expect(data.biologist_last_name).to.equal(obj.lead_last_name);
});

it('sets revision_count', function () {
expect(data.revision_count).to.equal('count');
});
Expand Down
4 changes: 0 additions & 4 deletions api/src/models/survey-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ export class GetSurveyData {
survey_name: string;
start_date: string;
end_date: string;
biologist_first_name: string;
biologist_last_name: string;
survey_types: number[];
revision_count: number;
geometry: Feature[];
Expand All @@ -49,8 +47,6 @@ export class GetSurveyData {
this.start_date = String(obj?.start_date) || '';
this.end_date = String(obj?.end_date) || '';
this.geometry = (obj?.geojson?.length && obj.geojson) || [];
this.biologist_first_name = obj?.lead_first_name || '';
this.biologist_last_name = obj?.lead_last_name || '';
this.survey_types = (obj?.survey_types?.length && obj.survey_types) || [];
this.revision_count = obj?.revision_count || 0;
}
Expand Down
6 changes: 0 additions & 6 deletions api/src/paths/project/{projectId}/survey/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ POST.apiDoc = {
type: 'string',
description: 'ISO 8601 date string'
},
biologist_first_name: {
type: 'string'
},
biologist_last_name: {
type: 'string'
},
survey_types: {
type: 'array',
items: {
Expand Down
14 changes: 1 addition & 13 deletions api/src/paths/project/{projectId}/survey/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,7 @@ GET.apiDoc = {
survey_details: {
description: 'Survey Details',
type: 'object',
required: [
'survey_name',
'biologist_first_name',
'biologist_last_name',
'survey_types',
'revision_count'
],
required: ['survey_name', 'survey_types', 'revision_count'],
properties: {
survey_name: {
type: 'string'
Expand All @@ -98,12 +92,6 @@ GET.apiDoc = {
nullable: true,
description: 'ISO 8601 date string for the funding end_date'
},
biologist_first_name: {
type: 'string'
},
biologist_last_name: {
type: 'string'
},
survey_types: {
type: 'array',
items: {
Expand Down
16 changes: 1 addition & 15 deletions api/src/paths/project/{projectId}/survey/{surveyId}/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,7 @@ PUT.apiDoc = {
properties: {
survey_details: {
type: 'object',
required: [
'survey_name',
'start_date',
'end_date',
'biologist_first_name',
'biologist_last_name',
'survey_types',
'revision_count'
],
required: ['survey_name', 'start_date', 'end_date', 'survey_types', 'revision_count'],
properties: {
survey_name: {
type: 'string'
Expand All @@ -89,12 +81,6 @@ PUT.apiDoc = {
description: 'ISO 8601 date string',
nullable: true
},
biologist_first_name: {
type: 'string'
},
biologist_last_name: {
type: 'string'
},
survey_types: {
type: 'array',
items: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,7 @@ GET.apiDoc = {
survey_details: {
description: 'Survey Details',
type: 'object',
required: [
'survey_name',
'start_date',
'biologist_first_name',
'biologist_last_name',
'survey_types',
'revision_count'
],
required: ['survey_name', 'start_date', 'survey_types', 'revision_count'],
properties: {
survey_name: {
type: 'string'
Expand All @@ -107,12 +100,6 @@ GET.apiDoc = {
nullable: true,
description: 'ISO 8601 date string for the funding end_date'
},
biologist_first_name: {
type: 'string'
},
biologist_last_name: {
type: 'string'
},
survey_types: {
type: 'array',
items: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ describe('survey/{surveyId}/view', () => {
survey_name: 'name',
start_date: '2020-04-04',
end_date: '2020-05-05',
biologist_first_name: 'first',
biologist_last_name: 'last',
survey_types: [1, 2],
revision_count: 1
},
Expand Down Expand Up @@ -105,8 +103,6 @@ describe('survey/{surveyId}/view', () => {
survey_name: 'name',
start_date: '2020-04-04',
end_date: '2020-05-05',
biologist_first_name: 'first',
biologist_last_name: 'last',
survey_types: [1, 2],
revision_count: 1
},
Expand Down
15 changes: 1 addition & 14 deletions api/src/paths/project/{projectId}/survey/{surveyId}/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,7 @@ GET.apiDoc = {
survey_details: {
description: 'Survey Details',
type: 'object',
required: [
'survey_name',
'start_date',
'biologist_first_name',
'biologist_last_name',
'survey_types',
'revision_count'
],
required: ['survey_name', 'start_date', 'survey_types', 'revision_count'],
properties: {
survey_name: {
type: 'string'
Expand All @@ -108,12 +101,6 @@ GET.apiDoc = {
nullable: true,
description: 'ISO 8601 date string for the funding end_date'
},
biologist_first_name: {
type: 'string'
},
biologist_last_name: {
type: 'string'
},
survey_types: {
type: 'array',
items: {
Expand Down
12 changes: 0 additions & 12 deletions api/src/repositories/survey-repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,6 @@ describe('SurveyRepository', () => {
survey_name: 'name',
start_date: 'start',
end_date: 'end',
biologist_first_name: 'first',
biologist_last_name: 'last',
survey_types: [1, 2]
},
purpose_and_methodology: {
Expand Down Expand Up @@ -493,8 +491,6 @@ describe('SurveyRepository', () => {
survey_name: 'name',
start_date: 'start',
end_date: 'end',
biologist_first_name: 'first',
biologist_last_name: 'last',
survey_types: [1, 2]
},
purpose_and_methodology: {
Expand Down Expand Up @@ -523,8 +519,6 @@ describe('SurveyRepository', () => {
survey_name: 'name',
start_date: 'start',
end_date: 'end',
biologist_first_name: 'first',
biologist_last_name: 'last',
survey_types: [1, 2]
},
purpose_and_methodology: {
Expand Down Expand Up @@ -851,8 +845,6 @@ describe('SurveyRepository', () => {
name: 'name',
start_date: 'start',
end_date: 'end',
lead_first_name: 'first',
lead_last_name: 'last',
revision_count: 1
},
purpose_and_methodology: {
Expand Down Expand Up @@ -882,8 +874,6 @@ describe('SurveyRepository', () => {
name: 'name',
start_date: 'start',
end_date: 'end',
lead_first_name: 'first',
lead_last_name: 'last',
revision_count: 1
},
purpose_and_methodology: {
Expand Down Expand Up @@ -913,8 +903,6 @@ describe('SurveyRepository', () => {
name: 'name',
start_date: 'start',
end_date: 'end',
lead_first_name: 'first',
lead_last_name: 'last',
revision_count: 1
},
purpose_and_methodology: {
Expand Down
Loading

0 comments on commit d4aa9c4

Please sign in to comment.