Porphyry icon indicating copy to clipboard operation
Porphyry copied to clipboard

URI syntax for topics selection should be simpler

Open benel opened this issue 5 years ago • 0 comments

Commit 073c20977a59779f5697f21c6b65d25f0cf9a616 brought (along with great boolean selection) a very complex URI syntax.

For example, when you select "Abram/Abraham" and then "XIXe s.", the URI is:

  • /?t={"type":"intersection","data":[{"type":"intersection","selection":["f1520229979b11428f94a004f880c022"],"exclusion":[]},{"type":"intersection","selection":["addd464d06159c4eb0b9666cffb2042c"],"exclusion":[]}]} in the new syntax,
  • /?t=f1520229979b11428f94a004f880c022&t=addd464d06159c4eb0b9666cffb2042c in the prior syntax.

Its complexity made its authors failing to implement correctly the corresponding test. Applied to the same case, it generates the following URI:

  • /?t={"type":"intersection","data":[{"type":"intersection","selection":["f1520229979b11428f94a004f880c022","addd464d06159c4eb0b9666cffb2042c"],"exclusion":[]}]}.

While giving the same display as the correct one, it then fails when you for example, you try to transform XIXe s. into NOT XIXe s..

The syntax should be changed so that URIs can be generated easily, e.g. :

  • ?t=0a for 0a,
  • ?t=0a.0bfor 0a AND 0b,
  • ?t=0a.0b.-0c for 0a AND 0b AND NOT 0c,
  • ?t=0a.0b+0c for 0a AND (0b OR NOT 0c).

Phase 1

  • [ ] Scenarios (Gherkin)
  • [ ] Mockups
  • [ ] Implementation strategy

Phase 2

  • [ ] Acceptance tests (Capybara)
  • [ ] Implementation

benel avatar Oct 19 '19 13:10 benel