Skip to content

Commit d3eb0a0

Browse files
committed
Merge branch 'improvement/ARTESCA-16333-truststore-polishing' into q/4.1
2 parents bff0559 + 7f06785 commit d3eb0a0

25 files changed

+282
-171
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"@hookform/resolvers": "^2.8.8",
7171
"@monaco-editor/react": "^4.4.5",
7272
"@scality/certchain": "1.4.0",
73-
"@scality/core-ui": "0.178.0",
73+
"@scality/core-ui": "0.184.0",
7474
"@scality/module-federation": "^1.4.1",
7575
"@types/react-table": "^7.7.10",
7676
"@types/react-virtualized": "^9.21.20",

src/react/locations/LocationDetails/LocationDetailsAws.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
} from '@scality/core-ui/dist/components/form/Form.component';
77
import { Checkbox } from '@scality/core-ui/dist/components/checkbox/Checkbox.component';
88
import { Input } from '@scality/core-ui/dist/components/inputv2/inputv2';
9+
import { LOCATION_EDITOR_FORCED_LABEL_WIDTH } from '../LocationEditor';
910

1011
type State = {
1112
serverSideEncryption: boolean;
@@ -64,7 +65,7 @@ export default class LocationDetailsAws extends React.Component<
6465
render() {
6566
return (
6667
<>
67-
<FormSection>
68+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
6869
<FormGroup
6970
label="AWS Access Key"
7071
id="accessKey"
@@ -122,7 +123,7 @@ export default class LocationDetailsAws extends React.Component<
122123
}
123124
/>
124125
</FormSection>
125-
<FormSection>
126+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
126127
<FormGroup
127128
label=""
128129
id="bucketMatch"

src/react/locations/LocationDetails/LocationDetailsAwsCustom.tsx

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ import {
2424
} from '../../../types/config';
2525
import { useConfig } from '../../next-architecture/ui/ConfigProvider';
2626
import { checkIsRingS3Reseller } from '../utils';
27-
import { Icon, Link, Stack, Text } from '@scality/core-ui';
27+
import { InfoMessage, Text } from '@scality/core-ui';
28+
import { Box } from '@scality/core-ui/dist/next';
29+
import { LOCATION_EDITOR_FORCED_LABEL_WIDTH } from '../LocationEditor';
2830

2931
const computeInitialEndpoint = (locationType: LocationTypeKey) => {
3032
if (locationType === JAGUAR_S3_LOCATION_KEY) {
@@ -93,7 +95,7 @@ export default function LocationDetailsAwsCustom({
9395

9496
return (
9597
<>
96-
<FormSection forceLabelWidth={180}>
98+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
9799
<FormGroup
98100
id="accessKey"
99101
content={
@@ -173,25 +175,29 @@ export default function LocationDetailsAwsCustom({
173175
buckets will have a path-style access."
174176
helpErrorPosition="bottom"
175177
/>
176-
177-
<Stack
178-
direction="vertical"
179-
style={{ width: 'calc(20.5rem + 2rem + 180px)' }}
180-
>
181-
<Text color="textPrimary">
182-
When using an HTTPS endpoint, you must add the certificate
183-
provided by its TLS provider to the truststore. You can check if
184-
the certificate is already present in the truststore by clicking
185-
the button below, and add it if it is missing.
186-
</Text>
187-
<Link
188-
href="/data/truststore"
189-
target="_blank"
190-
style={{ alignSelf: 'flex-end' }}
178+
{formState.endpoint.startsWith('https') && (
179+
<Box
180+
style={{
181+
// Label width + padding + Input width
182+
width: `calc(20.5rem + 2rem + ${LOCATION_EDITOR_FORCED_LABEL_WIDTH}px)`,
183+
}}
191184
>
192-
Open trust store <Icon name="External-link" />
193-
</Link>
194-
</Stack>
185+
<InfoMessage
186+
title="Certificate for HTTPS Endpoint"
187+
content={
188+
<Text>
189+
When using an HTTPS endpoint, you must add the endpoint's
190+
SSL/TLS certificate to the truststore for secure
191+
communication. You can check the certificates already
192+
present by opening the truststore, and import the
193+
endpoint's certificate if it is missing.
194+
</Text>
195+
}
196+
link={'/data/truststore'}
197+
linkText="Open truststore"
198+
/>
199+
</Box>
200+
)}
195201
</>
196202
) : (
197203
<></>

src/react/locations/LocationDetails/LocationDetailsAzure.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
LocationAzureSharedAccessSignature,
99
LocationAzureSharedKey,
1010
} from '../../../js/managementClient/api';
11+
import { LOCATION_EDITOR_FORCED_LABEL_WIDTH } from '../LocationEditor';
1112
type State = {
1213
bucketMatch: boolean;
1314
accessKey?: string;
@@ -137,7 +138,7 @@ export default class LocationDetailsAzure extends React.Component<
137138

138139
render() {
139140
return (
140-
<FormSection forceLabelWidth={220}>
141+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
141142
<FormGroup
142143
label="Blob endpoint"
143144
id="endpoint"

src/react/locations/LocationDetails/LocationDetailsAzureArchive.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
LocationAzureAuth,
1616
} from '../../../js/managementClient/api';
1717
import { ColdStorageIconLabel } from '../../ui-elements/ColdStorageIcon';
18+
import { LOCATION_EDITOR_FORCED_LABEL_WIDTH } from '../LocationEditor';
1819

1920
type State = {
2021
endpoint: string;
@@ -193,7 +194,7 @@ const LocationDetailsAzureArchive = ({
193194

194195
return (
195196
<>
196-
<FormSection forceLabelWidth={210}>
197+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
197198
<FormGroup
198199
id="temperature"
199200
label="Temperature"
@@ -235,7 +236,10 @@ const LocationDetailsAzureArchive = ({
235236
}
236237
/>
237238
</FormSection>
238-
<FormSection title={{ name: 'Queue' }} forceLabelWidth={210}>
239+
<FormSection
240+
title={{ name: 'Queue' }}
241+
forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}
242+
>
239243
<FormGroup
240244
id="queue.type"
241245
label="Queue type"
@@ -410,7 +414,10 @@ const LocationDetailsAzureArchive = ({
410414
<></>
411415
)}
412416
</FormSection>
413-
<FormSection title={{ name: 'Authentication' }} forceLabelWidth={210}>
417+
<FormSection
418+
title={{ name: 'Authentication' }}
419+
forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}
420+
>
414421
<FormGroup
415422
id="auth"
416423
label="Authentication type"

src/react/locations/LocationDetails/LocationDetailsCRR.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { FormGroup, FormSection } from '@scality/core-ui';
22
import { Input } from '@scality/core-ui/dist/components/inputv2/inputv2';
33
import React, { useState } from 'react';
44
import { LocationDetailsFormProps } from '.';
5+
import { LOCATION_EDITOR_FORCED_LABEL_WIDTH } from '../LocationEditor';
56

67
type FieldNames = 'endpoint' | 'stsEndpoint' | 'accessKey' | 'secretKey';
78

@@ -203,7 +204,7 @@ function LocationDetailsCRR({
203204
};
204205

205206
return (
206-
<FormSection forceLabelWidth={143}>
207+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
207208
{fieldConfigs.map((field) => (
208209
<FormGroup
209210
key={field.name}

src/react/locations/LocationDetails/LocationDetailsDOSpaces.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import { LocationDetailsFormProps } from '.';
33
import { FormGroup, FormSection } from '@scality/core-ui';
44
import { Input } from '@scality/core-ui/dist/components/inputv2/inputv2';
5+
import { LOCATION_EDITOR_FORCED_LABEL_WIDTH } from '../LocationEditor';
56
type State = {
67
bucketMatch: boolean;
78
accessKey: string;
@@ -58,7 +59,7 @@ export default class LocationDetailsDOSpaces extends React.Component<
5859

5960
render() {
6061
return (
61-
<FormSection>
62+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
6263
<FormGroup
6364
id="accessKey"
6465
label="Spaces Access Key"

src/react/locations/LocationDetails/LocationDetailsGcp.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { FormGroup, FormSection } from '@scality/core-ui';
22
import { Input } from '@scality/core-ui/dist/components/inputv2/inputv2';
33
import React from 'react';
44
import { LocationDetailsFormProps } from '.';
5+
import { LOCATION_EDITOR_FORCED_LABEL_WIDTH } from '../LocationEditor';
56

67
type State = {
78
bucketMatch: boolean;
@@ -58,7 +59,7 @@ export default class LocationDetailsGcp extends React.Component<
5859

5960
render() {
6061
return (
61-
<FormSection>
62+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
6263
<FormGroup
6364
id="accessKey"
6465
label="GCP Access Key"
@@ -117,7 +118,7 @@ export default class LocationDetailsGcp extends React.Component<
117118

118119
<FormGroup
119120
id="mpuBucketName"
120-
label="Target Bucket for Multi-part Uploads"
121+
label="Target Bucket for Multi&#8209;part Uploads"
121122
required
122123
labelHelpTooltip="A secondary Google Cloud Storage bucket required for handling
123124
multi-part uploads on GCP using AWS MPU initiate/complete/abort

src/react/locations/LocationDetails/LocationDetailsHyperdriveV2.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import { LocationDetailsFormProps } from '.';
33
import InputList from '../../ui-elements/InputList';
44
import { FormSection } from '@scality/core-ui';
5+
import { LOCATION_EDITOR_FORCED_LABEL_WIDTH } from '../LocationEditor';
56

67
type State = {
78
bootstrapList: Array<string>;
@@ -42,7 +43,7 @@ export default class LocationDetailsHyperdriveV2 extends React.Component<
4243

4344
render() {
4445
return (
45-
<FormSection>
46+
<FormSection forceLabelWidth={LOCATION_EDITOR_FORCED_LABEL_WIDTH}>
4647
<InputList
4748
id="bootstrapList"
4849
required

0 commit comments

Comments
 (0)