Skip to content

Commit

Permalink
rename subpath wording
Browse files Browse the repository at this point in the history
  • Loading branch information
TimCsaky committed May 30, 2024
1 parent 8bc3343 commit 433273c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
21 changes: 14 additions & 7 deletions frontend/src/components/bucket/BucketChildConfig.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ const schema = object({
bucketName: string().required().max(255).label('Folder display name'),
subKey: string()
.required()
.matches(/^[^\\]+$/, 'Folder sub-path must not contain back slashes')
.label('Folder sub-path')
.matches(/^[^\\]+$/, { excludeEmptyString: true, message: 'Path must not contain backslashes' })
});
// Actions
Expand Down Expand Up @@ -102,17 +101,20 @@ const onCancel = () => {
</Message>
<TextInput
name="subKey"
label="Folder sub-path"
placeholder="my-documents"
help-text="The directory will be created if it does not already exist.
Sub-paths are supported using '/' between levels.
This value cannot be changed after it is set."
label="Path"
placeholder="For example: '2024/January/documents'"
:help-text="`The relative path of the subfolder.<br />
You can choose a path that exists in your object storage or create a new one.<br />
Folder levels are supported using '/' between levels.<br />
This value cannot be changed after it is set.`"
class="child-input"
/>
<TextInput
name="bucketName"
label="Folder display name *"
placeholder="My Documents"
help-text="Your custom display name for the subfolder - any name as you would like to see it listed in BCBox."
class="child-input"
autofocus
/>
<Button
Expand All @@ -128,3 +130,8 @@ const onCancel = () => {
</Form>
</Dialog>
</template>
<style scoped lang="scss">
.child-input:deep(input) {
width: 70%;
}
</style>
20 changes: 10 additions & 10 deletions frontend/src/components/bucket/BucketConfigForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ const schema = object({
bucketName: string().max(255).required().label('Folder name'),
endpoint: string().max(255).required().label('Endpoint'),
key: string()
.matches(/^[^\\]+$/, 'Sub-path must not contain backslashes')
.max(255)
.label('Key'),
.matches(/^[^\\]+$/, { excludeEmptyString: true, message: 'Path must not contain backslashes' })
.max(255),
secretAccessKey: string().max(255).required().label('Secret Access Key')
});
Expand Down Expand Up @@ -99,8 +98,9 @@ const onSubmit = async (values: any) => {
toast.success('Configuring storage location source', 'Configuration successful');
if ((bucketChanges.accessKeyId || bucketChanges.secretAccessKey) && hasChildren) {
toast.info('Child storage locations exist',
'Remember to update their credentials where applicable', { life: 10000 });
toast.info('Subfolders exist', 'Remember to update their credentials where applicable', {
life: 10000
});
}
} catch (error: any) {
toast.error('Configuring storage location source', error);
Expand Down Expand Up @@ -153,11 +153,11 @@ const onCancel = () => {
/>
<TextInput
name="key"
label="Sub-path"
placeholder="/"
help-text="Optionally sets the bucket storage location source to mount at a specific subdirectory / subfolder.
The directory will be created if it does not already exist.
This will default to the root '/' if not provided.
label="Path"
placeholder="For example: '/maps/bc'"
help-text="Optionally mount the storage location source to be mounted at a specific subfolder<br />
The folder will be created if it does not already exist.<br />
This will default to the root '/' if not provided.<br />
This value cannot be changed after the storage location source is configured."
:disabled="!!props.bucket"
/>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/form/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const { errorMessage, value } = useField<string>(toRef(props, 'name'));
:class="{ 'p-invalid': errorMessage }"
:disabled="disabled"
/>
<small :id="`${name}-help`">{{ helpText }}</small>
<!-- eslint-disable-next-line vue/no-v-html -->
<small :id="`${name}-help`"><span v-html="helpText" /></small>
<ErrorMessage :name="name" />
</div>
</template>
Expand Down
1 change: 0 additions & 1 deletion frontend/src/views/list/ListObjectsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ onBeforeMount(async () => {

<template>
<div v-if="ready">
<h1>Files</h1>
<h2
v-if="bucket"
class="mb-3 flex overflow-hidden"
Expand Down

0 comments on commit 433273c

Please sign in to comment.