Skip to content

Commit

Permalink
Merge branch '3.0.0' into storybook
Browse files Browse the repository at this point in the history
  • Loading branch information
amattu2 committed Aug 20, 2024
2 parents 915a52a + 8af2b7c commit b74ad28
Show file tree
Hide file tree
Showing 63 changed files with 5,256 additions and 554 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const config = {
},
],
"max-len": "off",
"no-console": "warn",
"no-console": ["warn", { allow: ["error"] }],
"no-param-reassign": "off",
"object-curly-newline": "off",
"no-underscore-dangle": ["off"],
Expand Down
626 changes: 326 additions & 300 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-storybook": "^0.8.0",
"husky": "^8.0.3",
"jest-canvas-mock": "^2.5.2",
"prettier": "^3.1.1",
"storybook": "^8.1.5",
"storybook-addon-apollo-client": "^7.3.0",
Expand Down
Empty file.
Binary file not shown.
4 changes: 2 additions & 2 deletions src/components/Contexts/OrganizationListContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ export const OrganizationProvider: FC<ProviderProps> = ({ preload, children }: P

const sortedOrganizations = data?.listOrganizations?.sort(
(a, b) => a.name?.localeCompare(b.name)
);
) as Partial<Organization>[];

const activeOrganizations = sortedOrganizations?.filter(
(org: Organization) => org.status === "Active"
(org: Partial<Organization>) => org.status === "Active"
);

setState({
Expand Down
25 changes: 14 additions & 11 deletions src/components/Contexts/SubmissionContext.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe("useSubmissionContext", () => {
data: {
getSubmission: null,
submissionStats: null,
listBatches: null,
batchStatusList: null,
},
},
},
Expand Down Expand Up @@ -151,7 +151,7 @@ describe("SubmissionProvider", () => {
data: {
getSubmission: null,
submissionStats: null,
listBatches: null,
batchStatusList: null,
},
},
},
Expand All @@ -178,7 +178,7 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [],
},
},
Expand Down Expand Up @@ -213,7 +213,7 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [],
},
},
Expand Down Expand Up @@ -249,7 +249,7 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [],
},
},
Expand Down Expand Up @@ -280,9 +280,10 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [
{
_id: "batch-0001",
status: "Uploading",
},
],
Expand Down Expand Up @@ -315,9 +316,10 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [
{
_id: "batch-0001",
status: "Uploaded",
},
],
Expand Down Expand Up @@ -351,7 +353,7 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [],
},
},
Expand Down Expand Up @@ -383,7 +385,7 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [],
},
},
Expand Down Expand Up @@ -413,9 +415,10 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [
{
_id: "batch-0001",
status: "Uploaded",
},
],
Expand Down Expand Up @@ -466,7 +469,7 @@ describe("SubmissionProvider", () => {
submissionStats: {
stats: [],
},
listBatches: {
batchStatusList: {
batches: [],
},
},
Expand Down
6 changes: 4 additions & 2 deletions src/components/Contexts/SubmissionContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ export const SubmissionProvider: FC<ProviderProps> = ({ _id, children }: Provide
d?.getSubmission?.metadataValidationStatus === "Validating" ||
d?.getSubmission?.crossSubmissionStatus === "Validating";
const isDeleting = d?.getSubmission?.deletingData === true;
const hasUploadingBatches = d?.listBatches?.batches?.some((b) => b.status === "Uploading");
const hasUploadingBatches = d?.batchStatusList?.batches?.some(
(b) => b.status === "Uploading"
);

if (!isValidating && !hasUploadingBatches && !isDeleting) {
stopApolloPolling();
Expand Down Expand Up @@ -159,7 +161,7 @@ export const SubmissionProvider: FC<ProviderProps> = ({ _id, children }: Provide
return {
getSubmission: data?.getSubmission,
submissionStats: { stats: sortedStats },
listBatches: data?.listBatches,
batchStatusList: data?.batchStatusList,
};
}, [data]);

Expand Down
Loading

0 comments on commit b74ad28

Please sign in to comment.