Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d82d94e
refactoring page, pulling out components
al-rosenthal Mar 30, 2023
7d239af
fixed onclicks
al-rosenthal Mar 30, 2023
234a568
error component
al-rosenthal Mar 30, 2023
9b48896
stubbing out another component
al-rosenthal Mar 30, 2023
ccefdb9
Componentize more sections of publish button
KjartanE Mar 30, 2023
ee2012c
got errors displaying
al-rosenthal Mar 30, 2023
4ba014f
Update SurveyObservations.tsx and SubmissionAlertBar.tsx
NickPhura Mar 30, 2023
6518bee
renamed folder
al-rosenthal Mar 30, 2023
6fc7ea0
Fix lint issue
NickPhura Mar 30, 2023
4576180
Merge branch 'BHBC-2286' of https://github.com/bcgov/biohubbc into BH…
NickPhura Mar 30, 2023
127cd95
moved things into component folder
al-rosenthal Mar 30, 2023
eb697ed
Tweak Message HTML
NickPhura Mar 30, 2023
b1b10ae
Merge branch 'BHBC-2286' of https://github.com/bcgov/biohubbc into BH…
NickPhura Mar 30, 2023
069d241
fixing more state issues
al-rosenthal Mar 31, 2023
8992258
Merge branch 'BHBC-2286' of https://github.com/bcgov/biohubbc into BH…
KjartanE Mar 31, 2023
1deb1c6
message/ file display better
al-rosenthal Mar 31, 2023
49d537c
BHBC-2266: Add project supplementary data + fix tests
NickPhura Mar 31, 2023
ce7d37b
Fix merge issues
NickPhura Mar 31, 2023
17f4d54
small tweaks
al-rosenthal Mar 31, 2023
0a0d1eb
Merge branch 'BHBC-2286' of https://github.com/bcgov/biohubbc into BH…
al-rosenthal Mar 31, 2023
bdcc52f
Main ticket functioning, mvp
KjartanE Mar 31, 2023
1f1d964
Merge branch 'BHBC-2286' into feature_branch
al-rosenthal Mar 31, 2023
ef9c1fc
Merge remote-tracking branch 'origin/dev' into feature_branch
NickPhura Mar 31, 2023
4791a2e
Merge branch 'BHBC-2266' into feature_branch
NickPhura Mar 31, 2023
e463d4e
Pull observation id from observation dataloader
NickPhura Mar 31, 2023
b57c220
Remove unused variable
NickPhura Mar 31, 2023
fed1121
fixed loading states and definitions
al-rosenthal Mar 31, 2023
6b074c1
clean up
al-rosenthal Apr 1, 2023
a5621cc
Observation Validation fix
KjartanE Apr 3, 2023
fbd361d
Update project components to use context.
NickPhura Apr 4, 2023
182d567
Merge branch 'feature_branch' of https://github.com/bcgov/biohubbc in…
NickPhura Apr 4, 2023
99aa35d
Update project participants components
NickPhura Apr 4, 2023
fde1757
update observation upload icon
KjartanE Apr 4, 2023
8979ec2
Merge branch 'dev' of https://github.com/bcgov/biohubbc into feature_…
KjartanE Apr 4, 2023
6881b12
code smells
KjartanE Apr 4, 2023
9269719
added logic to context refresh
al-rosenthal Apr 4, 2023
4ec8f07
Merge branch 'feature_branch' of https://github.com/bcgov/biohubbc in…
al-rosenthal Apr 4, 2023
9380581
code smells, api test fix
KjartanE Apr 4, 2023
fc8e24a
Merge branch 'feature_branch' of https://github.com/bcgov/biohubbc in…
KjartanE Apr 4, 2023
ba27994
Move project participation repo functions to own repo file
NickPhura Apr 4, 2023
d027354
Merge branch 'feature_branch' of https://github.com/bcgov/biohubbc in…
NickPhura Apr 4, 2023
34d7941
Updates
NickPhura Apr 5, 2023
3481490
fix frontend tests
KjartanE Apr 5, 2023
163e26c
Fix api test
NickPhura Apr 5, 2023
2ce43a9
Update app tests
NickPhura Apr 6, 2023
b8ee72f
ignore-skip
NickPhura Apr 6, 2023
2e50c70
Update create/edit survey to use contexts, fix bug with taxon multise…
NickPhura Apr 6, 2023
2ce9bd6
Fix test to avoid warning
NickPhura Apr 6, 2023
66c699d
stubbing out testing
al-rosenthal Apr 6, 2023
9434e8d
Merge branch 'feature_branch' of https://github.com/bcgov/biohubbc in…
al-rosenthal Apr 6, 2023
54abd28
removed half test
al-rosenthal Apr 6, 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
106 changes: 10 additions & 96 deletions api/package-lock.json

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

2 changes: 0 additions & 2 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
"fast-deep-equal": "~3.1.3",
"fast-json-patch": "~3.1.1",
"form-data": "~4.0.0",
"jsonpath": "~1.1.1",
"jsonpath-plus": "^7.2.0",
"jsonwebtoken": "~8.5.1",
"jwks-rsa": "~2.0.5",
Expand Down Expand Up @@ -71,7 +70,6 @@
"@types/express": "~4.17.13",
"@types/geojson": "~7946.0.8",
"@types/gulp": "~4.0.9",
"@types/jsonpath": "~0.2.0",
"@types/jsonwebtoken": "~8.5.5",
"@types/lodash": "~4.14.176",
"@types/mime": "~2.0.3",
Expand Down
9 changes: 9 additions & 0 deletions api/src/models/project-view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ describe('GetProjectData', () => {
data = new GetProjectData();
});

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

it('sets name', () => {
expect(data.project_name).to.equal('');
});
Expand Down Expand Up @@ -48,6 +52,7 @@ describe('GetProjectData', () => {

describe('all values provided', () => {
const projectData = {
project_id: 1,
name: 'project name',
pt_id: 4,
start_date: '2020-04-20T07:00:00.000Z',
Expand All @@ -63,6 +68,10 @@ describe('GetProjectData', () => {
data = new GetProjectData(projectData, activityData);
});

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

it('sets name', () => {
expect(data.project_name).to.equal(projectData.name);
});
Expand Down
8 changes: 7 additions & 1 deletion api/src/models/project-view.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Feature } from 'geojson';
import moment from 'moment';
import { COMPLETION_STATUS } from '../constants/status';
import { ProjectMetadataPublish } from '../repositories/history-publish-repository';

export interface IGetProject {
id: number;
coordinator: GetCoordinatorData;
project: GetProjectData;
objectives: GetObjectivesData;
Expand All @@ -20,6 +20,7 @@ export interface IGetProject {
* @class GetProjectData
*/
export class GetProjectData {
id: number;
uuid: string;
project_name: string;
project_type: number;
Expand All @@ -31,6 +32,7 @@ export class GetProjectData {
revision_count: number;

constructor(projectData?: any, activityData?: any[]) {
this.id = projectData?.project_id || null;
this.uuid = projectData?.uuid || '';
this.project_name = projectData?.name || '';
this.project_type = projectData?.pt_id || -1;
Expand Down Expand Up @@ -194,6 +196,10 @@ export class GetPartnershipsData {
}
}

export type ProjectSupplementaryData = {
project_metadata_publish: ProjectMetadataPublish | null;
};

interface IGetAttachmentsSource {
file_name: string;
file_type: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export function updateSurvey(): RequestHandler {

return res.status(200).json({ id: surveyId });
} catch (error) {
defaultLog.error({ label: 'updateProject', message: 'error', error });
defaultLog.error({ label: 'updateSurvey', message: 'error', error });
await connection.rollback();
throw error;
} finally {
Expand Down
12 changes: 9 additions & 3 deletions api/src/paths/project/{projectId}/view.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import * as db from '../../../database/db';
import { HTTPError } from '../../../errors/http-error';
import { IGetProject } from '../../../models/project-view';
import { ProjectService } from '../../../services/project-service';
import { getMockDBConnection, getRequestHandlerMocks } from '../../../__mocks__/db';
import { GET, viewProject } from './view';
Expand All @@ -30,9 +31,11 @@ describe('project/{projectId}/view', () => {

sinon.stub(db, 'getDBConnection').returns(dbConnectionObj);

const viewProjectResult = { id: 1 };
const viewProjectResult = { project: { id: 1 } } as IGetProject;
const supplementaryProjectData = { project_metadata_publish: null };

sinon.stub(ProjectService.prototype, 'getProjectById').resolves(viewProjectResult as any);
sinon.stub(ProjectService.prototype, 'getProjectById').resolves(viewProjectResult);
sinon.stub(ProjectService.prototype, 'getProjectSupplementaryDataById').resolves(supplementaryProjectData);

const { mockReq, mockRes, mockNext } = getRequestHandlerMocks();

Expand All @@ -45,7 +48,10 @@ describe('project/{projectId}/view', () => {
}

expect(mockRes.statusValue).to.equal(200);
expect(mockRes.jsonValue).to.eql(viewProjectResult);
expect(mockRes.jsonValue).to.eql({
projectData: viewProjectResult,
projectSupplementaryData: supplementaryProjectData
});
});

it('catches and re-throws error', async () => {
Expand Down
Loading