Skip to content

Commit d30aff6

Browse files
authored
861 schema selection dialog is out of view for small screens eg mobile devices (#862)
* Make "Schema Selection Dialog" items vertical, and "Loading JSON Schema from URL Dialog" more user friendly * apply formatting changes --------- Co-authored-by: M-Jafarkhani <[email protected]>
1 parent d605b49 commit d30aff6

2 files changed

Lines changed: 32 additions & 17 deletions

File tree

meta_configurator/src/components/toolbar/dialogs/InitialSchemaSelectionDialog.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ defineExpose({show: openDialog, close: hideDialog});
3939

4040
<template>
4141
<Dialog v-model:visible="showDialog" header="Select a Schema">
42-
<div class="flex flex-column gap-3 bigger-dialog-content">
43-
<div v-for="category in categories" :key="category.key" class="flex align-items-center">
42+
<div class="flex flex-col gap-3 bigger-dialog-content">
43+
<div v-for="category in categories" :key="category.key" class="flex justify-center">
4444
<Button
4545
v-model="selectedCategory"
4646
:label="category.name"
4747
:inputId="category.key"
4848
name="category"
4949
:value="category.name"
50+
class="w-full"
5051
@click="
5152
() => {
5253
$emit('user_selected_option', category.key);

meta_configurator/src/components/toolbar/dialogs/UrlInputDialog.vue

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,40 @@ defineExpose({show: openDialog, close: hideDialog});
2727
</script>
2828

2929
<template>
30-
<Dialog v-model:visible="showDialog">
31-
<div class="p-fluid">
32-
<div class="p-field">
33-
<label for="urlInput">Enter the URL of the schema:</label>
34-
<InputText v-model="schemaUrl" id="urlInput" />
30+
<Dialog v-model:visible="showDialog" header="Fetch Schema from URL" modal class="max-w-md w-full">
31+
<div class="flex flex-col gap-4 p-2">
32+
<div class="flex flex-col gap-2">
33+
<label for="urlInput" class="font-medium text-gray-700"> Schema URL </label>
34+
<InputText
35+
v-model="schemaUrl"
36+
id="urlInput"
37+
placeholder="https://json-schema.org/draft/2020-12/schema"
38+
class="w-full" />
3539
</div>
36-
<div class="p-dialog-footer">
37-
<div class="button-container">
38-
<Button label="Cancel" @click="hideDialog" class="dialog-button" />
39-
<Button label="Fetch Schema" @click="fetchSchemaFromSelectedUrl" class="dialog-button" />
40-
</div>
40+
41+
<small class="text-gray-500">
42+
Enter a valid URL to automatically load the JSON schema.
43+
</small>
44+
45+
<div class="flex justify-end gap-3 mt-4">
46+
<Button label="Cancel" icon="pi pi-times" @click="hideDialog" class="p-button-text" />
47+
<Button
48+
label="Fetch Schema"
49+
icon="pi pi-download"
50+
@click="fetchSchemaFromSelectedUrl"
51+
:disabled="!schemaUrl"
52+
autofocus />
4153
</div>
4254
</div>
4355
</Dialog>
4456
</template>
57+
4558
<style scoped>
46-
.button-container {
47-
display: flex;
48-
justify-content: center;
49-
gap: 20px;
50-
margin-top: 1rem;
59+
:deep(.p-dialog-header) {
60+
font-weight: 600;
61+
font-size: 1.1rem;
62+
}
63+
:deep(.p-inputtext) {
64+
border-radius: 0.5rem;
5165
}
5266
</style>

0 commit comments

Comments
 (0)