Skip to content
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

Add YoHours button to recurring schedule fields #9678

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

Conversation

1ec5
Copy link
Collaborator

@1ec5 1ec5 commented Jun 1, 2023

Fields that accept opening_hours syntax are now standard text fields with the addition of a button that links out to YoHours. The user can use this button to compose a value or visualize an existing value, or they can compose the value manually as before.

Hours

Depends on ideditor/schema-builder#101. Itty-bitty baby steps toward #974.

Fields that accept opening_hours syntax are now standard text fields with the addition of a button that links out to YoHours. The user can use this button to compose a value or visualize an existing value.
@1ec5 1ec5 added waitfor-upstream Waiting for something in an upstream project field An issue with a field in the user interface labels Jun 1, 2023
@1ec5 1ec5 self-assigned this Jun 1, 2023
@1ec5 1ec5 mentioned this pull request Jun 1, 2023
@tordans
Copy link
Collaborator

tordans commented Jun 1, 2023

I like the idea of having this as a step towards better UI inside iD!

A few things I notices:

  • Ideally, on https://projets.pavie.info/yohours/ the term opening_hours= that is used as a label of the field could also be configured by url param so the field can specify it to create a smoother transition between the two apps.
  • Ideally, the page would offer a copy button next to the input, so the UI signals that the next step will be to manually copy and paste the content back to iD.
  • In fact, it would be great if this flow could be explained somewhere. Maybe with a message on yohours along the line of "you are using this tool from , please copy the value back to the after you modified the schedule".
  • Would it be possible to add some shared logic between iD and yohours to post messages back to iD? I remember solutions that where used to resize an parent iframe based on height data from inside the iframe using postMesssage

uiFieldText as uiFieldTel,
uiFieldText as uiFieldUrl,
likelyRawNumberFormat
};

const likelyRawNumberFormat = /^-?(0\.\d*|\d*\.\d{0,2}(\d{4,})?|\d{4,}\.\d{3})$/;
const yoHoursURLFormat = 'https://projets.pavie.info/yohours/?oh={value}';
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The spellcheck action on GitHub Actions doesn’t like this URL because French words sometimes look like misspelled English words. 😉

@@ -18,12 +18,14 @@ export {
uiFieldText as uiFieldEmail,
uiFieldText as uiFieldIdentifier,
uiFieldText as uiFieldNumber,
uiFieldText as uiFieldSchedule,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually it would be nice to keep the dropdown button for some common values like 24/7 that YoHours doesn’t support. But the combo field doesn’t support an external link button as far as I know.

@1ec5
Copy link
Collaborator Author

1ec5 commented Jun 1, 2023

  • Ideally, on https://projets.pavie.info/yohours/ the term opening_hours= that is used as a label of the field could also be configured by url param so the field can specify it to create a smoother transition between the two apps.

  • Ideally, the page would offer a copy button next to the input, so users can easily copy the value back.

I guess this would be feedback for @PanierAvide. I’m not sure if the YoHours website itself has an issue tracker, but there is one for the jQuery widget that’s embedded in it.

  • Would it be possible to add some shared logic between iD and yohours to post messages back to iD? I remember solutions that where used to resize an parent iframe based on height data from inside the iframe using postMesssage

There is an iframe version of YoHours intended to be embedded inside a Web application like iD: #974 (comment). However, I didn’t use it here because embedding it into a rather space-constrained part of iD would be more difficult than simply linking out, and there’s no precedent for opening modals from the inspector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
field An issue with a field in the user interface waitfor-upstream Waiting for something in an upstream project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants