Skip to content

Commit

Permalink
🔨 Fix weekday selection and quick link to get disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
devmount committed Sep 26, 2024
1 parent 4a03b98 commit 4668fcd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
7 changes: 2 additions & 5 deletions frontend/src/components/ScheduleCreation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,10 @@ watch(
{{ t("label.availableDays") }}
</div>
<bubble-select
class="bubble-select"
:options="scheduleDayOptions"
v-model="scheduleInput.weekdays"
:required="true"
:disabled="!scheduleInput.active"
/>
</div>
<div>
Expand Down Expand Up @@ -709,6 +709,7 @@ watch(
class="w-full rounded-md disabled:cursor-not-allowed"
:small-text="true"
maxLength="16"
:disabled="!scheduleInput.active"
>
{{ t("label.quickLink") }}
</text-input>
Expand Down Expand Up @@ -872,10 +873,6 @@ watch(
display: block;
}

.bubble-select {
gap: .25rem;
}

.edit-link-btn {
min-width: auto;
}
Expand Down
17 changes: 15 additions & 2 deletions frontend/src/tbpro/elements/BubbleSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import { SelectOption } from '@/models';
interface Props {
options: SelectOption[];
required: boolean;
disabled?: boolean;
}
withDefaults(defineProps<Props>(), {
required: false,
disabled: false,
});
const model = defineModel<number[]>({ default: [] });
Expand Down Expand Up @@ -51,10 +53,13 @@ const toggleBubble = (option: SelectOption) => {
<button
class="tbpro-bubble"
:aria-pressed="model.indexOf(option.value) > -1"
:class="{'selected': model.indexOf(option.value) > -1}"
:class="{
'selected': model.indexOf(option.value) > -1,
disabled,
}"
:title="option.label ?? String(option.value)"
type="button"
@click="() => toggleBubble(option)"
@click="() => !disabled ? toggleBubble(option) : null"
>
{{ option.label }}
</button>
Expand Down Expand Up @@ -110,4 +115,12 @@ const toggleBubble = (option: SelectOption) => {
.required {
color: var(--colour-ti-critical);
}
.disabled {
cursor: default;
}
.selected.disabled {
background-color: var(--colour-neutral-border);
border-color: var(--colour-ti-muted);
color: var(--colour-ti-muted);
}
</style>
1 change: 1 addition & 0 deletions frontend/src/tbpro/elements/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const onChange = () => {
overflow: hidden;
max-width: 40%;
text-wrap: nowrap;
z-index: 1;
}
.tbpro-input-element {
Expand Down

0 comments on commit 4668fcd

Please sign in to comment.