whole-tale / dashboard

Whole Tale Dashboard
http://wholetale.org
MIT License
7 stars 2 forks source link

Add explicit user selection for asTale parameter #580

Closed bodom0015 closed 4 years ago

bodom0015 commented 4 years ago

Problem

In the "Analyze in WT" case, there is no explicit option for the user to declare that they want to import their Data Source as a Tale. The only way to toggle this flag is by using the URL query-string parameter, which is not very user-friendly.

FIxes #579

Approach

Per the mockups, add a set of Radio buttons to the "Analyze in WT" / "import" case on the create-tale-modal. The first radio (default) set asTale to false, while the second sets asTale to true.

There is also an option to disable the second radio button, although it is not clear under what circumstances this may be useful.

How to Test

Preconditions: shut down any running instances

  1. Checkout and run this branch locally, rebuild the dashboard
  2. Login to the WholeTale Dashboard
  3. Navigate to https://dashboard.local.wholetale.org/browse?uri=https%3A%2F%2Fdev2.dataverse.org%2Fdataset.xhtml%3FpersistentId%3Ddoi%3A10.5072%2FFK2%2FC074IQ&name=Dataverse%20IRC%20Metrics&environment=Jupyter%20Classic
    • You should see the create-tale-modal pop up automatically after the page loads
    • You should see that Dataverse IRC Metrics is automatically entered as the name
    • You should see that Jupyter Classic is automatically chosen as the environment
    • You should see that the Dataverse DOI/URI is listed as the Data Source
    • You should see the newly-offered radio buttons appear at the bottom of the modal
    • You should see that READ ONLY is selected by default - this is asTale=false
  4. Open the Networks tab in your Development Console, then submit the form
    • You should see that a POST /tale/import was sent with asTale=false in the query-string
    • You should be navigated to the Run view for the now-launching Tale
  5. Navigate to Run > Files > External Data
    • You should see Dataverse IRC Metrics listed here as an immutable external dataset
  6. Now, navigate to https://dashboard.local.wholetale.org/browse?uri=https%3A%2F%2Fdev2.dataverse.org%2Fdataset.xhtml%3FpersistentId%3Ddoi%3A10.5072%2FFK2%2FC074IQ&name=Dataverse%20IRC%20Metrics&environment=Jupyter%20Classic&asTale=true
    • You should see the create-tale-modal pop up automatically after the page loads
    • You should see that Dataverse IRC Metrics is automatically entered as the name
    • You should see that Jupyter Classic is automatically chosen as the environment
    • You should see that the Dataverse DOI/URI is listed as the Data Source
    • You should see the newly-offered radio buttons appear at the bottom of the modal
    • You should see that READ/WRITE is now selected by default - this is asTale=true as specified in the query string
  7. Open the Networks tab in your Development Console, then submit the form
    • You should see that a POST /tale/import was sent with asTale=true in the query-string
    • You should be navigated to the Run view for the now-launching Tale
  8. Navigate to Run > Files > Tale Workspace
    • You should see the contents of Dataverse IRC Metrics has been imported into your editable Tale Workspace
bodom0015 commented 4 years ago

For context, the current "action" text reads Treat as source dataset for analysis. I am open to changing it if we can decide on acceptable an alternative.

Perhaps it would be more clear with something like Treat as immutable dataset for analysis?