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

Funding Sources Feature Branch #1066

Merged
merged 165 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from 163 commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
3bcef94
WIP
NickPhura Aug 3, 2023
fbffab8
Stub out initial endpoints, service/repo files, and frontend folders
NickPhura Aug 3, 2023
9ce55d3
Initial version of get funding sources endpoint
NickPhura Aug 3, 2023
7a3cb29
Add funding source router and initial list page
NickPhura Aug 3, 2023
1fc3eb0
wip
al-rosenthal Aug 3, 2023
bb674b4
wip
al-rosenthal Aug 4, 2023
a97e916
stubbing out more ui
al-rosenthal Aug 4, 2023
ba5c372
moved dialog
al-rosenthal Aug 4, 2023
62c1c2e
updating ui
al-rosenthal Aug 4, 2023
c39d1a5
basic form is submitting
al-rosenthal Aug 4, 2023
66d32d3
Update funding api tests
NickPhura Aug 4, 2023
20fda97
added comment
al-rosenthal Aug 4, 2023
d5dad84
Merge branch 'SIMSBIOHUB-173' into funding_sources_feature
al-rosenthal Aug 4, 2023
6a9b84f
Add funding source api code
NickPhura Aug 4, 2023
3824b21
Merge remote-tracking branch 'origin/dev' into funding_sources_feature
NickPhura Aug 4, 2023
8d8e7ac
intial tables setup
KjartanE Aug 2, 2023
3a05f36
updated get endpoint with search params
al-rosenthal Aug 5, 2023
74706b4
Update funding endpoints
NickPhura Aug 8, 2023
a04bcfe
Merge branch 'SIMSBIOHUB-174' into funding_sources_feature
NickPhura Aug 8, 2023
fcc0713
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 8, 2023
246461f
remove project funding frontend, fix basic seed
KjartanE Aug 8, 2023
42bd70b
Update funding source api and tests
NickPhura Aug 8, 2023
238fd74
Merge branch 'SIMSBIOHUB-174' into funding_sources_feature
NickPhura Aug 8, 2023
437d9e6
applied stash
al-rosenthal Aug 8, 2023
cbccf17
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 8, 2023
11063a4
added work for creating funding source
al-rosenthal Aug 8, 2023
2ecd793
fixed get list
al-rosenthal Aug 8, 2023
4c97382
happy path adding funding source is working
al-rosenthal Aug 8, 2023
521f6b0
api get/post/put/delete for survey_funding_source
KjartanE Aug 8, 2023
40ce498
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
al-rosenthal Aug 8, 2023
9028cb3
fixed list
al-rosenthal Aug 8, 2023
f41a51f
got yup schema validation working
al-rosenthal Aug 8, 2023
c015cc2
added loading button to dialog
al-rosenthal Aug 8, 2023
77fde91
added error dialog for API
al-rosenthal Aug 8, 2023
8c3f8c9
update openapi schema, put has revision_count, get
KjartanE Aug 8, 2023
18ef956
added UI styling
al-rosenthal Aug 8, 2023
35892c7
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 8, 2023
d82539d
clean up
al-rosenthal Aug 8, 2023
6b53c3b
reorganized create funding component
al-rosenthal Aug 9, 2023
f766972
clean up
al-rosenthal Aug 9, 2023
972cc47
fixed db table
al-rosenthal Aug 9, 2023
945b2fe
comment
al-rosenthal Aug 9, 2023
ebaff8c
zod fix for survey funding
KjartanE Aug 9, 2023
f2a8cb0
SIMSBIOHUB-172: Added funding sources UI to survey
curtisupshall Aug 9, 2023
52a3ee2
SIMSBIOHUB-172: Added autocomplete; Refactored DollarAmountField
curtisupshall Aug 9, 2023
f151a84
fix survey funding source interfaces
KjartanE Aug 9, 2023
736302d
some UI love
al-rosenthal Aug 9, 2023
3bc4180
updated endpoints and comments
al-rosenthal Aug 9, 2023
8df89f0
SIMSBIOHUB-172: More refactoring
curtisupshall Aug 9, 2023
9304d57
Merge branch 'funding_sources_feature' into SIMSBIOHUB-172
curtisupshall Aug 9, 2023
3c08b54
SIMSBIOHUB-172: Updated interfaces
curtisupshall Aug 9, 2023
04125ff
Added a todo comment
curtisupshall Aug 9, 2023
96fdc6f
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 9, 2023
9a013fd
updated start end date fields to new date picker
al-rosenthal Aug 10, 2023
3e6affd
clean up
al-rosenthal Aug 10, 2023
7220346
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 10, 2023
b90ad60
Update funding list page
NickPhura Aug 10, 2023
412e5b0
Merge branch 'SIMSBIOHUB-174' into funding_sources_feature
NickPhura Aug 10, 2023
1d0cb83
SIMSBIOHUB-172: Amend Yup schema values
curtisupshall Aug 10, 2023
7d26ab2
fixed project creation issue
al-rosenthal Aug 10, 2023
2ceea01
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
al-rosenthal Aug 10, 2023
7bf52ff
SIMSBIOHUB-172: Use AutocompleteField component
curtisupshall Aug 10, 2023
707c448
added mui loading button and removed old
al-rosenthal Aug 10, 2023
fd5f79c
Merge pull request #1067 from bcgov/SIMSBIOHUB-172
curtisupshall Aug 10, 2023
123f47d
Cast funding source amount to int in survey repo methods
curtisupshall Aug 10, 2023
580b81f
Make funding components
curtisupshall Aug 10, 2023
0849b15
Added coalesce for dollar amount sum
curtisupshall Aug 10, 2023
f8da81e
Add funding source details view
NickPhura Aug 10, 2023
6543941
basic edit funding source code wired up
al-rosenthal Aug 10, 2023
fd07175
Merge branch 'funding_sources_feature' into SIMSBIOHUB-174
NickPhura Aug 10, 2023
e7c33db
edit funding source wired up
al-rosenthal Aug 10, 2023
f41ff5e
Updates
NickPhura Aug 10, 2023
11b0816
Merge branch 'SIMSBIOHUB-174' into funding_sources_feature
NickPhura Aug 10, 2023
9a01c79
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 10, 2023
6678b14
Fix funding source for survey upsert
curtisupshall Aug 10, 2023
8024a36
Merge branch 'funding_sources_feature' of github.com:bcgov/biohubbc i…
curtisupshall Aug 10, 2023
a18b204
fixed edit funding source wire up
al-rosenthal Aug 10, 2023
cbeaba7
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 10, 2023
fbbaeea
fix broken tests
KjartanE Aug 9, 2023
b3d5d3d
tests: funding repo/service/endpoints
KjartanE Aug 10, 2023
0cff3a8
Merge branch 'dev' into funding_sources_feature
al-rosenthal Aug 11, 2023
3ad4f10
ignore-skip
al-rosenthal Aug 11, 2023
a19ba66
Update getFundingSource endpoint and UIs
NickPhura Aug 11, 2023
12159f8
Merge branch 'funding_sources_feature' into SIMSBIOHUB-174
NickPhura Aug 11, 2023
5e8fb0e
Rename funding sources tab
NickPhura Aug 11, 2023
0c2bd0a
Update broken tests
NickPhura Aug 11, 2023
b1902fb
view funding source WIP
KjartanE Aug 11, 2023
15fe26a
Merge branch 'funding_sources_feature' into SIMSBIOHUB-174
NickPhura Aug 11, 2023
953a75f
Fix merge conflict
NickPhura Aug 11, 2023
535cbbc
Fix loading spinner.
NickPhura Aug 11, 2023
8a9ca50
Merge branch 'funding_sources_feature' into SIMSBIOHUB-174
NickPhura Aug 11, 2023
17a318f
Add funding list data loader error.
NickPhura Aug 11, 2023
cdafc1d
frontend function for survey funding source add
KjartanE Aug 11, 2023
817baa7
delete modal working
al-rosenthal Aug 11, 2023
949158a
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 11, 2023
64dac05
clean up from merge
al-rosenthal Aug 11, 2023
55f59a9
wired up extra modal open
al-rosenthal Aug 11, 2023
3ec50c0
Align naming conventions across modals
NickPhura Aug 11, 2023
36026b1
Update survey funding sources view
curtisupshall Aug 11, 2023
ac6ea78
Merge branch 'funding_sources_feature' of github.com:bcgov/biohubbc i…
curtisupshall Aug 11, 2023
a83c023
Added forgotten yup schema and init values
curtisupshall Aug 11, 2023
09b8c74
added trim to yup schemas
al-rosenthal Aug 11, 2023
97e2887
Yup schema WIP
curtisupshall Aug 11, 2023
848b86e
YUP number constr
curtisupshall Aug 11, 2023
2ad8c48
Survey fund source for view
curtisupshall Aug 11, 2023
5ff9830
upsert survey funding sources
KjartanE Aug 11, 2023
3855add
updated delete funding source flow
al-rosenthal Aug 11, 2023
899d758
Merge branch 'funding_sources_feature' into SIMSBIOHUB-173
al-rosenthal Aug 11, 2023
77a1fee
Updates
NickPhura Aug 11, 2023
ce1b20a
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
NickPhura Aug 11, 2023
331b211
lint/fix
NickPhura Aug 11, 2023
6952ca2
Misc cleanup
NickPhura Aug 11, 2023
ac4f100
fixed snapshots
al-rosenthal Aug 14, 2023
d43b1bb
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
al-rosenthal Aug 14, 2023
919aefb
fleshed out basic useApi tests
al-rosenthal Aug 14, 2023
f637aff
Create Funding Source and Funding Source Table Clean-up
jeznorth Aug 14, 2023
64ac0cd
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
jeznorth Aug 14, 2023
a5680e2
Update funding sources list and related components
NickPhura Aug 14, 2023
c3c523b
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
NickPhura Aug 14, 2023
9ea56fa
fixed loading state spinner
al-rosenthal Aug 14, 2023
e675d3a
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
al-rosenthal Aug 14, 2023
ddc673a
Add button label prop
NickPhura Aug 14, 2023
e55e5c8
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
NickPhura Aug 14, 2023
72a7d73
UI Development for Funding Source Details Interface
jeznorth Aug 14, 2023
d0366f9
added loading button to yesnodialog
al-rosenthal Aug 14, 2023
4d60a85
cleanup around survey funding source
KjartanE Aug 14, 2023
a5c2012
Continued work on Funding Source UI
jeznorth Aug 14, 2023
920b926
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
jeznorth Aug 14, 2023
0b7172a
removed loading button from yesno dialog
al-rosenthal Aug 14, 2023
057772e
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
al-rosenthal Aug 14, 2023
7c2c6b7
fixed issue with edit dialog spinning with invalid form
al-rosenthal Aug 14, 2023
62df285
Funding Source UI Development
jeznorth Aug 14, 2023
1f370c6
Label Fix
jeznorth Aug 14, 2023
316d14e
delete funding source snackbar
al-rosenthal Aug 14, 2023
6904a6a
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
al-rosenthal Aug 14, 2023
dcb459f
added name to delete funding source snackbar
al-rosenthal Aug 14, 2023
1db5352
Funding Source UI Development
jeznorth Aug 14, 2023
40eb99c
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
jeznorth Aug 14, 2023
a83675c
Fix delete notification content
jeznorth Aug 14, 2023
52e935d
Misc updates
NickPhura Aug 14, 2023
72d25d0
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
NickPhura Aug 14, 2023
9ffdf1a
api test fix
KjartanE Aug 14, 2023
173100a
updated snapshots
al-rosenthal Aug 14, 2023
1888592
funding source details fix
KjartanE Aug 14, 2023
3d14c61
fix bug on delete empty survey funding
KjartanE Aug 14, 2023
563d43c
updated max character descriptions
al-rosenthal Aug 14, 2023
8613cfa
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
al-rosenthal Aug 14, 2023
2af317c
added maxlength to custom text field
al-rosenthal Aug 14, 2023
85eb338
Continued UI Development
jeznorth Aug 14, 2023
0a9a123
Fixing notification messages
jeznorth Aug 14, 2023
4401d31
Add survey links to funding source page.
NickPhura Aug 15, 2023
92a30ca
Update funding source yup schema
NickPhura Aug 15, 2023
22f1ab2
Add max length placeholders
NickPhura Aug 15, 2023
af1b334
Update Start End Date Control and Final Cleanup for Funding source UI
jeznorth Aug 15, 2023
d105e4f
Update tests, fix some code smells
NickPhura Aug 15, 2023
c647a19
Merge branch 'funding_sources_feature' of https://github.com/bcgov/bi…
NickPhura Aug 15, 2023
2302521
Fix code smells
NickPhura Aug 15, 2023
262231b
Update snapshots
NickPhura Aug 15, 2023
302880d
Fixing content and naming conventions
jeznorth Aug 15, 2023
c8fb6c9
Tech debt: Fixed linting errors and skipped tests (#1063)
curtisupshall Aug 15, 2023
7df5f54
Merge remote-tracking branch 'origin/dev' into funding_sources_feature
KjartanE Aug 15, 2023
35fae19
Merge branch 'dev' into funding_sources_feature
curtisupshall Aug 15, 2023
f81e413
Fix test
NickPhura Aug 15, 2023
2c6bc2b
fixing code smells
al-rosenthal Aug 15, 2023
e6bc251
Skip ALL snapshots.
NickPhura Aug 16, 2023
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
16 changes: 8 additions & 8 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/src/database/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export const getDBConnection = function (keycloakToken: object): IDBConnection {
throw new ApiGeneralError('Failed to identify authenticated user');
}

defaultLog.debug({ label: '_setUserContext', keycloakUserInformation });
defaultLog.silly({ label: '_setUserContext', keycloakUserInformation });

// Update the logged in user with their latest information from Keyclaok (if it has changed)
await _updateSystemUserInformation(keycloakUserInformation);
Expand Down
165 changes: 0 additions & 165 deletions api/src/models/project-create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { expect } from 'chai';
import { describe } from 'mocha';
import {
PostCoordinatorData,
PostFundingData,
PostFundingSource,
PostIUCNData,
PostLocationData,
PostObjectivesData,
Expand Down Expand Up @@ -40,10 +38,6 @@ describe('PostProjectObject', () => {
expect(projectPostObject.iucn).to.equal(null);
});

it('sets funding', function () {
expect(projectPostObject.funding).to.equal(null);
});

it('sets partnerships', function () {
expect(projectPostObject.partnerships).to.equal(null);
});
Expand Down Expand Up @@ -91,18 +85,6 @@ describe('PostProjectObject', () => {
}
]
},
funding: {
fundingSources: [
{
agency_id: 1,
investment_action_category: 1,
agency_project_id: 'agency project id',
funding_amount: 12,
start_date: '2020/04/03',
end_date: '2020/05/05'
}
]
},
iucn: {
classificationDetails: [
{
Expand Down Expand Up @@ -338,81 +320,6 @@ describe('PostPartnershipsData', () => {
});
});

describe('PostFundingSource', () => {
describe('No values provided', () => {
let projectFundingData: PostFundingSource;

before(() => {
projectFundingData = new PostFundingSource(null);
});

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

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

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

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

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

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

describe('All values provided', () => {
let projectFundingData: PostFundingSource;

const obj = {
agency_id: 1,
investment_action_category: 1,
agency_project_id: 'agency project id',
funding_amount: 20,
start_date: '2020/04/04',
end_date: '2020/05/05'
};

before(() => {
projectFundingData = new PostFundingSource(obj);
});

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

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

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

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

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

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

describe('PostIUCNData', () => {
describe('No values provided', () => {
let projectIUCNData: PostIUCNData;
Expand Down Expand Up @@ -503,75 +410,3 @@ describe('PostLocationData', () => {
});
});
});

describe('PostFundingData', () => {
describe('No values provided', () => {
let data: PostFundingData;

before(() => {
data = new PostFundingData(null);
});

it('sets fundingSources', () => {
expect(data.fundingSources).to.eql([]);
});
});

describe('Values provided but not valid arrays', () => {
let data: PostFundingData;

const obj = {
fundingSources: null
};

before(() => {
data = new PostFundingData(obj);
});

it('sets fundingSources', () => {
expect(data.fundingSources).to.eql([]);
});
});

describe('Values provided but with no length', () => {
let data: PostFundingData;

const obj = {
fundingSources: []
};

before(() => {
data = new PostFundingData(obj);
});

it('sets fundingSources', () => {
expect(data.fundingSources).to.eql([]);
});
});

describe('All values provided', () => {
let data: PostFundingData;

const obj = {
fundingSources: [
{
agency_id: 1,
investment_action_category: 1,
agency_project_id: 'agency project id',
funding_amount: 12,
start_date: '2020/04/03',
end_date: '2020/05/05',
first_nations_id: null
}
]
};

before(() => {
data = new PostFundingData(obj);
});

it('sets fundingSources', () => {
expect(data.fundingSources).to.eql(obj.fundingSources);
});
});
});
50 changes: 0 additions & 50 deletions api/src/models/project-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export class PostProjectObject {
objectives: PostObjectivesData;
location: PostLocationData;
iucn: PostIUCNData;
funding: PostFundingData;
partnerships: PostPartnershipsData;

constructor(obj?: any) {
Expand All @@ -25,7 +24,6 @@ export class PostProjectObject {
this.project = (obj?.project && new PostProjectData(obj.project)) || null;
this.objectives = (obj?.project && new PostObjectivesData(obj.objectives)) || null;
this.location = (obj?.location && new PostLocationData(obj.location)) || null;
this.funding = (obj?.funding && new PostFundingData(obj.funding)) || null;
this.iucn = (obj?.iucn && new PostIUCNData(obj.iucn)) || null;
this.partnerships = (obj?.partnerships && new PostPartnershipsData(obj.partnerships)) || null;
}
Expand Down Expand Up @@ -155,54 +153,6 @@ export class PostIUCNData {
}
}

/**
* A single project funding agency.
*
* @See PostFundingData
*
* @export
* @class PostFundingSource
*/
export class PostFundingSource {
id?: number;
agency_id?: number;
investment_action_category: number;
agency_project_id: string;
funding_amount: number;
start_date?: string;
end_date?: string;
first_nations_id?: number;

constructor(obj?: any) {
defaultLog.debug({ label: 'PostFundingSource', message: 'params', obj });

this.agency_id = obj?.agency_id || null;
this.investment_action_category = obj?.investment_action_category || null;
this.agency_project_id = obj?.agency_project_id || null;
this.funding_amount = obj?.funding_amount || null;
this.start_date = obj?.start_date || null;
this.end_date = obj?.end_date || null;
this.first_nations_id = obj?.first_nations_id || null;
}
}

/**
* Processes POST /project funding data
*
* @export
* @class PostFundingData
*/
export class PostFundingData {
fundingSources: PostFundingSource[];

constructor(obj?: any) {
defaultLog.debug({ label: 'PostFundingData', message: 'params', obj });

this.fundingSources =
(obj?.fundingSources?.length && obj.fundingSources.map((item: any) => new PostFundingSource(item))) || [];
}
}

/**
* Processes POST /project partnerships data
*
Expand Down
Loading
Loading