Skip to main content

Update Draft Status Specs

Update Draft Status Specs

Project Description / Problem

Support says that wobblies are pretty confused about some of their active plugins saying “Draft” on users/me. Remember, we removed the “I’ve installed” button and now we’re relying 100% on there being a last_viewed_url for it to say “Published”.

Need to create a flow for users that don't have a last_viewed_url but have an active app.

Design to mock up a flow where the users can manually update their status by adding their website's URL on the "Draft" tooltip.

Designer: Kelsey

PM: Beks

Jira Ticket

PM-7195

Proposed Solution:

Update tooltip copy to include a link that would allow the user to manually update their draft status by giving us the URL where their plugin lives. This would allow us to update their last_viewed_url

BDD Specs

\ Scenario: User hovers off “Draft” status on app card

Given the user’s app is in a Draft state

When the user hovers over the draft tag on the app card

Then a tooltip will appear

And the tooltip content will include a link that will trigger the update draft status modal

Eng Notes: The hover functionality exists already. You will just need to update the tooltip copy for this part.

alt_text

Scenario: User clicks “Update Status” link

Given the user is hovering over the draft status in the app card

When they click “Update Status” link

Then the update draft status modal will appear

Scenario: User hasn’t entered website URL yet

Given the update draft status modal is open

If the user hasn’t entered their website URL

Then the button will be disabled

alt_text

Scenario: User enters valid url

Given the update draft status modal is open

When they enter a valid website URL

Then the button will become enabled

alt_text

Scenario: User enters invalid URL

Given the update draft status modal is open

When they enter an invalid website URL

Then an error message will appear

And then button stays disabled

Eng Notes: \ Check if valid url by url standards and use LastViewedUrlFilter to ensure wobblies are not putting in url to their editor.

alt_text

Scenario: User clicks ‘x’ on update draft status modal

Given the update draft status modal is open

When the user clicks ‘x’ in the top right corner

Then the update draft status modal should close

Scenario: User clicks anywhere outside of modal

Given the update draft status modal is open

When the user clicks anywhere outside of the modal

Then the update draft status modal should close

Scenario: User clicks “Update Draft Status” on modal

Given the update draft status modal is open

And entered their website url

When they click “Update Draft Status”

Then a loading wheel will appear on the button for 0.5 seconds or as long as it takes for the draft status to update

\ Eng notes: Brent created a generic react modal with buttons, look into reusing that. Either use PowrIntentModal or PowrReactModal

alt_text

Scenario: Draft status is updated and saved to database and GA

Given the user entered their website URL

And clicked “Update Draft Status”

When the draft status has been updated to “Published”

Then the modal will close

And a toast notification will appear on users/me

And the draft status on the app card will be updated to “Published” (notes - update saved to true, last_viewed_url to the given url)

And GA event will be saved

(- category: draft_status

  • action: update

  • label: %app_id%)

Eng notes:

We have a method and route for update_nickname - use that as inspiration for add_last_viewed_url. \ Note: we should only allow to update if it already exists.

https://gitlab.com/powr/powr/blob/master/app/controllers/apps_controller.rb#L962

alt_text