silverstripe / silverstripe-campaign-admin

Campaign and publishing admin interface for Silverstripe
BSD 3-Clause "New" or "Revised" License
2 stars 16 forks source link

Inferred Chanset can be viewed in campaigned admin #204

Closed maxime-rainville closed 2 years ago

maxime-rainville commented 3 years ago

Description

When you publish a page, it creates an "Infered" changeset object. This ChangeSet can be access by ID in campaign admin and you get an error when you try to interact with it.

Steps to reproduce

Expected outcome: You get a 400/404 error page Actual: You see a campaign

Acceptance criteria

Pull request

sabina-talipova commented 2 years ago

Sequencing:

  1. Filter the changeSet in the CampaignAdmin class by IsInferred === false (? Find out the purpose of IsInferred value)
  2. If the passed ID does not exist in ChangeSet table or the ID did not pass the filter, return 404.
  3. In the CampaignAdminList React Component, catch the 404 and return the appropriate content.
maxime-rainville commented 2 years ago

Just summarizing some discussion @sabina-talipova had today.

For our use case, it's probably not worthwhile differentiating between the scenario where the user asks for a non-existent changeset and for an existing inferred change set.

I'll see if I can get some design review for the 404 error page. Maybe post a screen shot of what it currently looks like in your PR for now.

Adding some Behat test to cover this possibility is probably more of a nice-to-have, but it's a good way to get your behat set up working.