Skip to content

Commit e9edb4a

Browse files
Merge branch 'develop' into M3-9785-M3-9788-add-nodebalancer-table-and-replace-linodes-with-resources
2 parents 00c8e06 + b39a608 commit e9edb4a

File tree

93 files changed

+885
-498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+885
-498
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"eslint-plugin-prettier": "~5.2.6",
2020
"eslint-plugin-react": "^7.37.4",
2121
"eslint-plugin-react-hooks": "^5.2.0",
22+
"eslint-plugin-react-refresh": "0.4.20",
2223
"eslint-plugin-sonarjs": "^3.0.2",
2324
"eslint-plugin-testing-library": "^7.1.1",
2425
"eslint-plugin-xss": "^0.1.12",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/api-v4": Fixed
3+
---
4+
5+
Make quota_id a string ([#12272](https://github.com/linode/manager/pull/12272))

packages/api-v4/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"lib"
5757
],
5858
"devDependencies": {
59+
"@linode/tsconfig": "workspace:*",
5960
"axios-mock-adapter": "^1.22.0",
6061
"concurrently": "^9.0.1",
6162
"tsup": "^8.4.0"

packages/api-v4/src/quotas/quotas.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export const getQuotas = (
4545
* Returns the usage for a single quota within a particular service specified by `type`.
4646
*
4747
* @param type { QuotaType } retrieve a quota within this service type.
48-
* @param id { number } the quota ID to look up.
48+
* @param id { string } the quota ID to look up.
4949
*/
50-
export const getQuotaUsage = (type: QuotaType, id: number) =>
50+
export const getQuotaUsage = (type: QuotaType, id: string) =>
5151
Request<QuotaUsage>(
5252
setURL(`${BETA_API_ROOT}/${type}/quotas/${id}/usage`),
5353
setMethod('GET'),

packages/api-v4/src/quotas/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface Quota {
2020
/**
2121
* A unique identifier for the quota.
2222
*/
23-
quota_id: number;
23+
quota_id: string;
2424

2525
/**
2626
* The account-wide limit for this service, measured in units

packages/api-v4/tsconfig.json

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
{
2+
"extends": ["@linode/tsconfig/package", "@linode/tsconfig/emit-types"],
23
"compilerOptions": {
3-
"target": "esnext",
4-
"module": "esnext",
5-
"emitDeclarationOnly": true,
6-
"declaration": true,
74
"outDir": "./lib",
8-
"esModuleInterop": true,
9-
"moduleResolution": "bundler",
10-
"skipLibCheck": true,
11-
"strict": true,
125
"baseUrl": ".",
13-
"noUnusedLocals": true,
14-
"declarationMap": true,
15-
"incremental": true
166
},
177
"include": [
188
"src"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Upcoming Features
3+
---
4+
5+
DataStream: add Streams empty state and Create Stream views ([#12235](https://github.com/linode/manager/pull/12235))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tech Stories
3+
---
4+
5+
Reroute Support & Help features ([#12242](https://github.com/linode/manager/pull/12242))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Tech Stories
3+
---
4+
5+
Re-add `eslint-plugin-react-refresh` eslint plugin ([#12267](https://github.com/linode/manager/pull/12267))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
Make quota_id a string ([#12272](https://github.com/linode/manager/pull/12272))

packages/manager/cypress/e2e/core/account/account-linode-managed.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ describe('Account Linode Managed', () => {
173173

174174
// Navigate to the 'Open a Support Ticket' page.
175175
cy.findByText('Support Ticket').should('be.visible').click();
176-
cy.url().should('endWith', '/support/tickets');
176+
cy.url().should('endWith', '/support/tickets/open?dialogOpen=true');
177177

178178
// Confirm that title and category are related to cancelling Linode Managed.
179179
cy.findByLabelText('Title (required)').should(

packages/manager/cypress/support/ui/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export const routes = {
1111
profile: '/profile',
1212
support: '/support',
1313
supportTickets: '/support/tickets',
14-
supportTicketsClosed: '/support/tickets?type=closed',
15-
supportTicketsOpen: '/support/tickets?type=open',
14+
supportTicketsClosed: '/support/tickets/closed',
15+
supportTicketsOpen: '/support/tickets/open',
1616
};
1717
/**
1818
* due 2 rerender of the page that i could not deterministically check i added this wait

packages/manager/eslint.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import perfectionist from 'eslint-plugin-perfectionist';
99
import prettier from 'eslint-plugin-prettier';
1010
import react from 'eslint-plugin-react';
1111
import reactHooks from 'eslint-plugin-react-hooks';
12+
import reactRefresh from 'eslint-plugin-react-refresh';
1213
import sonarjs from 'eslint-plugin-sonarjs';
1314
import testingLibrary from 'eslint-plugin-testing-library';
1415
import xss from 'eslint-plugin-xss';
@@ -18,7 +19,6 @@ import tseslint from 'typescript-eslint';
1819

1920
// Shared import restrictions between different rule contexts
2021
const restrictedImportPaths = [
21-
'rxjs',
2222
'@mui/core',
2323
'@mui/system',
2424
'@mui/icons-material',
@@ -136,11 +136,12 @@ export const baseConfig = [
136136
},
137137
},
138138

139-
// 5. React and React Hooks
139+
// 5. React, React Hooks, and React Refresh
140140
{
141141
files: ['**/*.{ts,tsx}'],
142142
plugins: {
143143
react,
144+
'react-refresh': reactRefresh,
144145
},
145146
rules: {
146147
'react-hooks/exhaustive-deps': 'warn',
@@ -152,6 +153,7 @@ export const baseConfig = [
152153
'react/no-unescaped-entities': 'warn',
153154
'react/prop-types': 'off',
154155
'react/self-closing-comp': 'warn',
156+
'react-refresh/only-export-components': 'warn', // @todo make this error once we fix all occurrences
155157
},
156158
},
157159

@@ -405,6 +407,7 @@ export const baseConfig = [
405407
'src/features/Domains/**/*',
406408
'src/features/DataStream/**/*',
407409
'src/features/Firewalls/**/*',
410+
'src/features/Help/**/*',
408411
'src/features/Images/**/*',
409412
'src/features/Longview/**/*',
410413
'src/features/Managed/**/*',
@@ -415,6 +418,7 @@ export const baseConfig = [
415418
'src/features/TopMenu/SearchBar/**/*',
416419
'src/components/Tag/**/*',
417420
'src/features/StackScripts/**/*',
421+
'src/features/Support/**/*',
418422
'src/features/Volumes/**/*',
419423
'src/features/VPCs/**/*',
420424
],

packages/manager/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"cy:component": "cypress open --component",
113113
"cy:component:run": "cypress run --component --headless -b chrome",
114114
"cy:rec-snap": "cypress run --headless -b chrome --env visualRegMode=record --spec ./cypress/integration/**/*visual*.spec.ts",
115-
"typecheck": "tsc --noEmit && tsc -p cypress --noEmit",
115+
"typecheck": "tsc && tsc -p cypress",
116116
"coverage": "vitest run --coverage && open coverage/index.html",
117117
"coverage:summary": "vitest run --coverage.enabled --reporter=junit --coverage.reporter=json-summary"
118118
},

packages/manager/src/MainContent.tsx

Lines changed: 14 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import * as React from 'react';
1313
import { Redirect, Route, Switch } from 'react-router-dom';
1414
import { makeStyles } from 'tss-react/mui';
1515

16-
import Logo from 'src/assets/logo/akamai-logo.svg';
1716
import { MainContentBanner } from 'src/components/MainContentBanner';
1817
import { MaintenanceScreen } from 'src/components/MaintenanceScreen';
1918
import {
@@ -129,29 +128,11 @@ const Profile = React.lazy(() =>
129128
default: module.Profile,
130129
}))
131130
);
132-
const SupportTickets = React.lazy(
133-
() => import('src/features/Support/SupportTickets')
134-
);
135-
const SupportTicketDetail = React.lazy(() =>
136-
import('src/features/Support/SupportTicketDetail/SupportTicketDetail').then(
137-
(module) => ({
138-
default: module.SupportTicketDetail,
139-
})
140-
)
141-
);
142-
const Help = React.lazy(() =>
143-
import('./features/Help/index').then((module) => ({
144-
default: module.HelpAndSupport,
145-
}))
146-
);
147131
const EventsLanding = React.lazy(() =>
148132
import('src/features/Events/EventsLanding').then((module) => ({
149133
default: module.EventsLanding,
150134
}))
151135
);
152-
const AccountActivationLanding = React.lazy(
153-
() => import('src/components/AccountActivation/AccountActivationLanding')
154-
);
155136
const Databases = React.lazy(() => import('src/features/Databases'));
156137

157138
const CloudPulseMetrics = React.lazy(() =>
@@ -223,6 +204,13 @@ export const MainContent = () => {
223204

224205
const { isPageScrollable } = useIsPageScrollable(contentRef);
225206

207+
migrationRouter.update({
208+
context: {
209+
globalErrors,
210+
queryClient,
211+
},
212+
});
213+
226214
/**
227215
* this is the case where the user has successfully completed signup
228216
* but needs a manual review from Customer Support. In this case,
@@ -232,34 +220,13 @@ export const MainContent = () => {
232220
*/
233221
if (globalErrors.account_unactivated) {
234222
return (
235-
<div className={classes.bgStyling}>
236-
<div className={classes.activationWrapper}>
237-
<Box
238-
style={{
239-
display: 'flex',
240-
justifyContent: 'center',
241-
}}
242-
>
243-
<Logo className={classes.logo} width={215} />
244-
</Box>
245-
<Switch>
246-
<Route
247-
component={SupportTickets}
248-
exact
249-
path="/support/tickets"
250-
strict
251-
/>
252-
<Route
253-
component={SupportTicketDetail}
254-
exact
255-
path="/support/tickets/:ticketId"
256-
strict
257-
/>
258-
<Route component={Help} exact path="/support" />
259-
<Route component={AccountActivationLanding} />
260-
</Switch>
261-
</div>
262-
</div>
223+
<>
224+
<Redirect to="/account-activation" />
225+
<RouterProvider
226+
context={{ queryClient }}
227+
router={migrationRouter as AnyRouter}
228+
/>
229+
</>
263230
);
264231
}
265232

@@ -371,7 +338,6 @@ export const MainContent = () => {
371338
)}
372339
<Route component={Account} path="/account" />
373340
<Route component={Profile} path="/profile" />
374-
<Route component={Help} path="/support" />
375341
<Route
376342
component={EventsLanding}
377343
path="/events"

packages/manager/src/components/AccountActivation/AccountActivationLanding.test.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,26 @@ import * as React from 'react';
33

44
import { renderWithTheme } from 'src/utilities/testHelpers';
55

6-
import AccountActivationLanding from './AccountActivationLanding';
6+
import { AccountActivationLanding } from './AccountActivationLanding';
77

88
const openSupportTicket = 'Open a Support Ticket';
99

10+
const queryMocks = vi.hoisted(() => ({
11+
useLocation: vi.fn().mockReturnValue({
12+
state: {
13+
supportTicketFormFields: {},
14+
},
15+
}),
16+
}));
17+
18+
vi.mock('@tanstack/react-router', async () => {
19+
const actual = await vi.importActual('@tanstack/react-router');
20+
return {
21+
...actual,
22+
useLocation: queryMocks.useLocation,
23+
};
24+
});
25+
1026
describe('AccountActivationLanding', () => {
1127
it('renders the AccountActivationLanding component', () => {
1228
const { getByText, queryByText } = renderWithTheme(

0 commit comments

Comments
 (0)