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

Survey Progress Field #1238

Merged
merged 31 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
49b0af4
survey repository changes & frontend
mauberti-bc Mar 8, 2024
27d9d9c
openApi spec
mauberti-bc Mar 8, 2024
1663c82
more openapi spec changes
mauberti-bc Mar 8, 2024
6fa01a4
migration fixes
mauberti-bc Mar 8, 2024
060d3fe
wip: fix migration where survey table does not have progress_id
mauberti-bc Mar 9, 2024
cc25598
set survey status when creating or editing surveys
mauberti-bc Mar 9, 2024
53005f6
cleanup
mauberti-bc Mar 9, 2024
09b940f
include description in planning ui options
mauberti-bc Mar 9, 2024
c06837a
planning chip on survey page
mauberti-bc Mar 9, 2024
0c936d7
add survey progress chip to survey list page
mauberti-bc Mar 9, 2024
a98fb57
adjust colors of progress chip
mauberti-bc Mar 9, 2024
94c6378
add survey_progress to tests
mauberti-bc Mar 11, 2024
bbe1bfb
linter
mauberti-bc Mar 11, 2024
be7079b
pull dev
mauberti-bc Mar 11, 2024
e62d091
cleanup and fixes
mauberti-bc Mar 12, 2024
8128567
linter
mauberti-bc Mar 12, 2024
b8a188a
make progress required
mauberti-bc Mar 12, 2024
8c1084b
wip: validation not yet working on survey form for progress component
mauberti-bc Mar 12, 2024
6379648
include progress in yup schema
mauberti-bc Mar 12, 2024
5d32a3d
create index for progress id in survey table
mauberti-bc Mar 12, 2024
8855ecc
linter
mauberti-bc Mar 12, 2024
cd35261
fix incorrect name: progress -> progress_id
mauberti-bc Mar 12, 2024
42a6052
cleanup
mauberti-bc Mar 12, 2024
6c72ad6
Merge branch 'dev' into survey-status
al-rosenthal Mar 12, 2024
fe76691
address PR comments
mauberti-bc Mar 12, 2024
b6ee0ed
update seed
mauberti-bc Mar 12, 2024
5562664
Merge branch 'survey-status' of github.com:bcgov/biohubbc into survey…
mauberti-bc Mar 12, 2024
f8a1f25
update comments in codes repository
mauberti-bc Mar 12, 2024
d739900
update returns types in codes repository
mauberti-bc Mar 12, 2024
7f34adb
Merge branch 'dev' into survey-status
NickPhura Mar 12, 2024
fa8a260
Merge branch 'dev' into survey-status
al-rosenthal Mar 13, 2024
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
468 changes: 234 additions & 234 deletions api/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions api/src/models/biohub-create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ describe('PostSurveyToBiohubObject', () => {
uuid: '1',
project_id: 1,
survey_name: 'survey_name',
progress_id: 1,
start_date: 'start_date',
end_date: 'end_date',
survey_types: [9],
Expand Down Expand Up @@ -180,6 +181,7 @@ describe('PostSurveySubmissionToBioHubObject', () => {
uuid: '1',
project_id: 1,
survey_name: 'survey_name',
progress_id: 1,
start_date: 'start_date',
end_date: 'end_date',
survey_types: [9],
Expand Down
2 changes: 2 additions & 0 deletions api/src/models/survey-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ export class PostSurveyDetailsData {
survey_name: string;
start_date: string;
end_date: string;
progress_id: number;
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.progress_id = obj?.progress_id || null;
this.survey_types = (obj?.survey_types?.length && obj.survey_types) || [];
}
}
Expand Down
2 changes: 2 additions & 0 deletions api/src/models/survey-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,15 @@ export class PutSurveyDetailsData {
name: string;
start_date: string;
end_date: string;
progress_id: number;
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.progress_id = obj?.progress_id || null;
this.survey_types = (obj?.survey_types?.length && obj.survey_types) || [];
this.revision_count = obj?.revision_count ?? null;
}
Expand Down
2 changes: 2 additions & 0 deletions api/src/models/survey-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export class GetSurveyData {
survey_name: string;
start_date: string;
end_date: string;
progress_id: number;
survey_types: number[];
revision_count: number;

Expand All @@ -44,6 +45,7 @@ export class GetSurveyData {
this.survey_name = obj?.name || '';
this.start_date = obj?.start_date || null;
this.end_date = obj?.end_date || null;
this.progress_id = obj?.progress_id || null;
this.survey_types = (obj?.survey_types?.length && obj.survey_types) || [];
this.revision_count = obj?.revision_count || 0;
}
Expand Down
20 changes: 19 additions & 1 deletion api/src/paths/codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ GET.apiDoc = {
'administrative_activity_status_type',
'intended_outcomes',
'vantage_codes',
'site_selection_strategies'
'site_selection_strategies',
'survey_progress'
],
properties: {
management_action_type: {
Expand Down Expand Up @@ -316,6 +317,23 @@ GET.apiDoc = {
}
}
}
},
survey_progress: {
type: 'array',
items: {
type: 'object',
properties: {
id: {
type: 'integer'
},
name: {
type: 'string'
},
description: {
type: 'string'
}
}
}
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion api/src/paths/project/{projectId}/survey/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ POST.apiDoc = {
properties: {
survey_details: {
type: 'object',
required: ['survey_name', 'start_date'],
required: ['survey_name', 'start_date', 'progress_id'],
properties: {
survey_name: {
type: 'string'
Expand All @@ -85,6 +85,9 @@ POST.apiDoc = {
description: 'ISO 8601 date string',
nullable: true
},
progress_id: {
type: 'integer'
},
survey_types: {
type: 'array',
items: {
Expand Down
2 changes: 2 additions & 0 deletions api/src/paths/project/{projectId}/survey/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ describe('survey list', () => {
survey_id: 1001,
name: 'Survey 1',
start_date: '2023-01-01',
progress_id: 1,
end_date: null,
focal_species: [1],
focal_species_names: ['Species 1']
Expand All @@ -55,6 +56,7 @@ describe('survey list', () => {
const mockSurveyB = {
survey_id: 1002,
name: 'Survey 2',
progress_id: 2,
start_date: '2023-04-04',
end_date: '2024-05-05',
focal_species: [1, 2],
Expand Down
5 changes: 4 additions & 1 deletion api/src/paths/project/{projectId}/survey/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ GET.apiDoc = {
type: 'array',
items: {
type: 'object',
required: ['survey_id', 'name', 'start_date', 'end_date', 'focal_species'],
required: ['survey_id', 'name', 'start_date', 'end_date', 'progress_id', 'focal_species'],
properties: {
survey_id: {
type: 'integer',
Expand All @@ -92,6 +92,9 @@ GET.apiDoc = {
description: 'ISO 8601 date string',
nullable: true
},
progress_id: {
type: 'integer'
},
focal_species: {
type: 'array',
items: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ PUT.apiDoc = {
properties: {
survey_details: {
type: 'object',
required: ['survey_name', 'start_date', 'end_date', 'survey_types', 'revision_count'],
required: ['survey_name', 'start_date', 'end_date', 'survey_types', 'progress_id', 'revision_count'],
properties: {
survey_name: {
type: 'string'
Expand All @@ -88,6 +88,9 @@ PUT.apiDoc = {
minimum: 1
}
},
progress_id: {
type: 'integer'
},
revision_count: {
type: 'number'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('survey/{surveyId}/view', () => {
survey_name: 'name',
start_date: '2020-04-04',
end_date: '2020-05-05',
progress_id: 1,
survey_types: [1, 2],
revision_count: 1
},
Expand Down Expand Up @@ -99,6 +100,7 @@ describe('survey/{surveyId}/view', () => {
survey_name: 'name',
start_date: '2020-04-04',
end_date: '2020-05-05',
progress_id: 1,
survey_types: [1, 2],
revision_count: 1
},
Expand Down
5 changes: 4 additions & 1 deletion api/src/paths/project/{projectId}/survey/{surveyId}/view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ GET.apiDoc = {
survey_details: {
description: 'Survey Details',
type: 'object',
required: ['survey_name', 'start_date', 'survey_types', 'revision_count'],
required: ['survey_name', 'start_date', 'survey_types', 'progress_id', 'revision_count'],
properties: {
survey_name: {
type: 'string'
Expand All @@ -101,6 +101,9 @@ GET.apiDoc = {
nullable: true,
description: 'ISO 8601 date string for the funding end_date'
},
progress_id: {
type: 'integer'
},
survey_types: {
type: 'array',
items: {
Expand Down
Loading
Loading