Skip to content

Commit

Permalink
Merge branch 'develop' into feature/vpc-assigned-linodes-table-header
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh-akamai committed Sep 23, 2024
2 parents ad1f6c3 + 94580bb commit fb6526f
Show file tree
Hide file tree
Showing 254 changed files with 2,762 additions and 1,650 deletions.
2 changes: 1 addition & 1 deletion docs/development-guide/05-fetching-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ Note: the legacy `scrollErrorIntoView` is deprecated in favor of `scrollErrorInt

Since Cloud Manager uses different ways of handling forms and validation, the `scrollErrorIntoViewV2` util should be implemented using the following patterns to ensure consistency.

##### Formik
##### Formik (deprecated)
```Typescript
import * as React from 'react';

Expand Down
2 changes: 2 additions & 0 deletions docs/development-guide/09-mocking-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ const linodeList = linodeFactory.buildList(10, { region: "eu-west" });
// [{ id: 3, label: 'linode-3', region: 'eu-west' }, ...9 more ]
```

Because our factories are used by our dev tools, unit tests, and end-to-end tests, we should avoid creating factories with random or unpredictable default values (e.g. by using utilities like `pickRandom` to assign property values).

### Intercepting Requests

The [Mock Service Worker](https://mswjs.io/) package intercepts requests at the network level and returns the response you defined in the relevant factory.
Expand Down
54 changes: 54 additions & 0 deletions docs/development-guide/15-composition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Composition

## Page Composition
Composing pages in Cloud Manager is a multi-step process that involves several components and patterns. It usually involves using a combination of components already available to the developer, and organized according to the desired layout.

It is best to avoid one off components for pages, or an excessive amount of custom CSS. It is likely that a component already exists to handle the desired layout or styling. It is often a good idea to spend some time looking through the codebase, at [storybook](https://design.linode.com/) or an existing feature of Cloud Manager before making certain composition decisions. It is also important to compose with markup semanticity in mind, and keep an eye on the render tree to avoid bloating the layout with unnecessary containers, wrappers etc, as well as ensuring that the page is accessible, performant, and has good test coverage. When in doubt, one can also check with the product or UX team to ensure that a component exists for the desired layout or styling.

### Responsive Design

While Cloud Manager layout and components are responsive out of the box, some extra handling may be needed for pages that have unique responsive requirements, or because the features has a more complex layout.
A wide array of tools are available to help with responsive design, including media queries, CSS Grid & Flexbox, as well as the `<Hidden />` component, which can be used to hide elements at specific breakpoints.

Some designs may not feature a mobile layout, and for those cases it is recommended to gather existing examples from the codebase, or from other pages that have a similar layout.

## Form Composition

### Formik
Formik is now deprecated. Please use react-hook-form.

### React Hook Form
The preferred library for building forms in Cloud Manager is [react-hook-form](https://react-hook-form.com/). It is a complete set of tools for building complex forms, and is well documented.
The general way to get started is to use the `useForm` hook, which returns a form context and a set of methods to interact with the form.

```Typescript
const methods = useForm<LinodeCreateFormValues>({
defaultValues,
mode: 'onBlur',
resolver: myResolvers,
// other methods
});
```

`methods` is an object that contains the form context and a set of methods to interact with the form.
It is passed to the `FormProvider` component, which is a wrapper that provides the form context to the form.

```Typescript
<FormProvider {...methods}>
<form onSubmit={methods.handleSubmit(onSubmit)}>
{/* form fields */}
<button type="submit">Submit</button>
</form>
</FormProvider>
```

It is important to note that react-hook-form does not provide any UI components. It is the responsibility of the developer to provide the form fields and validation, as well as employing semantic markup for accessibility purposes.
ex: a `<form>` element should have a corresponding `<button type="submit">` element to submit the form so that it is obvious to assistive technologies that the form can be submitted via keyboard.

It is also important to remember to manage the form state through comprehensive context in order to avoid unnecessary rerenders.

The Linode Create Page is a good example of a complex form that is built using react-hook-form, using the best practices mentioned above.

### Uncontrolled Forms
Uncontrolled forms are a type of form that does not have a state for its values. It is often used for simple forms that do not need to be controlled, such as forms with a single input field or call to action.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/api-v4/.changeset/pr-10920-added-1726070878408.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/api-v4": Upcoming Features
---

DBaaS V2 readonly hosts ([#10939](https://github.com/linode/manager/pull/10939))
16 changes: 16 additions & 0 deletions packages/api-v4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## [2024-09-16] - v0.126.0


### Added:

- LinodeCapabilities type used for `capabilities` property of Linode interface ([#10920](https://github.com/linode/manager/pull/10920))

### Tech Stories:

- Update vitest to latest ([#10843](https://github.com/linode/manager/pull/10843))

### Upcoming Features:

- Change 'bs_encryption_supported' property on Linode object to 'capabilities' ([#10837](https://github.com/linode/manager/pull/10837))
- Add beta API root for CloudPulse endpoints ([#10851](https://github.com/linode/manager/pull/10851))

## [2024-09-03] - v0.125.0


Expand Down
4 changes: 2 additions & 2 deletions packages/api-v4/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@linode/api-v4",
"version": "0.125.0",
"version": "0.126.0",
"homepage": "https://github.com/linode/manager/tree/develop/packages/api-v4",
"bugs": {
"url": "https://github.com/linode/manager/issues"
Expand Down Expand Up @@ -67,7 +67,7 @@
"lint-staged": "^15.2.9",
"prettier": "~2.2.1",
"tsup": "^8.2.4",
"vitest": "^2.0.5"
"vitest": "^2.1.1"
},
"lint-staged": {
"*.{ts,tsx,js}": [
Expand Down
23 changes: 21 additions & 2 deletions packages/api-v4/src/databases/databases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ export const getDatabaseBackup = (
);

/**
* restoreWithBackup
* legacyRestoreWithBackup
*
* Fully restore a backup to the cluster
*/
export const restoreWithBackup = (
export const legacyRestoreWithBackup = (
engine: Engine,
databaseID: number,
backupID: number
Expand All @@ -243,6 +243,25 @@ export const restoreWithBackup = (
setMethod('POST')
);

/**
* newRestoreWithBackup for the New Database
*
* Fully restore a backup to the cluster
*/
export const newRestoreWithBackup = (
engine: Engine,
label: string,
fork: {
source: number;
restore_time?: string;
}
) =>
Request<{}>(
setURL(`${API_ROOT}/databases/${encodeURIComponent(engine)}/instances`),
setMethod('POST'),
setData({ fork, label })
);

/**
* getDatabaseCredentials
*
Expand Down
1 change: 1 addition & 0 deletions packages/api-v4/src/databases/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export interface BaseDatabase {
*/
members: Record<string, MemberType>;
platform?: string;
oldest_restore_time?: string;
}

export interface MySQLDatabase extends BaseDatabase {
Expand Down
1 change: 0 additions & 1 deletion packages/api-v4/src/regions/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export type Capabilities =
| 'Kubernetes'
| 'Linodes'
| 'Managed Databases'
| 'Managed Databases Beta'
| 'Metadata'
| 'NodeBalancers'
| 'Object Storage'
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10794-added-1724066782757.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10802-tests-1724271249856.md

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10825-tests-1724428903440.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10835-changed-1724705534485.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10837-tests-1725037321098.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10848-changed-1724869290917.md

This file was deleted.

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10852-tests-1724937535185.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10855-fixed-1724944515841.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10855-tests-1724944533420.md

This file was deleted.

5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-10858-changed-1725914163062.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Changed
---

Move Region section above Images in Linode Create and update default OS to Ubuntu 24.04 LTS ([#10858](https://github.com/linode/manager/pull/10858))
5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10859-added-1725550540714.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10859-changed-1725550568902.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10861-changed-1725028189510.md

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10867-tests-1725460656929.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10867-tests-1725482924721.md

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10870-added-1725366701050.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10871-fixed-1725373117220.md

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10874-added-1725380346411.md

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10879-tests-1725646369852.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10880-tests-1725646735341.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/manager/.changeset/pr-10882-tests-1725437459486.md

This file was deleted.

Loading

0 comments on commit fb6526f

Please sign in to comment.