Skip to content

Commit

Permalink
CaPoolModal story
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrikMatiasko committed May 14, 2024
1 parent 21f62d1 commit 5656b5c
Show file tree
Hide file tree
Showing 7 changed files with 175 additions and 85 deletions.
63 changes: 0 additions & 63 deletions src/components/Atomic/StatusBar/StatusBar.scss

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/Atomic/StatusBar/StatusBar.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/components/Atomic/StatusBar/index.ts

This file was deleted.

151 changes: 151 additions & 0 deletions src/stories/Organism/CaPoolModal.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
import React from 'react'
import { StoryFn } from '@storybook/react'
import CaPoolModal from '../../components/Organisms/CaPoolModal'

export default {
title: 'Organism/CaPoolModal',
component: CaPoolModal,
argTypes: {},
}

const caData = {
title: 'CA Pool Detail',
subTitle: 'CN: Root CA',
data: [
{
ext: {
aia: {
critical: false,
},
aKID: null,
basicConstraints: {
cA: true,
critical: true,
},
cp: {
critical: false,
},
keyUsages: {
critical: true,
purposes: ['Certificate Signing', 'CRL Signing'],
},
msCrypto: {
exists: false,
},
ocspStaple: {
critical: false,
required: false,
},
scts: {
critical: false,
timestamps: [],
},
sKID: {
critical: false,
id: 'DE:60:09:A9:5E:1B:00:D5:86:DF:87:62:A9:FC:0A:87:1A:8A:47:F1',
},
san: {
altNames: [],
critical: false,
},
},
files: {
pem: '-----BEGIN%20CERTIFICATE-----%0D%0AMIIBZTCCAQqgAwIBAgIQQJcvpwtpUBg42Io1sGFeHDAKBggqhkjOPQQDAjASMRAw%0D%0ADgYDVQQDEwdSb290IENBMB4XDTI0MDEyOTE3Mzg1MFoXDTI1MDEyODE3Mzg1MFow%0D%0AEjEQMA4GA1UEAxMHUm9vdCBDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABA0b%0D%0AeUYp3iFXkU0WU3fFi4knWmU8R1YZXcFded8sufEbx5epZ0g2mdMfi2BnIUMsNUQR%0D%0AP60y/vNMSJfPgoq9Wt+jQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTAD%0D%0AAQH/MB0GA1UdDgQWBBTeYAmpXhsA1Ybfh2Kp/AqHGopH8TAKBggqhkjOPQQDAgNJ%0D%0AADBGAiEAhi4KDlJwkrg2sl72TtG7EwQlGYuw0vn8OjcyLm2kOMUCIQC7TuTHUqbd%0D%0AyKRJYRSVXfYDlrvPyGofp0c+1rRYCJVp2w==%0D%0A-----END%20CERTIFICATE-----%0D%0A',
},
fingerprint: {
sha1: 'CA:1D:41:B7:45:47:5B:C7:E8:9B:F4:D8:26:60:CF:81:BE:49:E1:76',
sha256: '31:BA:F7:8A:CF:DA:E1:30:A3:12:99:00:99:4C:23:FB:0F:CA:D6:95:6E:56:6D:D9:C7:4A:D6:F6:97:C0:C2:BC',
},
issuer: {
cn: 'Root CA',
dn: 'cn=Root CA',
entries: [['Common Name', 'Root CA']],
},
notBefore: '29. 1. 2024 18:38:50 (stredoeurópsky letný čas)',
notBeforeUTC: 'Mon, 29 Jan 2024 17:38:50 GMT',
notAfter: '28. 1. 2025 18:38:50 (stredoeurópsky letný čas)',
notAfterUTC: 'Tue, 28 Jan 2025 17:38:50 GMT',
subject: {
cn: 'Root CA',
dn: 'cn=Root CA',
entries: [['Common Name', 'Root CA']],
},
serialNumber: '40:97:2F:A7:0B:69:50:18:38:D8:8A:35:B0:61:5E:1C',
signature: {
name: 'ECDSA with SHA-256',
type: '1.2.840.10045.4.3.2',
},
subjectPublicKeyInfo: {
kty: 'Elliptic Curve',
keysize: 256,
x: '0D:1B:79:46:29:DE:21:57:91:4D:16:53:77:C5:8B:89:27:5A:65:3C:47:56:19:5D:C1:5D:79:DF:2C:B9:F1:1B',
y: 'C7:97:A9:67:48:36:99:D3:1F:8B:60:67:21:43:2C:35:44:11:3F:AD:32:FE:F3:4C:48:97:CF:82:8A:BD:5A:DF',
xy: '04:0D:1B:79:46:29:DE:21:57:91:4D:16:53:77:C5:8B:89:27:5A:65:3C:47:56:19:5D:C1:5D:79:DF:2C:B9:F1:1B:C7:97:A9:67:48:36:99:D3:1F:8B:60:67:21:43:2C:35:44:11:3F:AD:32:FE:F3:4C:48:97:CF:82:8A:BD:5A:DF',
},
unsupportedExtensions: [],
version: '3',
},
],
dataChain:
'-----BEGIN CERTIFICATE-----\nMIIBZTCCAQqgAwIBAgIQQJcvpwtpUBg42Io1sGFeHDAKBggqhkjOPQQDAjASMRAw\nDgYDVQQDEwdSb290IENBMB4XDTI0MDEyOTE3Mzg1MFoXDTI1MDEyODE3Mzg1MFow\nEjEQMA4GA1UEAxMHUm9vdCBDQTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABA0b\neUYp3iFXkU0WU3fFi4knWmU8R1YZXcFded8sufEbx5epZ0g2mdMfi2BnIUMsNUQR\nP60y/vNMSJfPgoq9Wt+jQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTAD\nAQH/MB0GA1UdDgQWBBTeYAmpXhsA1Ybfh2Kp/AqHGopH8TAKBggqhkjOPQQDAgNJ\nADBGAiEAhi4KDlJwkrg2sl72TtG7EwQlGYuw0vn8OjcyLm2kOMUCIQC7TuTHUqbd\nyKRJYRSVXfYDlrvPyGofp0c+1rRYCJVp2w==\n-----END CERTIFICATE-----\n',
}

const Template = (args: any) => {
return (
<div>
<CaPoolModal
data={caData?.data}
dataChain={caData?.dataChain}
i18n={{
algorithm: 'algorithm',
authorityInfoAIA: 'authorityInfoAIA',
authorityKeyID: 'authorityKeyID',
basicConstraints: 'basicConstraints',
certificateAuthority: 'certificateAuthority',
certificatePolicies: 'certificatePolicies',
commonName: 'commonName',
country: 'country',
dNSName: 'dNSName',
download: 'download',
embeddedSCTs: 'embeddedSCTs',
exponent: 'exponent',
extendedKeyUsages: 'extendedKeyUsages',
fingerprints: 'fingerprints',
issuerName: 'issuerName',
keySize: 'keySize',
keyUsages: 'keyUsages',
location: 'location',
logID: 'logID',
menuTitle: 'menuTitle',
method: 'method',
miscellaneous: 'miscellaneous',
modules: 'modules',
no: 'no',
notAfter: 'notAfter',
notBefore: 'notBefore',
organization: 'organization',
policy: 'policy',
publicKeyInfo: 'publicKeyInfo',
purposes: 'purposes',
serialNumber: 'serialNumber',
signatureAlgorithm: 'signatureAlgorithm',
subjectAltNames: 'subjectAltNames',
subjectKeyID: 'subjectKeyID',
subjectName: 'subjectName',
timestamp: 'timestamp',
validity: 'validity',
value: 'value',
version: 'version',
yes: 'yes',
}}
onClose={() => {}}
show={true}
subTitle={caData.subTitle}
title={caData.title}
/>
</div>
)
}

export const Default: StoryFn = Template.bind({})
Default.args = {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react'
import InitializedByDifferentUser from '../components/Organisms/InitializedByDifferentUser'
import InitializedByDifferentUser from '../../components/Organisms/InitializedByDifferentUser'
import { StoryFn } from '@storybook/react'

export default {
Expand Down
22 changes: 22 additions & 0 deletions src/stories/Pages/NotFoundPage.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react'
import { StoryFn } from '@storybook/react'
import NotFoundPage from '../../components/Templates/NotFoundPage'

export default {
title: 'Pages/NotFoundPage',
component: NotFoundPage,
argTypes: {},
}

const Template = (args: any) => (
<div>
<NotFoundPage {...args} message='Page not found message' title='Page not found' />
</div>
)

export const Default: StoryFn = Template.bind({})

Default.args = {}
Default.parameters = {
layout: 'fullscreen',
}
2 changes: 1 addition & 1 deletion tests/components.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const components = [
},
{
group: 'Pages',
items: [{ name: 'InitializedByDifferentUser' }],
items: [{ name: 'InitializedByDifferentUser' }, { name: 'NotFoundPage' }],
},
{
group: 'Keycloak',
Expand Down

0 comments on commit 5656b5c

Please sign in to comment.