Skip to content

Clock UI #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Clock UI #282

wants to merge 2 commits into from

Conversation

chrimyn234
Copy link
Collaborator

  • Implement a Google calendar inspired dropdown style time picker.
  • Add new timepickerType field to meal time prompt to select between 'clock' and 'simple' .

@chrimyn234 chrimyn234 self-assigned this Jun 6, 2024
@chrimyn234 chrimyn234 marked this pull request as ready for review June 6, 2024 03:39
Copy link
Collaborator

@lukashroch lukashroch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Chris, thanks for the PR!

I've added couple of comments what I would improve / add.

Can you please also add newly added options to the docs (to the admin / prompt types section)? Thanks!

z.literal(20),
z.literal(30),
]),
timepickerType: z.enum(['clock', 'simple']),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • timePickerType is bit repetitive, could we call it e.g. style?
  • could make the simple more descriptive, something like dropdown to hit what the style is? ... if we have few more styles in future, simple might quickly collide.

const timePickerPrompt = baseCustomPrompt.merge(promptValidationProps).merge(timePicker).extend({
component: z.literal('time-picker-prompt'),
});
const timePickerPrompt = baseCustomPrompt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

survey frontend timepicker implementation is missing, only meal-time-prompt is in PR, can you please add?

@@ -0,0 +1,116 @@
<template>
<div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the <div> wrapper necessary?

@@ -0,0 +1,116 @@
<template>
<div>
<v-combobox
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think combox also allows to enter values manually / typed-in, if it's intention, you willl need to validate output so the typed-in time format is correct. If only select is intended, simple <v-select> can be used

type: Number,
required: true,
},
is12HourFormat: {
Copy link
Collaborator

@lukashroch lukashroch Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use same format as already defined in prompt props -> ampm | 24hr, so can be used.

<v-card-text class="pt-2 meal-time-prompt">
<v-form @submit.prevent="action('next')">
<time-picker
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use dynamic component instead of switch

components can be registered as

components: {clock: 'v-time-picker', simple: 'time-picker'}

and then used as

<component :is="prompt.style"  v-model="state" :allowed-minutes="allowedMinutes" :format="prompt.format">

@@ -93,6 +93,7 @@ export const timePickerPrompt: Prompts['time-picker-prompt'] = copy({
type: 'custom',
id: 'time-picker-prompt',
name: 'Time picker prompt',
timepickerType: 'clock',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please add survey frontend impl for the custom time picker?

pnpm-lock.yaml Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changes to the lock can be dropped altogether as dependencies are not touched, probably just a rebase artifact

@lukashroch lukashroch force-pushed the main branch 3 times, most recently from a76af83 to bba98c5 Compare October 11, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants