You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/03/30 17:39:29 UTC

[GitHub] [incubator-superset] leakingoxide opened a new pull request #7181: Store last selected dashboard in sessionStorage

leakingoxide opened a new pull request #7181:  Store last selected dashboard in sessionStorage
URL: https://github.com/apache/incubator-superset/pull/7181
 
 
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
     http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   ##### SUMMARY
   This is a PR for https://github.com/apache/incubator-superset/issues/5939.
   
   Added storing the ID of a selected dashboard in `sessionStorage`.
   
   ##### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   ![5939](https://user-images.githubusercontent.com/45320817/55279382-fec2a380-5318-11e9-9f30-bf5f728d8f3f.gif)
   
   ##### TEST PLAN
   1. Selecting Don't add to dashboard => sessionStorage's key is removed => next time when launching the modal, the default option remains checked
   2. Selecting existing dashboard => sessionStorage's key is set => when launching the modal, appropriate dashboard is preselected (see gif above)
   3. Adding new dashboard => same scenario as above.
   
   Additionally, made sure that the state is consistent, i.e. if user doesn't have access to a given dashboard ID anymore (e.g. it was deleted), preselecting doesn't happen.
   
   ##### ADDITIONAL INFORMATION
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> 
   <!--- Check any relevant boxes with "x" -->
       [x] Has associated issue: #5939
       [ ] Changes UI
       [ ] Requires DB Migration. Confirm DB Migration upgrade and downgrade tested.
       [x] Introduces new feature or API
       [ ] Removes existing feature or API
       [ ] Fixes bug
       [x] Refactors code
       [ ] Adds test(s)
       [x] Fixes #5939 
   
   I had to refactor the test file a little bit - the `fetchDashboards` function was not bound properly and therefore tests were failing because I was calling `.then()` on the returned value. If there's a better way to solve this problem than what I came up with, please let me know.
   
   ##### REVIEWERS
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org