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

fix(9656): stores all states except workflows, fixes #9656 #9846

Merged
merged 10 commits into from Nov 28, 2022

Conversation

athityakumar
Copy link
Contributor

@athityakumar athityakumar commented Oct 17, 2022

Fixes #9656

Please do not open a pull request until you have checked ALL of these:

  • Create the PR as draft .
  • Run make pre-commit -B to fix codegen and lint problems.
  • Sign-off your commits (otherwise the DCO check will fail).
  • Use a conventional commit message (otherwise the commit message check will fail).
  • "Fixes #" is in both the PR title (for release notes) and this description (to automatically link and close the issue).
  • Add unit or e2e tests. Say how you tested your changes. If you changed the UI, attach screenshots.

The workflows key/value is no longer stored in browser's local storage for archived workflows page, after this change:

image

  • Github checks are green.
  • Once required tests have passed, mark your PR "Ready for review".

If changes were requested, and you've made them, dismiss the review to get it reviewed again.

Signed-off-by: Athitya Kumar <athityakumar@gmail.com>
@athityakumar athityakumar changed the title fix(9656): stores all states except workflows in browser local storag… fix(9656): stores all states except workflows, fixes #9656 Oct 22, 2022
@athityakumar athityakumar marked this pull request as ready for review October 24, 2022 14:52
athityakumar and others added 3 commits October 27, 2022 14:03
Signed-off-by: Athitya Kumar <athityakumar@gmail.com>
Signed-off-by: Athitya Kumar <athityakumar@gmail.com>
@sarabala1979 sarabala1979 enabled auto-merge (squash) October 29, 2022 05:14
private saveHistory() {
this.storage.setItem('options', this.state, {} as State);
this.storage.setItem('options', this.fetchBrowserStorageStateObject(this.state), {} as State);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the correct approach. A new objects should be constructed with only allowed fields.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interface Options {
        namespace: string
        name: string
        namePrefix: string
        selectedPhases: string[]
        selectedLabels: string[]
        minStartedAt: Date
        maxStartedAt: Date
        pagination: Pagination
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexec - But that'd mean we have to set the attributes manually for the new options variable, which is an Options interface object right? @juliev0 had raised a concern earlier that manually specifying attributes may have a maintenance overhead (if/when we add a new attribute to State interface, we'd also have to add it to the Options interface and in the function that converts the State object to Options object) - due to which I tried to automate the logic by taking blacklistedStates as an input.

Please lmk if Options is the preferred approach - I can update my PR with the same changes 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it preferable to construct new object to write lots of code to black list fields. Less code to maintain I think.

@athityakumar
Copy link
Contributor Author

@sarabala1979 @alexec - Any next steps on this PR? Please lmk if any action is required from my side 😄

Signed-off-by: Athitya Kumar <athityakumar@gmail.com>
Signed-off-by: Athitya Kumar <athityakumar@gmail.com>
auto-merge was automatically disabled November 22, 2022 19:01

Head branch was pushed to by a user without write access

@alexec alexec merged commit 225cd97 into argoproj:master Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Archived Workflows - Failed to execute 'setItem' on 'Storage'
5 participants