Add support for saving dashboard parameters after clicking the Apply button. Parameters are applied in the following order: URL, dashboard parameters, query parameters.
Persist the queued values only when “Done Editing” is clicked, keeping Query and Dashboard editors aligned.
* Add My Dashboards filter option to the Dashboards list. Added API endpoint to get the list of a user's dashboards, similar to the My Queries feature.
* Update empty dashboard list state to show an invite to create a new dashboard, like My Queries
* Update to Levko's suggested approach. Clean up some of the formatting for consistency. Put the 'My Queries/Dashboards' item before the Favorites since that organization seems cleaner to me.
* Address Levko's comments
* on dashboard api calls - take the id from the beginning of the slug, unless there is no number in it - in that case, take the entire slug as id
* add dashboard id when showing links to dashboards
* change path to include new name when renaming dashboards
* move slug generation to backend
* redirect to new name after changing (this time with a proper promise)
* oh right, we already have a slug function
* add spec that makes sure that renamed dashboards are redirected to the
url which contains their new name
* use id-slug in all Cypress specs
* move dashboards from /dashboard/:slug to /dashboards/:id-:name_as_slug
* Update dashboard url as its name changes
* Update separator to be "/"
* Update missing dashboard urls
* Update api not to depend on int id
* Use '-' instead of '/' as separator and update Dashboard.get calls
* slug -> name_as_slug
* Keep slug urls on cypress
* Update route path
* Use legacy attr for GET
* Use getter for urlForDashboard
* Update dashboard url when loaded by slug
* Update Dashboard routes to use id instead of slug
* Update Dashboard handler tests
* Update Cypress tests
* Fix create new dashboard spec
* Use axios { params }
* Drop Ternary operator
* Send updated slug directly in 'slug' attr
* Update multiple urls Dashboard test name
* Update route names
Co-authored-by: Levko Kravets <levko.ne@gmail.com>
Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
Co-authored-by: Levko Kravets <levko.ne@gmail.com>
* Migrate router and <app-view> to React: skeleton
* Update layout on route change
* Start moving page routes from angular to react
* Move page routes to react except of public dashboard and visualization embed)
* Move public dashboard and visualization embed routes to React
* Replace $route/$routeParams usages
* Some cleanup
* Replace AngularJS $location service with implementation based on history library
* Minor fix to how ApplicationView handles route change
* Explicitly use global layout for each page instead of handling related stuff in ApplicationArea component
* Error handling
* Remove AngularJS and related dependencies
* Move Parameter factory method to a separate file
* Fix CSS (replace custom components with classes)
* Fix: keep other url parts when updating location partially; refine code
* Fix tests
* Make router work in multi-org mode (respect <base> tag)
* Optimzation: don't resolve route if path didn't change
* Fix search input in header; error handling improvement (handle more errors in pages; global error handler for unhandled errors; dialog dismiss 'unhandled rejection' errors)
* Fix page keys; fix navigateTo calls (third parameter not available)
* Use relative links
* Router: ignore location REPLACE events, resolve only on PUSH/POP
* Fix tests
* Remove unused jQuery reference
* Show error from backend when creating Destination
* Remove route.resolve where not necessary (used constant values)
* New Query page: keep state on saving, reload when creating another new query
* Use currentRoute.key instead of hard-coded keys for page components
* Tidy up Router
* Tidy up location service
* Fix tests
* Don't add parameters changes to browser's history
* Fix test (improved fix)
Co-authored-by: Gabriel Dutra <nesk.frz@gmail.com>
* Prettier all the JS files
* Add GitHub Action to autoformat code pushed to master
* Fix eslint violation due to formatting.
* Remove GitHub actions for styling
* Add restyled.io config
* Draft for Date Dynamic values
* Use value with prefix instead of specific attr
* Fix not possible to select static value
* Update antd version
* Cleanup and DateRangeParameter
* Dynamic DateTimeRange
* Add Dynamic options to Date Parameters
* UI refinements
* Add getDynamicValue function
* Add 'This' options and prevent text clipping
* Make allowClear available
* Update ScheduleDialog snapshot
* Add some protections and separate Date/DateRange
* Accept null values on date or daterange parameters
* Handle undefined values on Moment propType
* Move export to end of files
* Remove Today/Now option
* Update with Apply Changes
* Show name instead of value for dynamic values
* Add comment about supporting useCurrentDateTime
* Cypress Tests: Date Parameters
* Cypress Tests: Date Range Parameters
* Don't put null params in the url
* Add workaround comments to Cypress tests
Co-Authored-By: Ran Byron <ranbena@gmail.com>
* Fix Dynamic Value as default for global parameters
* Update Back to Static Value
* Add isValid to value on Date and DateRange inputs
* CR suggestions
* Fix Back to Static Value for Dates
* Update Dynamic Value Styling
* Fix failing Date tests
* Fix selectedDynamicValue
* Parameter spec: Remove date range clickThrough
* Add transition
* Fix failing Cypress tests
* Back with 'width: auto'
* Check value is valid on Back to Static value
* CR
* Update Date Range width
* change has_access and require_access signatures to work with the objects that require access, instead of their groups
* use the textless endpoint (/api/queries/:id/results) for pristine
queriest
* Revert "use the textless endpoint (/api/queries/:id/results) for pristine"
This reverts commit cd2cee7738.
* go to textless /api/queries/:id/results by default
* change `run_query`'s signature to accept a ParameterizedQuery instead of
constructing it inside
* raise HTTP 400 when receiving invalid parameter values. Fixes#3394
* enqueue jobs for ApiUsers
* rename `id` to `user_id`
* support executing queries using Query api_keys by instantiating an ApiUser that would be able to execute the specific query
* show deprecation messages for ALLOW_PARAMETERS_IN_EMBEDS. Also, move
other message (email not verified) to use the same mechanism
* add link to forum message regarding embed deprecation
* change API to /api/queries/:id/dropdowns/:dropdown_id
* split to 2 different dropdown endpoints and implement the second
* add test cases for /api/queries/:id/dropdowns/:id
* use new /dropdowns endpoint in frontend
* first e2e test for sharing embeds
* Pleasing the CodeClimate overlords
* All glory to CodeClimate
* remove residues from bad rebase
* add query id and data source id to serialized public dashboards
* add global parameters directive to public dashboards page
* allow access to a query by the api_key of the dashboard which includes
it
* rename `object` to `obj`
* simplify permission tests once `has_access` accepts groups
* support global parameters for public dashboards
* change has_access and require_access signatures to work with the objects that require access, instead of their groups
* rename `object` to `obj`
* simplify permission tests once `has_access` accepts groups
* no need to log `is_api_key`
* send parameters to public dashboard page
* allow access to a query by the api_key of the dashboard which includes it
* disable sharing if dashboard is associated with unsafe queries
* remove cypress test added in the wrong place due to a faulty rebase
* add support for clicking buttons in cy.clickThrough
* Cypress test which verifies that dashboards with safe queries can be shared
* Cypress test which verifies that dashboards with unsafe queries can't be shared
* remove duplicate tests
* use this.enabled and negate when needed
* remove stale comment
* add another Cypress test to verify that unauthenticated users have access to public dashboards with parameters
* obviously, I commit 'only' the first time I use it
* search for query access by query id and not api_key
* no need to fetch latest query data as it is loaded by frontend from the textless endpoint
* test that queries associated with dashboards are accessible when supplying the dashboard api_key
* propagate `isDirty` down to `QueryBasedParameterInput`
* go to /api/:id/dropdown while editing a query, since dropdown queries might still not be associated with the parent. see #3711
* show helpful error message if dropdown values cannot be fetched
* use backticks instead of line concatenation
* remove requirement to have direct access to dropdown query in order validate it. parent query association checks are sufficient
* remove isDirty-based implementation and allow dropdown queries through nested ACL even if they aren't associated yet (given that the user has _direct_ access to the dropdown query)
* fix tests to cover all cases for /api/queries/:id/dropdowns/:id
* fix indentation
* require access to the query, not the data source
* resolve dashboard user by query id
* apply new copy to Cypress tests
* if only something would have prevented me from commiting an 'only' call 🤔
* very important handling of whitespace
* respond to parameter's Apply button
* text widgets are safe for sharing
* remove redundant event
* add a safety check that object has dashboard_api_keys before calling it
* supply a parameter value for text parameters to have it show up
* add parameter values for date and datetime
* use the current year and month to avoid pagination
* use Cypress.moment() instead of preinstalled moment()
* explicitly create parameters
* refresh query data if a querystring parameter is provided
* avoid sending a data_source_id - it's only relevant to unsaved queries, since a saved query's data_source is available in the backend
* remove empty query text workaround
* provide default value to parameter
* add a few more dashboard sharing specs
* lint
* wait for DynamicTable to appear to reveal that actual results are displaying
* override error message for unsafely shared widgets
* Dashboard grid React migration
* Updated tests
* Fixes comments
* One col layout
* Tests unskipped
* Test fixes
* Test fix
* AutoHeight feature
* Kebab-cased
* Get rid of lazyInjector
* Replace react-grid-layout with patched fork to fix performance issues
* Fix issue with initial layout when page has a scrollbar
* Decrease polling interval (500ms is too slow)
* Rename file to match it's contents
* Added some notes and very minor fixes
* Fix Remove widget button (should be visible only in editing mode); fix widget actions menu
* Fixed missing grid markings
* Enhanced resize handle
* Updated placeholder color
* Render DashboardGrid only when dashboard is loaded
* Refine Auth service: remove dead code and fix race condition
* Export services in CommonJS style
* Refine Users, Events and OfflineListener services
* Refactor Notifications service - rewrite to CommonJS
* Replace Angular service injection with imports in React components
* Fix Footer tests
* Events service -> recordEvent function
* CR1