-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'donskov/v2' into aslobodian/v2-add-import-certificate-d…
…ialog
- Loading branch information
Showing
28 changed files
with
1,853 additions
and
952 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Main CI | ||
on: [workflow_dispatch, push] | ||
jobs: | ||
tests_checks_build: | ||
runs-on: ubuntu-latest | ||
name: Tests, checks, build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: 'yarn' | ||
name: Setup node | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Run linter | ||
run: yarn lint | ||
- name: Run tests | ||
run: yarn test:ci | ||
- name: Run build | ||
run: yarn build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,6 @@ yarn-debug.log* | |
yarn-error.log* | ||
.vercel | ||
|
||
*storybook.log | ||
*storybook.log | ||
|
||
src/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as matchers from "vitest-dom/matchers"; | ||
import { expect } from "vitest"; | ||
import i18n from "./src/i18n"; | ||
i18n.init(); | ||
expect.extend(matchers); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/components/certificates-topbar/CertificatesTopbar.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { CertificatesTopbar } from "./CertificatesTopbar"; | ||
|
||
const meta: Meta<typeof CertificatesTopbar> = { | ||
title: "Components/CertificatesTopbar", | ||
component: CertificatesTopbar, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof CertificatesTopbar>; | ||
|
||
export const Default: Story = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,3 +20,10 @@ | |
} | ||
} | ||
} | ||
.creation_menu { | ||
margin: 0 !important; | ||
|
||
.creation_menu_icon { | ||
color: var(--pv-color-gray-10); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/components/copy-icon-button/CopyIconButton.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { CopyIconButton } from "./CopyIconButton"; | ||
|
||
const meta: Meta<typeof CopyIconButton> = { | ||
title: "Components/CopyIconButton", | ||
component: CopyIconButton, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof CopyIconButton>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
value: "Copied text", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from "react"; | ||
import { | ||
IconButton, | ||
IconButtonProps, | ||
useClipboard, | ||
} from "@peculiar/react-components"; | ||
|
||
import CopyIcon from "../../icons/copy-20.svg?react"; | ||
import CheckIcon from "../../icons/check-20.svg?react"; | ||
|
||
interface CopyIconButtonProps extends Omit<IconButtonProps, "children"> { | ||
value: string; | ||
} | ||
|
||
export const CopyIconButton: React.FunctionComponent<CopyIconButtonProps> = ( | ||
props | ||
) => { | ||
const { copy, isCopied } = useClipboard(); | ||
const { value, size = "small", ...restProps } = props; | ||
|
||
return ( | ||
<IconButton size={size} {...restProps} onClick={() => copy(value)}> | ||
{isCopied ? <CheckIcon /> : <CopyIcon />} | ||
</IconButton> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./CopyIconButton"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { describe, it, expect, render } from "@testing"; | ||
|
||
import { Table } from "./Table"; | ||
|
||
describe("<Table />", () => { | ||
it("should render", () => { | ||
const { getByTestId } = render(<Table data-testid="table" />); | ||
const tableElement = getByTestId("table"); | ||
|
||
expect(tableElement).toBeInTheDocument(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Convert } from "pvtsutils"; | ||
import { Pkcs10CertificateRequest, X509Certificate } from "@peculiar/x509"; | ||
|
||
export function certificateRawToPem(raw: ArrayBuffer, type: "x509" | "csr") { | ||
let pem; | ||
switch (type) { | ||
case "x509": { | ||
const cert = new X509Certificate(Convert.ToBase64(raw)); | ||
pem = cert.toString("pem"); | ||
break; | ||
} | ||
case "csr": { | ||
const req = new Pkcs10CertificateRequest(Convert.ToBase64(raw)); | ||
pem = req.toString("pem"); | ||
break; | ||
} | ||
default: | ||
throw new Error(`Unsupported certificate type: ${type}`); | ||
} | ||
return pem; | ||
} |
Oops, something went wrong.