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

feat(subnets): Edit reserved IPs MAASENG-2976 & MAASENG-2984 #5435

Merged
merged 4 commits into from
May 16, 2024

Conversation

ndv99
Copy link
Contributor

@ndv99 ndv99 commented May 15, 2024

Done

  • Enabled "Edit" button on static dhcp lease table
  • Added updateSuccess reducer
  • Added reservedIpId prop to ReserveDHCPLease form
  • ReserveDHCPLease form now pre-fills data when the above prop is provided
  • Added a character counter and character limit to the add/edit form

QA steps

Prerequisites

Add the following lines to your .env.local:*

MAAS_URL = "http://nick-dv.ddns.net:5240/"
VITE_APP_STATIC_IPS_ENABLED = true

Steps

  • Open dev tools, open WS connection
  • Go to /MAAS/r/subnet/4/address-reservation
  • Click "Reserve Static DHCP lease"
  • Fill out the form (correctly!) and submit
  • Click the "Edit" button for this IP
  • Change some values (make sure they are correct)
  • Submit the form
  • Ensure a request has been made to update this reserved IP (id should match the creation request)
  • Ensure the list has been updated

Screenshots

image

Fixes

Notes

*Ping me when you're QAing so I can open the firewall port for you.

@webteam-app
Copy link


const loading = subnetLoading || reservedIpLoading;
const isEditing = !!reservedIpId;

const getInitialValues = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

In order for this to work as expected you'd need to enable enableReinitialize, otherwise if any of the values change after initial render, initial formik state won't be updated.

@ndv99 ndv99 merged commit a58fbfd into canonical:main May 16, 2024
7 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