Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
211 commits
Select commit Hold shift + click to select a range
2c1a559
Initial commit
NickPhura Feb 3, 2024
5702265
WIP
NickPhura Feb 5, 2024
33b697a
Working autocomplete list
NickPhura Feb 5, 2024
06e7dc6
Rename/move components, add jsdoc
NickPhura Feb 5, 2024
09b9149
Tweaks
NickPhura Feb 5, 2024
8ca8da9
Add critterbase proxy
NickPhura Feb 7, 2024
697d2a9
Initial code to add measurement columns to observation table
NickPhura Feb 7, 2024
2ccb3a7
Fix react warnings
NickPhura Feb 7, 2024
6be290f
Move col defs to separate file
NickPhura Feb 7, 2024
d85bfbd
Add qual/quan measurement col defs
NickPhura Feb 7, 2024
71a91db
Add hasError to observations table context
NickPhura Feb 7, 2024
2476970
Update apiRefs to use api exposed through datagrid params
NickPhura Feb 7, 2024
4ea3008
Cleanup measurement type
NickPhura Feb 7, 2024
0fbbe81
Merge branch 'dev' into SIMSBIOHUB-466
al-rosenthal Feb 7, 2024
d75b418
Updating Menu for Column Configuration
jeznorth Feb 9, 2024
7206465
basic version working
al-rosenthal Feb 9, 2024
85ad6af
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
al-rosenthal Feb 9, 2024
9096f1e
added new attribute types to front end
al-rosenthal Feb 9, 2024
7b330f2
UI Updates
jeznorth Feb 9, 2024
d08129d
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
jeznorth Feb 9, 2024
9c27713
Update frontend to start sending measurement data to backend
NickPhura Feb 9, 2024
a3228a7
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
NickPhura Feb 9, 2024
2852ff3
stubbed out basic critter base call
al-rosenthal Feb 9, 2024
50a835b
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
al-rosenthal Feb 9, 2024
0ec9d24
Fix/patch a bunch of react dependency warnings. Rename additional col…
NickPhura Feb 10, 2024
34147a4
Updating Table Pagination Options
jeznorth Feb 12, 2024
bed1944
continued work with inserting attributes
al-rosenthal Feb 12, 2024
34aa89b
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
al-rosenthal Feb 12, 2024
67360d0
remove isLoading from taxonomy context
NickPhura Feb 12, 2024
d9bbb92
Comment more dependency warnings
NickPhura Feb 12, 2024
5e862d1
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
NickPhura Feb 12, 2024
c4f9004
Format
NickPhura Feb 12, 2024
d213422
Fix more warnings
NickPhura Feb 12, 2024
7147ded
Fix bad tsconfig
NickPhura Feb 12, 2024
80d625a
Fix saving existing observation rows
NickPhura Feb 12, 2024
e85eed4
added basic steps for adding new subcount rows
al-rosenthal Feb 13, 2024
3babd40
fixed up function
al-rosenthal Feb 13, 2024
5fa2997
added some helper functions for system user to db connection
al-rosenthal Feb 13, 2024
797f32f
Componentizing observation table pieces
NickPhura Feb 13, 2024
f729dab
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
NickPhura Feb 13, 2024
5691455
Fix dependency warning
NickPhura Feb 13, 2024
32a6f16
measurement columns added to supplementary data
al-rosenthal Feb 13, 2024
a993011
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
al-rosenthal Feb 13, 2024
e670821
Fixing species name rendering
jeznorth Feb 13, 2024
be2e777
fixed issue with delete
al-rosenthal Feb 13, 2024
6eb5d7d
added some documentation
al-rosenthal Feb 13, 2024
05a1f97
added interfaces, updated function names
al-rosenthal Feb 13, 2024
e1333f3
oops
al-rosenthal Feb 13, 2024
c7c6fc9
oops again
al-rosenthal Feb 13, 2024
0ded3a5
Updates to the observation table components
NickPhura Feb 14, 2024
d437c56
Upgrade mui data grid to latest
NickPhura Feb 15, 2024
767e74a
Disable measurement add/remove when in edit mode
NickPhura Feb 15, 2024
2b14472
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-466
NickPhura Feb 15, 2024
d942f1b
Update critterbase proxy
NickPhura Feb 15, 2024
9e7805a
Merge fixes
NickPhura Feb 15, 2024
fe17544
Disable add measurements when rows in edit mode
NickPhura Feb 15, 2024
d566484
Update critterbase proxy error handling
NickPhura Feb 15, 2024
4a9e275
added actual critter base call
al-rosenthal Feb 15, 2024
9260013
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
al-rosenthal Feb 15, 2024
70e8dcb
frontend updates
NickPhura Feb 16, 2024
e006976
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
NickPhura Feb 16, 2024
ab46af5
added sub count to seed
al-rosenthal Feb 16, 2024
b3d596e
Fix column hiding, and row saving
NickPhura Feb 16, 2024
2a32711
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
NickPhura Feb 16, 2024
2b543a0
Fix toggle all session Storage. Rename context. Debugging save issue.
NickPhura Feb 16, 2024
26afdcc
updated to account for sub counts
al-rosenthal Feb 16, 2024
031a93c
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
al-rosenthal Feb 16, 2024
f743a1a
added subcount to standard columns
al-rosenthal Feb 16, 2024
2863f1c
Fix saving observation rows
NickPhura Feb 16, 2024
de93c84
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
NickPhura Feb 16, 2024
32e8749
Tweaks
NickPhura Feb 16, 2024
2dff483
fixed open api, added documentation
al-rosenthal Feb 17, 2024
eb85457
Fix observation saving
NickPhura Feb 20, 2024
d0bad75
fixing tests
al-rosenthal Feb 20, 2024
d3d4f43
fixed broken tests for observation index
al-rosenthal Feb 20, 2024
bcf859c
Merge branch 'SIMSBIOHUB-466' of https://github.com/bcgov/biohubbc in…
al-rosenthal Feb 20, 2024
54d9632
fixed more tests
al-rosenthal Feb 20, 2024
b82471f
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-466
NickPhura Feb 20, 2024
4e912d3
Update/tighten openapi specs
NickPhura Feb 20, 2024
f208a8e
Fix merge issue
NickPhura Feb 20, 2024
06ed233
updated validation, began work to pull measurements from csv
al-rosenthal Feb 21, 2024
94515e5
fixed delete
al-rosenthal Feb 21, 2024
d87c84c
Merge branch 'SIMSBIOHUB-466' into SIMSBIOHUB-490
al-rosenthal Feb 21, 2024
ef3b4dc
got measurement columns from worksheet
al-rosenthal Feb 21, 2024
b59482e
stubbed out validation process for validating measurements
al-rosenthal Feb 22, 2024
92cc93b
adding measurement insert function to upload process
al-rosenthal Feb 22, 2024
7c2e112
Updates
NickPhura Feb 22, 2024
2068e72
Merge branch 'SIMSBIOHUB-466' into SIMSBIOHUB-490
al-rosenthal Feb 22, 2024
dc60186
fixing up after merge
al-rosenthal Feb 22, 2024
27511fe
fixed insert and deletes
al-rosenthal Feb 22, 2024
03af8a2
Merge branch 'SIMSBIOHUB-466' into SIMSBIOHUB-490
al-rosenthal Feb 22, 2024
3a48625
pulling pieces out for reuse
al-rosenthal Feb 23, 2024
0a808cc
Tweaks
NickPhura Feb 23, 2024
cdcdf95
Fix delete, remove unnecessary observation refresh
NickPhura Feb 23, 2024
bb1c307
MOve grid col defs to folder
NickPhura Feb 23, 2024
76bcdaa
Fixes
NickPhura Feb 23, 2024
3a2c065
wiring up insert
al-rosenthal Feb 23, 2024
b8b4a7c
Merge branch 'SIMSBIOHUB-466' into SIMSBIOHUB-490
al-rosenthal Feb 23, 2024
cf80e82
updated validation code
al-rosenthal Feb 23, 2024
016298e
added await to insert
al-rosenthal Feb 23, 2024
ad73df4
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-466
NickPhura Feb 23, 2024
1760fb2
Fix seed
NickPhura Feb 24, 2024
01e6891
Tweaks
NickPhura Feb 24, 2024
4ab044f
Fix observation save openapi spec
NickPhura Feb 24, 2024
3388bfd
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-466
NickPhura Feb 24, 2024
31c8aa8
Fix tests (comment out some problematic app tests for now).
NickPhura Feb 26, 2024
6a592ce
added test data and fixed validation process
al-rosenthal Feb 26, 2024
62e25b2
Fix test
NickPhura Feb 26, 2024
dcd2ee7
Fix axios test
NickPhura Feb 26, 2024
b7cd024
ignore-skip
NickPhura Feb 26, 2024
cbe2440
Address some code smells
NickPhura Feb 26, 2024
d027f1d
Merge branch 'SIMSBIOHUB-466' into SIMSBIOHUB-490
al-rosenthal Feb 26, 2024
e7517e5
Fix observations column visibility toggle
NickPhura Feb 27, 2024
85308d4
code review updates
NickPhura Feb 27, 2024
074afcb
Code review fixes
NickPhura Feb 27, 2024
f937842
Update endpoint number to integer
NickPhura Feb 27, 2024
0ed68bd
Fix test
NickPhura Feb 28, 2024
735d9d5
Add missing pipeline env var
NickPhura Feb 28, 2024
f224b8f
Fix row modes bug
NickPhura Feb 28, 2024
e0ab7a3
Code review fixes
NickPhura Feb 29, 2024
d1ce3a1
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-466
NickPhura Feb 29, 2024
63af389
Remove manual rowModes set
NickPhura Feb 29, 2024
aa66c26
Merge branch 'SIMSBIOHUB-466' into SIMSBIOHUB-490
al-rosenthal Feb 29, 2024
8c89ed8
fix row modes issue when discarding
NickPhura Feb 29, 2024
c5434da
Merge branch 'SIMSBIOHUB-466' into SIMSBIOHUB-490
al-rosenthal Feb 29, 2024
039c4bf
updated validation, began work to pull measurements from csv
al-rosenthal Feb 21, 2024
5f90915
got measurement columns from worksheet
al-rosenthal Feb 21, 2024
6f39a5b
stubbed out validation process for validating measurements
al-rosenthal Feb 22, 2024
9ead8ad
adding measurement insert function to upload process
al-rosenthal Feb 22, 2024
6f573c8
fixing up after merge
al-rosenthal Feb 22, 2024
5e1c367
pulling pieces out for reuse
al-rosenthal Feb 23, 2024
eadb2b0
wiring up insert
al-rosenthal Feb 23, 2024
010e129
updated validation code
al-rosenthal Feb 23, 2024
27733b5
added await to insert
al-rosenthal Feb 23, 2024
3aa38b8
added test data and fixed validation process
al-rosenthal Feb 26, 2024
bab271c
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
al-rosenthal Mar 1, 2024
e0f5f73
Merge branch 'dev' into SIMSBIOHUB-490
al-rosenthal Mar 1, 2024
8d5ebd1
added new validation code
al-rosenthal Mar 1, 2024
10b56d6
fixed spelling
al-rosenthal Mar 4, 2024
7f66ac9
Merge branch 'dev' into SIMSBIOHUB-490
al-rosenthal Mar 4, 2024
74ea085
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-490
NickPhura Mar 5, 2024
300b2bc
stubbed out repo
al-rosenthal Mar 5, 2024
e835ad7
Merge branch 'dev' into SIMSBIOHUB-490
al-rosenthal Mar 5, 2024
861d386
stubbing out new repo and service functions
al-rosenthal Mar 5, 2024
63ebe3e
Replace subcount_event code
NickPhura Mar 5, 2024
5b0ffc6
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
NickPhura Mar 5, 2024
77f9b4d
added primary key column to migration
al-rosenthal Mar 6, 2024
9303ecb
stubbed out measurement insert process
al-rosenthal Mar 6, 2024
0c3122d
adding delete to observation create flow
al-rosenthal Mar 6, 2024
2515333
Updating get observation query
NickPhura Mar 6, 2024
e2e7538
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
NickPhura Mar 6, 2024
0809bae
updated open api spec to account for new subcounts object
al-rosenthal Mar 6, 2024
8f8b139
Fix get observations repo function
NickPhura Mar 6, 2024
52b5411
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
NickPhura Mar 6, 2024
e604c46
Update app observation subcount types
NickPhura Mar 6, 2024
27bd01f
updated observation csv upload
al-rosenthal Mar 6, 2024
90e067e
Fix endpoint openapi spec
NickPhura Mar 7, 2024
e9caeff
Fix observations table measurement search
NickPhura Mar 7, 2024
6fc406d
added new interface and mapped data type for backend changes
al-rosenthal Mar 7, 2024
c7a1e53
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
al-rosenthal Mar 7, 2024
9b48235
Minor tweaks
NickPhura Mar 7, 2024
97a733b
ADd code to fetch measurement definitions (pending critterbase endpoint)
NickPhura Mar 7, 2024
d9ec969
fixed migration and delete queries
al-rosenthal Mar 7, 2024
093cbdf
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
al-rosenthal Mar 7, 2024
fafd0a1
Update to use critterbase_taxon_measurement_id
NickPhura Mar 7, 2024
d00c7fe
Fix supplementary query
NickPhura Mar 7, 2024
cbd0917
Various fixes
NickPhura Mar 7, 2024
373fc76
Fix saving
NickPhura Mar 8, 2024
8c454c4
Fix delete, remove redundant supplementary data
NickPhura Mar 8, 2024
faff1e6
updated csv upload to account for critterbase data
al-rosenthal Mar 8, 2024
fa2f09d
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
al-rosenthal Mar 8, 2024
3c8d7f9
stubbed out endpoint for removing measurements
al-rosenthal Mar 8, 2024
0a1acb6
Add frontend support to delete observation columns
NickPhura Mar 8, 2024
fa2338c
Remove open connection
NickPhura Mar 8, 2024
7813070
added delete functions
al-rosenthal Mar 8, 2024
1f475de
csv upload now saves data
al-rosenthal Mar 8, 2024
76c8f57
Tweak openapi spec
NickPhura Mar 8, 2024
836d5d9
Delete columns working
NickPhura Mar 8, 2024
eb190b8
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-490
NickPhura Mar 8, 2024
eb36443
Update jsdoc
NickPhura Mar 8, 2024
3c568f8
Remove commented code
NickPhura Mar 8, 2024
7d52781
Move dialog context to wrap individual pages, to improve observations…
NickPhura Mar 8, 2024
ea0778e
fixed upload process
al-rosenthal Mar 8, 2024
b422baa
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
al-rosenthal Mar 8, 2024
e598691
Fix test build errors
NickPhura Mar 9, 2024
9f62b56
Fix unit tests
NickPhura Mar 11, 2024
4bb5636
ran make fix
al-rosenthal Mar 11, 2024
9bdd81f
Remove critter-data endpoints
NickPhura Mar 11, 2024
0282e6f
Update pipeline cli repo
NickPhura Mar 11, 2024
690cfd4
Fix fetching supplementary data
NickPhura Mar 11, 2024
fe8a21d
Make sampling fields nullable in openapi spec
NickPhura Mar 11, 2024
80ca767
Cleanup some code smells
NickPhura Mar 11, 2024
7cb756f
Add new env var to control optional validation
NickPhura Mar 11, 2024
5f019ce
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-490
NickPhura Mar 11, 2024
5c5043b
Fix delete measurement column UI bug
NickPhura Mar 11, 2024
d51f4cb
pulled setMeasurement and refresh into a new function to ensure both …
al-rosenthal Mar 11, 2024
134b1f7
updated code
al-rosenthal Mar 11, 2024
f6fd4b8
moved haserrors to satisfy refresh dependency array
al-rosenthal Mar 11, 2024
377052b
Fix dependency issue
NickPhura Mar 12, 2024
b49dfa8
Merge branch 'SIMSBIOHUB-490' of https://github.com/bcgov/biohubbc in…
NickPhura Mar 12, 2024
d717d2e
Update comments, remove some unused code, fix spelling
NickPhura Mar 12, 2024
7cf1911
Move measurements files
NickPhura Mar 12, 2024
21b69f2
Fix bad import
NickPhura Mar 12, 2024
6fafe38
added more documentation and refactored the process to keep process s…
al-rosenthal Mar 12, 2024
90e60eb
cleaned up refactored function
al-rosenthal Mar 12, 2024
125ae3e
Improved comment about subcounts
NickPhura Mar 12, 2024
a022cc7
Fix critterbase signup url
NickPhura Mar 12, 2024
6fd5ac2
Update env.docker
NickPhura Mar 12, 2024
f7b23ae
Merge remote-tracking branch 'origin/dev' into SIMSBIOHUB-490
NickPhura Mar 12, 2024
da3860c
Set measurement columns to not sortable.
NickPhura Mar 12, 2024
b41f085
Add dynamic measurement column width
NickPhura Mar 12, 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
Prev Previous commit
Next Next commit
continued work with inserting attributes
  • Loading branch information
al-rosenthal committed Feb 12, 2024
commit bed1944888d701c097dfdd6f6a203dab6895c9c9
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ PUT.apiDoc = {
],
properties: {
survey_observation_id: {
type: 'number'
type: 'number',
nullable: true
},
wldtaxonomic_units_id: {
oneOf: [{ type: 'integer' }, { type: 'string' }]
Expand Down Expand Up @@ -510,6 +511,27 @@ export function insertUpdateSurveyObservations(): RequestHandler {
} as InsertObservation | UpdateObservation;
});

console.log('__________________________');
console.log('__________________________');
console.log('__________________________');
console.log('__________________________');
console.log('__________________________');
console.log('UHH');
const measurements: any[] = req.body.surveyObservations.map((item: any) => {
console.log(item.measurementColumns);
return {
survey_observation_id: item.standardColumns.survey_observation_id,
measurements: item.measurementColumns.map((measurement: any) => {
return {
count: null,
measurement_id: measurement.id,
value: measurement.value
};
})
};
});
console.log(measurements);

const surveyObservations = await observationService.insertUpdateSurveyObservations(surveyId, records);

await connection.commit();
Expand Down
37 changes: 37 additions & 0 deletions api/src/repositories/subcount-repository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { z } from 'zod';
import { BaseRepository } from './base-repository';

export const ObservationSubCountRecord = z.object({
observation_subcount_id: z.number(),
survey_observation_id: z.number(),
subcount: z.number().nullable(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});
export type ObservationSubCountRecord = z.infer<typeof ObservationSubCountRecord>;
export type InsertObservationSubCount = Pick<
ObservationSubCountRecord,
'observation_subcount_id' | 'survey_observation_id' | 'subcount'
>;

export const SubCountAttributeRecord = z.object({
subcount_attribute_id: z.number(),
observation_subcount_id: z.number(),
critterbase_event_id: z.string(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});
export type SubCountAttributeRecord = z.infer<typeof SubCountAttributeRecord>;
export type InsertSubCountAttribute = Pick<SubCountAttributeRecord, 'observation_subcount_id' | 'critterbase_event_id'>;

export class SubCountRepository extends BaseRepository {
async insertObservationSubCount(record: InsertObservationSubCount) {}

async insertSubCountAttribute(observationSubCountId: number, records: InsertSubCountAttribute[]) {}
}
4 changes: 2 additions & 2 deletions api/src/services/critterbase-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ export class CritterbaseService {
}

async getAttributes(ids: (string | null)[]): Promise<any> {
const response = await this.axiosInstance.post('', ids);
return response.data;
// const response = await this.axiosInstance.post('', ids);
return [];
}
}
24 changes: 24 additions & 0 deletions api/src/services/subcount-service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { IDBConnection } from '../database/db';
import {
InsertObservationSubCount,
InsertSubCountAttribute,
SubCountRepository
} from '../repositories/subcount-repository';
import { DBService } from './db-service';

export class SubCountService extends DBService {
subCountRepository: SubCountRepository;

constructor(connection: IDBConnection) {
super(connection);
this.subCountRepository = new SubCountRepository(connection);
}

async insertObservationSubCount(record: InsertObservationSubCount) {
return this.subCountRepository.insertObservationSubCount(record);
}

async insertSubCountAttribute(observationSubCountId: number, records: InsertSubCountAttribute[]) {
return this.subCountRepository.insertSubCountAttribute(observationSubCountId, records);
}
}