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 support for custom activity type (including variables) #23

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

Conversation

AgnesToulet
Copy link
Contributor

Add a Custom option in the activity type that shows an input where the user can type a coma-separated list of activity types or a variable name.

image

Copy link
Collaborator

@alexanderzobnin alexanderzobnin left a comment

Choose a reason for hiding this comment

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

Do you think fits better for this feature?
There's an example of usage: https://developers.grafana.com/ui/latest/index.html?path=/story/forms-select--multi-select

return allActivities;
} else if (activityType === 'Custom' && customActivityType) {
// Handle template variables if any
if (customActivityType.indexOf('$') != -1) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You don't need to check value for variables, getTemplateSrv().replace() already do this, so this can be omitted.

@@ -34,6 +34,7 @@ const stravaActivityTypeOptions: Array<SelectableValue<StravaActivityType>> = [
{ value: 'Run', label: 'Run' },
{ value: 'Ride', label: 'Ride' },
{ value: 'Other', label: 'Other' },
{ value: 'Custom', label: 'Custom' },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Isn't better to convert activity selector to support multi-value selection and add variables to the list?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How would you know which variable to put in the list?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Usually, it's just a list of created variables from templateSrv, but it might be bad from UX perspective.

@CLAassistant
Copy link

CLAassistant commented Jun 15, 2022

CLA assistant check
All committers have signed the CLA.

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.

None yet

3 participants