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

Feature/design improvements #184

Merged
merged 38 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
34127ec
Merge pull request #134 from CSCfi/develop
blankdots Jan 19, 2021
888490b
Use naming consistent with default behaviour
pontus Jan 22, 2021
6eb7a5d
Merge pull request #137 from pontus/feature/consistent_network_naming
blankdots Jan 22, 2021
4cd13d4
Merge pull request #165 from CSCfi/develop
blankdots Feb 12, 2021
4a82f22
Fix for Home unit test error
hannyle Feb 15, 2021
5430554
Add constant file for submissionTypes
hannyle Feb 15, 2021
3b0a58f
Fix for related unit tests
hannyle Feb 15, 2021
1da11c3
Add constant file for objectTypes
hannyle Feb 17, 2021
f974431
Update files related to SubmissionStatus
hannyle Feb 18, 2021
ddf8473
Update files related to ObjectSubmissionTypes and ObjectTypes
hannyle Feb 18, 2021
5ad82e5
Update files related to ObjectStatus
hannyle Feb 18, 2021
8828763
Add constant file for WizardStatus and update related files
hannyle Feb 18, 2021
9ee17c0
update packages to latest
blankdots Feb 19, 2021
254e0eb
add husky pre-commit
blankdots Feb 19, 2021
f0d7403
small fixes to e2e tests
blankdots Feb 19, 2021
5e2584e
don't use strict mode in avj
blankdots Feb 19, 2021
a55f114
update packages
lilachic Feb 15, 2021
331f3e7
update to latest packages
lilachic Feb 15, 2021
f56ae26
downgrade flow-bin
lilachic Feb 18, 2021
5eb5c60
correct package lock
blankdots Feb 19, 2021
200b12e
update packages again
blankdots Feb 22, 2021
48c3d16
Update flow-bin to latest and fix all the files' warnings
hannyle Feb 24, 2021
21a7478
Create one folder for common types and update related files
hannyle Feb 26, 2021
963926e
Add missing dataTypes in some files
hannyle Feb 26, 2021
67b369c
Design improvements
saulipurhonen Mar 9, 2021
9308045
Submission actions and object index styles
saulipurhonen Mar 9, 2021
1c311ff
Resolved conflict
saulipurhonen Mar 9, 2021
f8e771e
Resolved merge conflicts
saulipurhonen Mar 9, 2021
8f3c9f6
Merge branch 'bugfix/backend-required-title' of https://github.com/CS…
saulipurhonen Mar 10, 2021
2b42861
Submitted object tooltip content & summary list styles
saulipurhonen Mar 10, 2021
12622cf
Removed renamed files
saulipurhonen Mar 10, 2021
20943c8
Separate submission folder listing and detail display logic into reus…
saulipurhonen Mar 11, 2021
29a10eb
Update src/components/NewDraftWizard/WizardComponents/WizardObjectInd…
saulipurhonen Mar 10, 2021
1342d3b
Resolved conflict
saulipurhonen Mar 11, 2021
becfc92
Merge branch 'feature/design-improvements' of https://github.com/CSCf…
saulipurhonen Mar 12, 2021
9c8889e
Update src/components/Home/SelectedFolderDetails.js
saulipurhonen Mar 12, 2021
13cbacd
Merge branch 'feature/design-improvements' of https://github.com/CSCf…
saulipurhonen Mar 12, 2021
b72b279
Breadcrumbs for folders
saulipurhonen Mar 12, 2021
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
21 changes: 0 additions & 21 deletions cypress/integration/home.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ describe("Home e2e", function () {
cy.contains("Your Published Submissions").should("be.visible")

cy.get("ul.MuiList-root").eq(0).children().should("have.length.at.most", 5)
cy.get("ul.MuiList-root").eq(1).children().should("have.length.at.most", 5)

// Create a new Unpublished folder
cy.get("button").contains("Create Submission").click()
Expand Down Expand Up @@ -82,16 +81,6 @@ describe("Home e2e", function () {
cy.contains("Your draft submissions")
.should("be.visible")
.then($el => $el.click())

// Close unpublished folders list
cy.get("div.MuiCardActions-root")
.contains("Close")
.should("be.visible")
.then($btn => $btn.click())

// Check Overview submissions page is shown
cy.contains("Your Draft Submissions").should("be.visible")
cy.contains("Your Published Submissions").should("be.visible")
})

it("create a published folder, navigate to see folder details, delete object inside folder, navigate back to Overview submissions", () => {
Expand Down Expand Up @@ -157,15 +146,5 @@ describe("Home e2e", function () {
cy.contains("Your published submissions")
.should("be.visible")
.then($el => $el.click())

// Close published folders list
cy.get("div.MuiCardActions-root")
.contains("Close")
.should("be.visible")
.then($btn => $btn.click())

// Check Overview submissions page is shown
cy.contains("Your Draft Submissions").should("be.visible")
cy.contains("Your Published Submissions").should("be.visible")
})
})
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ services:
tty: true
networks:
# Change if using different network for backend container
- metadatasubmitter_default
- metadata-submitter_default

networks:
metadatasubmitter_default:
metadata-submitter_default:
external: true
48 changes: 46 additions & 2 deletions package-lock.json

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

22 changes: 22 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import CssBaseline from "@material-ui/core/CssBaseline"
import { makeStyles } from "@material-ui/core/styles"
import { Switch, Route, useLocation } from "react-router-dom"

import SelectedFolderDetails from "components/Home/SelectedFolderDetails"
import SubmissionFolderList from "components/Home/SubmissionFolderList"
import Nav from "components/Nav"
import Page401 from "views/ErrorPages/Page401"
import Page403 from "views/ErrorPages/Page403"
Expand Down Expand Up @@ -79,6 +81,26 @@ const App = (): React$Element<typeof React.Fragment> => {
<Home />
</Container>
</Route>
<Route exact path="/home/drafts">
<Container component="main" maxWidth="md" className={classes.content}>
<SubmissionFolderList />
</Container>
</Route>
<Route path="/home/drafts/:folderId">
<Container component="main" maxWidth="md" className={classes.content}>
<SelectedFolderDetails />
</Container>
</Route>
<Route exact path="/home/published">
<Container component="main" maxWidth="md" className={classes.content}>
<SubmissionFolderList />
</Container>
</Route>
<Route path="/home/published/:folderId">
<Container component="main" maxWidth="md" className={classes.content}>
<SelectedFolderDetails />
</Container>
</Route>
<Route path="/error401">
<Page401 />
</Route>
Expand Down
6 changes: 5 additions & 1 deletion src/__tests__/WizardAddObjectStep.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from "react"

import "@testing-library/jest-dom/extend-expect"
import { ThemeProvider } from "@material-ui/core/styles"
import { render, screen, act } from "@testing-library/react"
import { Provider } from "react-redux"
import configureStore from "redux-mock-store"
import { toMatchDiffSnapshot } from "snapshot-diff"

import WizardAddObjectStep from "../components/NewDraftWizard/WizardSteps/WizardAddObjectStep"
import CSCtheme from "../theme"

import { ObjectSubmissionTypes, ObjectSubmissionsArray, ObjectTypes } from "constants/wizardObject"

Expand Down Expand Up @@ -72,7 +74,9 @@ describe("WizardAddObjectStep", () => {
})
render(
<Provider store={store}>
<WizardAddObjectStep />
<ThemeProvider theme={CSCtheme}>
<WizardAddObjectStep />
</ThemeProvider>
</Provider>
)
expect(screen.getByTestId(typeName)).toBeInTheDocument()
Expand Down
6 changes: 5 additions & 1 deletion src/__tests__/WizardDraftObjectPicker.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from "react"

import "@testing-library/jest-dom/extend-expect"
import { ThemeProvider } from "@material-ui/core/styles"
import { render, screen } from "@testing-library/react"
import { Provider } from "react-redux"
import configureStore from "redux-mock-store"
import thunk from "redux-thunk"

import WizardDraftObjectPicker from "../components/NewDraftWizard/WizardComponents/WizardDraftObjectPicker"
import CSCtheme from "../theme"

import { ObjectSubmissionTypes, ObjectTypes } from "constants/wizardObject"

Expand All @@ -33,7 +35,9 @@ describe("WizardStepper", () => {
it("should have drafts listed for selected object type", async () => {
render(
<Provider store={store}>
<WizardDraftObjectPicker />
<ThemeProvider theme={CSCtheme}>
<WizardDraftObjectPicker />
</ThemeProvider>
</Provider>
)
expect(screen.getAllByRole("button")).toHaveLength(4)
Expand Down
10 changes: 8 additions & 2 deletions src/__tests__/WizardFillObjectDetailsForm.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from "react"

import "@testing-library/jest-dom/extend-expect"
import { ThemeProvider } from "@material-ui/core/styles"
import { render, screen, waitFor } from "@testing-library/react"
import { Provider } from "react-redux"
import configureStore from "redux-mock-store"

import WizardFillObjectDetailsForm from "../components/NewDraftWizard/WizardForms/WizardFillObjectDetailsForm"
import CSCtheme from "../theme"

import { ObjectSubmissionTypes, ObjectTypes } from "constants/wizardObject"

Expand Down Expand Up @@ -48,7 +50,9 @@ describe("WizardFillObjectDetailsForm", () => {
it("should create study form from schema in sessionStorage", async () => {
render(
<Provider store={store}>
<WizardFillObjectDetailsForm />
<ThemeProvider theme={CSCtheme}>
<WizardFillObjectDetailsForm />
</ThemeProvider>
</Provider>
)
await waitFor(() => screen.getByText("Study Description"))
Expand All @@ -60,7 +64,9 @@ describe("WizardFillObjectDetailsForm", () => {
const spy = jest.spyOn(Storage.prototype, "getItem")
render(
<Provider store={store}>
<WizardFillObjectDetailsForm />
<ThemeProvider theme={CSCtheme}>
<WizardFillObjectDetailsForm />
</ThemeProvider>
</Provider>
)
expect(spy).toBeCalledWith("cached_study_schema")
Expand Down
10 changes: 8 additions & 2 deletions src/__tests__/WizardObjectIndex.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ describe("WizardObjectIndex", () => {
{ accessionId: "TESTID0101", schema: `draft-${ObjectTypes.analysis}` },
{ accessionId: "TESTID0202", schema: `draft-${ObjectTypes.experiment}` },
],
metadataObjects: [
{ accessionId: "TESTID1234", schema: ObjectTypes.study },
{ accessionId: "TESTID5678", schema: ObjectTypes.study },
{ accessionId: "TESTID0101", schema: ObjectTypes.analysis },
{ accessionId: "TESTID0202", schema: ObjectTypes.experiment },
],
},
})

Expand All @@ -41,10 +47,10 @@ describe("WizardObjectIndex", () => {
)

const badge = await screen.queryAllByTestId("badge")
expect(badge).toHaveLength(8)
expect(badge).toHaveLength(3)
const studyBadge = screen.queryAllByTestId("badge")[0]
expect(studyBadge).toHaveTextContent(2)
const analysisBadge = screen.queryAllByTestId("badge")[4]
const analysisBadge = screen.queryAllByTestId("badge")[1]
expect(analysisBadge).toHaveTextContent(1)
const experimentBadge = screen.queryAllByTestId("badge")[2]
expect(experimentBadge).toHaveTextContent(1)
Expand Down
6 changes: 5 additions & 1 deletion src/__tests__/WizardSavedObjectsList.test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React from "react"

import "@testing-library/jest-dom/extend-expect"
import { ThemeProvider } from "@material-ui/core/styles"
import { render, screen, within } from "@testing-library/react"
import { Provider } from "react-redux"
import configureStore from "redux-mock-store"

import WizardSavedObjectsList from "../components/NewDraftWizard/WizardComponents/WizardSavedObjectsList"
import CSCtheme from "../theme"

import { ObjectTypes, ObjectSubmissionTypes } from "constants/wizardObject"

Expand All @@ -26,7 +28,9 @@ describe("WizardStepper", () => {
beforeEach(() => {
render(
<Provider store={store}>
<WizardSavedObjectsList submissions={submissions} />
<ThemeProvider theme={CSCtheme}>
<WizardSavedObjectsList submissions={submissions} />
</ThemeProvider>
</Provider>
)
})
Expand Down
6 changes: 5 additions & 1 deletion src/__tests__/WizardShowSummaryStep.test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import React from "react"

import "@testing-library/jest-dom/extend-expect"
import { ThemeProvider } from "@material-ui/core/styles"
import { render, screen } from "@testing-library/react"
import { Provider } from "react-redux"
import configureStore from "redux-mock-store"
import { toMatchDiffSnapshot } from "snapshot-diff"

import WizardShowSummaryStep from "../components/NewDraftWizard/WizardSteps/WizardShowSummaryStep"
import CSCtheme from "../theme"

import { ObjectTypes } from "constants/wizardObject"

Expand Down Expand Up @@ -43,7 +45,9 @@ describe("WizardShowSummaryStep", () => {
})
wrapper = (
<Provider store={store}>
<WizardShowSummaryStep />
<ThemeProvider theme={CSCtheme}>
<WizardShowSummaryStep />
</ThemeProvider>
</Provider>
)
})
Expand Down
Loading