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

WD-8546 - Create secrets #1693

Merged
merged 4 commits into from
Feb 5, 2024
Merged

WD-8546 - Create secrets #1693

merged 4 commits into from
Feb 5, 2024

Conversation

huwshimi
Copy link
Contributor

@huwshimi huwshimi commented Feb 1, 2024

Done

  • Create secrets when the add secret form is submitted.

QA

  • Go to the secrets tab in a model.
  • Click the "Add secret" button.
  • Fill out the form and submit.
  • Refresh the page and the secret should appear in the table (the secrets will get refetched in another update).

Details

https://warthogs.atlassian.net/browse/WD-8546

@webteam-app
Copy link

Demo starting at https://juju-dashboard-1693.demos.haus

@huwshimi huwshimi changed the title Create secrets when the add form is submitted. WD-8546 - Create secrets Feb 2, 2024
@@ -78,7 +78,8 @@
"react-scripts": "5.0.1",
"react-useportal": "1.0.19",
"redux": "5.0.1",
"vanilla-framework": "4.5.1"
"vanilla-framework": "4.5.1",
"yup": "1.3.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the validation library that gets used in our other projects that use Formik (I was surprised to see it wasn't being used already).


import FormikField from "./FormikField";

describe("FormikField", () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These tests were copied from MAAS.

value?: HTMLProps<HTMLElement>["value"];
} & ComponentProps<C>;

const FormikField = <C extends ElementType | ComponentType = typeof Input>({
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This component was copied from MAAS.

error?: string | null,
) => void;

export const useModelConnectionCallback = (modelUUID?: string) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've split up this hook so that you can get a function to connect to a model and call a callback.

);
};

export const useModelConnection = (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This version also calls function to connect to the model.

Copy link

codecov bot commented Feb 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e3a006d) 95.14% compared to head (a810ecc) 95.29%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1693      +/-   ##
==========================================
+ Coverage   95.14%   95.29%   +0.15%     
==========================================
  Files         183      184       +1     
  Lines        5400     5468      +68     
  Branches     1577     1592      +15     
==========================================
+ Hits         5138     5211      +73     
+ Misses        242      238       -4     
+ Partials       20       19       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@vladimir-cucu vladimir-cucu left a comment

Choose a reason for hiding this comment

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

Looks good to me and works as expected with local juju 3.3.1 🚀

@huwshimi huwshimi merged commit c4946e7 into canonical:main Feb 5, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants