Skip to content

Add dashboard create command #50

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

Merged
merged 20 commits into from
Oct 15, 2021
Merged

Add dashboard create command #50

merged 20 commits into from
Oct 15, 2021

Conversation

polldo
Copy link
Contributor

@polldo polldo commented Oct 12, 2021

Motivation

arduino-cloud-cli should allow users to create new dashboards starting from templates.

Change description

  • Dashboard create command has been implemented, it takes a template and a map indicating thing_id to be overridden.
  • A function to convert the template file into a proper dashboard structure has been implemented. Here, the ids of the variables described in the template are fetched; the widget options are filtered; a uuid is assigned to each widget.

Additional Notes

information about this command (from the readme):

  • Dashboards can be created only starting from a template.
  • Supported dashboard template formats are JSON and YAML.
  • The name parameter is optional. If it is provided then it overrides the name retrieved from the template.
  • The override flag can be used to override the template thing_id placeholder with the actual ID of the thing to be used.

Reviewer checklist

  • PR address a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.
  • History is clean, commit messages are meaningful (see CONTRIBUTING.md) and are well formatted.

@polldo polldo changed the title Polldo/dashboard create Add dashboard create command Oct 12, 2021
Copy link
Contributor

@eclipse1985 eclipse1985 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@glumia glumia left a comment

Choose a reason for hiding this comment

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

We should move internal/template/mocks/Client.go to internal/iot/mocks/Client.go since its a mock for the interface defined in internal/iot/client.go. In this way we can reuse it in other tests if needed, and easily find the implementation by reading the mock and viceversa.

@polldo polldo force-pushed the polldo/dashboard-create branch from d007bdd to 8ae3914 Compare October 15, 2021 08:50
@polldo polldo merged commit ed97e1d into main Oct 15, 2021
@polldo polldo deleted the polldo/dashboard-create branch October 15, 2021 09:03
polldo pushed a commit that referenced this pull request Sep 2, 2022
This command allows users to create new dashboards starting from templates.
Changes:
- Dashboard create command has been implemented, it takes a template and a map indicating thing_id to be overridden.
- A function to convert the template file into a proper dashboard structure has been implemented. Here, the ids of the variables described in the template are fetched; the widget options are filtered; a uuid is assigned to each widget.
polldo pushed a commit that referenced this pull request Sep 2, 2022
This command allows users to create new dashboards starting from templates.
Changes:
- Dashboard create command has been implemented, it takes a template and a map indicating thing_id to be overridden.
- A function to convert the template file into a proper dashboard structure has been implemented. Here, the ids of the variables described in the template are fetched; the widget options are filtered; a uuid is assigned to each widget.
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.

3 participants