-
Notifications
You must be signed in to change notification settings - Fork 39
refactor(Jobs): replace old table with dynamic mat table #2376
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
Open
abdimo101
wants to merge
22
commits into
master
Choose a base branch
from
replace-jobs-table-with-dynamic-mat-table
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
c17a943
replaced jobs table with dynamic mat table
abdimo101 a366f2c
sourcery changes
abdimo101 5fa8505
added a cypress file for jobs with cypress commands
abdimo101 cb646d7
small fixes
abdimo101 fc730e7
fixed spec test
abdimo101 c0f22f7
cypress fix: changed jobType to align with what has been configured i…
abdimo101 3c4a2b0
cypress fix: updated removeJobs and removed .only
abdimo101 32a8a1c
Merge branch 'master' into replace-jobs-table-with-dynamic-mat-table
abdimo101 b00667b
cypress fix: trying a different pid_prefix from env.backend.e2e
abdimo101 ca93be9
Merge branch 'replace-jobs-table-with-dynamic-mat-table' of github.co…
abdimo101 e7877ac
cypress fix: removed pid_prefix
abdimo101 27260e8
added jobConfig and mounted it to docker compose file
abdimo101 721a28b
changed jobconfig file name
abdimo101 80058a5
wip: added env variable
abdimo101 abce7b3
resolved pid mismatch
abdimo101 85c83c3
only testing jobs-general file and enabled cypress video
abdimo101 759b410
changed to the correct test path
abdimo101 b2eeb5e
wip: checking first cypress error msg
abdimo101 1503471
wip: removing local prefix
abdimo101 37aa314
removed cypress video and single cypress test
abdimo101 ca7c4e0
copilot review suggestions added
abdimo101 a73b6f9
eslint fix
abdimo101 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| import { testData } from "../../fixtures/testData"; | ||
|
|
||
| describe("Jobs general", () => { | ||
| beforeEach(() => { | ||
| cy.login(Cypress.env("username"), Cypress.env("password")); | ||
| cy.createDataset({ | ||
| type: "raw", | ||
| dataFileSize: "small", | ||
| datasetName: "Jobs Dataset", | ||
| pid: "scicat_testing/6ED35C17-EDD4-4CD4-B917-4E49698F7532", | ||
| isPublished: true, | ||
| }); | ||
| }); | ||
|
|
||
| afterEach(() => { | ||
| cy.removeJobs(); | ||
| cy.removeDatasets(); | ||
| }); | ||
|
|
||
| describe("Jobs dynamic material table", () => { | ||
| it("should be able to search for job in the global search", () => { | ||
| cy.createJob(); | ||
|
|
||
| cy.visit("/user/jobs"); | ||
|
|
||
| cy.get('[data-cy="text-search"]').type("embargo_period"); | ||
| cy.get('[data-cy="search-button"]').click(); | ||
|
|
||
| cy.get("mat-table mat-row").first().should("contain", "embargo_period"); | ||
| }); | ||
|
|
||
| it("should be able to change page and page size in the job table", () => { | ||
| cy.createJob({ emailJobInitiator: "test1@example.com" }); | ||
| cy.createJob({ emailJobInitiator: "test2@example.com" }); | ||
| cy.createJob({ emailJobInitiator: "test3@example.com" }); | ||
| cy.createJob({ emailJobInitiator: "test4@example.com" }); | ||
| cy.createJob({ emailJobInitiator: "test5@example.com" }); | ||
| cy.createJob({ emailJobInitiator: "test6@example.com" }); | ||
|
|
||
| cy.visit("/user/jobs"); | ||
|
|
||
| cy.get("mat-paginator").first().find("mat-select").click({ force: true }); | ||
| cy.get("mat-option").contains("5").click({ force: true }); | ||
|
|
||
| cy.get("mat-paginator .mat-mdc-paginator-range-actions").contains( | ||
| "1 – 5", | ||
| ); | ||
|
|
||
| cy.get("mat-paginator").first().find("[aria-label='Next page']").click(); | ||
|
|
||
| cy.get("mat-paginator .mat-mdc-paginator-range-actions").contains( | ||
| "6 – 6", | ||
| ); | ||
| }); | ||
|
|
||
| it("should be able to change visible columns settings in the table", () => { | ||
| cy.createJob(); | ||
|
|
||
| cy.visit("/user/jobs"); | ||
|
|
||
| cy.get("dynamic-mat-table mat-header-row.header").should("exist"); | ||
|
|
||
| cy.get("dynamic-mat-table table-menu button").click(); | ||
| cy.get('[role="menu"] button').contains("Default setting").click(); | ||
| cy.get("body").type("{esc}"); | ||
|
|
||
| cy.get("dynamic-mat-table") | ||
| .scrollTo("right", { ensureScrollable: false }) | ||
| .get("mat-header-row") | ||
| .should("contain", "Initiator"); | ||
|
|
||
| cy.get("dynamic-mat-table table-menu button").click(); | ||
| cy.get('[role="menu"] button').contains("Column setting").click(); | ||
|
|
||
| cy.get('[role="menu"]') | ||
| .contains("Initiator") | ||
| .parent() | ||
| .find("input[type=checkbox]") | ||
| .uncheck(); | ||
|
|
||
| cy.contains(".column-config-apply button.done-setting", "done").click(); | ||
|
|
||
| cy.get("dynamic-mat-table table-menu button").click(); | ||
| cy.get('[role="menu"] button').contains("Save table setting").click(); | ||
|
|
||
| cy.reload(); | ||
|
|
||
| cy.get("dynamic-mat-table") | ||
| .scrollTo("right", { ensureScrollable: false }) | ||
| .get("mat-header-row") | ||
| .should("not.contain", "Initiator"); | ||
| }); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 20 additions & 5 deletions
25
src/app/jobs/jobs-dashboard-new/jobs-dashboard-new.component.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,22 @@ | ||
| <shared-table | ||
| <dynamic-mat-table | ||
| [tableName]="tableName" | ||
| [columns]="columns" | ||
| [dataSource]="dataSource" | ||
| [columnsdef]="columns" | ||
| [pageSize]="5" | ||
| (rowClick)="onRowClick($event)" | ||
| [pagination]="pagination" | ||
| [pagingMode]="paginationMode" | ||
| [setting]="setting" | ||
| [pending]="pending" | ||
| [rowSelectionMode]="rowSelectionMode" | ||
| [showGlobalTextSearch]="true" | ||
| [globalTextSearch]="globalTextSearch" | ||
| [globalTextSearchPlaceholder]="'Initiator, Type, Parameters...'" | ||
| (globalTextSearchChange)="onGlobalTextSearchChange($event)" | ||
| (globalTextSearchApply)="onGlobalTextSearchAction()" | ||
| (onRowEvent)="onRowEvent($event)" | ||
| (settingChange)="onSettingChange($event)" | ||
| (paginationChange)="onPaginationChange($event)" | ||
| [emptyMessage]="'No jobs available'" | ||
| [emptyIcon]="'folder'" | ||
| class="mat-elevation-z2" | ||
| > | ||
| </shared-table> | ||
| </dynamic-mat-table> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.