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

Make default durations filterable #876

Open
1 task done
carstingaxion opened this issue Sep 17, 2024 · 5 comments · May be fixed by #882
Open
1 task done

Make default durations filterable #876

carstingaxion opened this issue Sep 17, 2024 · 5 comments · May be fixed by #882
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers
Milestone

Comments

@carstingaxion
Copy link
Collaborator

Is your enhancement related to a problem? Please describe.

While I really like the new duration defaults within the event date block, the suggested default durations might not fit in every use case.

I would love if one could hook into the defaults and modify the list to whatever is needed.

Bonus: If the list gets populated with more than n values, it’ll show as a NumberControl with a calculated steps attribute, based on the given durations.

Designs

As this list seems to be only relevant inside the editor, I would prefer a client side filter in JS.

Describe alternatives you've considered

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@carstingaxion carstingaxion added enhancement New feature or request good first issue Good for newcomers labels Sep 17, 2024
@MervinHernandez
Copy link
Collaborator

#WCUS_2024 -- Anthony is tackling this one

@ajskelton
Copy link
Contributor

Added PR #882

I was able to add in the Filter, but something was reverting to the defaults when the block was selected.

Here is an example filter.

addFilter(
	'gatherpress.durationOptions',
	'gatherpress/durationOptionsTest',
	(options) => {
		return [
			{
				label: '2 hours',
				value: 2,
			},
			{
				label: '10 hours',
				value: 10,
			},
			{
				label: 'Set an end time...',
				value: false,
			},
		];
	},
	99
);

@mauteri mauteri added this to the 0.31.0 milestone Sep 19, 2024
@MervinHernandez
Copy link
Collaborator

QUEUED for Discussion - October 25

@MervinHernandez
Copy link
Collaborator

MervinHernandez commented Oct 25, 2024

Faisal --- drag this one over the finish line.

  • Ensure to add a filter
  • Test different variations of duration, and specific time selected.

@MervinHernandez
Copy link
Collaborator

Faisal working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

5 participants