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(pci-private-network): add the delete modal/action for global reg… #11632

Merged
merged 1 commit into from May 17, 2024

Conversation

seven-amid
Copy link
Contributor

Question Answer
Branch? feat/pci-private-network
Bug fix? no
New feature? yes
Breaking change? yes/no
Tickets DTCORE-2080 & DTCORE-2078
License BSD 3-Clause
  • Try to keep pull requests small so they can be easily reviewed.
  • Commits are signed-off
  • Only FR translations have been updated
  • Branch is up-to-date with target branch
  • Lint has passed locally
  • Standalone app was ran and tested locally
  • Ticket reference is mentioned in linked commits (internal only)
  • Breaking change is mentioned in relevant commits

Description

Related

@seven-amid seven-amid requested review from a team as code owners May 3, 2024 12:09
@seven-amid seven-amid requested review from kqesar, frenautvh, dectotam, darsene and mhelhali-soufien and removed request for a team May 3, 2024 12:09
@github-actions github-actions bot added the feature New feature label May 3, 2024
@seven-amid seven-amid force-pushed the feat/DTCORE-2080 branch 3 times, most recently from fa38b60 to 557eef3 Compare May 3, 2024 12:49
import { TGateway, TRegion } from '@/api/data/project';
import { getSubnets, TSubnet } from '@/api/data/subnets';
import {
getLocalZoneRegions,
isLocalZoneRegion,
paginateResults,
} from '@/api/utils/utils';
import queryClient from '@/queryClient';
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't import queryClient, use the useQueryClient hook
You will create a new instance, not use the one in the context

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 one is imported from a file defining one instance client

import { QueryClient } from '@tanstack/react-query';

export const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      staleTime: 300_000,
    },
  },
});

export default queryClient;

Copy link
Contributor

@chipp972 chipp972 May 15, 2024

Choose a reason for hiding this comment

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

Ok but it still does not look like a good practice to import queryClient directly, even if it works
Using the queryClient from the context is safer imo

https://tanstack.com/query/latest/docs/framework/react/reference/useQueryClient#usequeryclient

Do you think there is any drawbacks to using useQueryClient hook to take it from the context ?

…ions and local zones

ref: DTCORE-2078
ref: DTCORE-2080
Signed-off-by: LIDRISSI Hamid <abdelghani-lidrissi.hamid.ext@ovhcloud.com>
Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Passed Quality Gate passed

Issues
6 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.6% Duplication on New Code

See analysis details on SonarCloud

@seven-amid seven-amid merged commit ae2cf08 into feat/pci-private-network May 17, 2024
14 checks passed
@seven-amid seven-amid deleted the feat/DTCORE-2080 branch May 17, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants