Skip to content
Snippets Groups Projects

240 persistent links

Closed Hannes Heine requested to merge pr248head into pr248base

Created by: Tirokk

roschaefer Authored by roschaefer Merged


close #240 (closed)

Merge request reports

Closed by avatar (May 18, 2025 12:01am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
8 8 And we have the following posts in our database:
9 9 | Author | id | title | content |
10 10 | Brianna Wiest | p1 | 101 Essays that will change the way you think | 101 Essays, of course! |
11 | Brianna Wiest | p1 | No searched for content | will be found in this post, I guarantee |
11 | Brianna Wiest | p2 | No searched for content | will be found in this post, I guarantee |
  • Created by: Tirokk

    mattwr18 Authored by mattwr18


    Outdated (history rewrite) - original diff


    @@ -8,7 +8,7 @@ Feature: Search
         And we have the following posts in our database:
           | Author        | id | title                                         | content                                 |
           | Brianna Wiest | p1 | 101 Essays that will change the way you think | 101 Essays, of course!                  |
    -      | Brianna Wiest | p1 | No searched for content                       | will be found in this post, I guarantee |
    +      | Brianna Wiest | p2 | No searched for content                       | will be found in this post, I guarantee |

    thanks for fixing this, I must have been crazy to create two posts with the same id!!

  • Hannes Heine
    Hannes Heine @Elweyn started a thread on commit 76dfd08c
  • 17 17 for active citizenship.
    18 18 """
    19 19 And I click on "Save"
    20 Then I get redirected to "/post/my-first-post/"
    20 Then I get redirected to ".../my-first-post"
  • Hannes Heine
    Hannes Heine @Elweyn started a thread on commit 76dfd08c
  • 1 Feature: Persistent Links
    2 As a user
    3 I want all links to carry permanent information that identifies the linked resource
    • Created by: Tirokk

      mattwr18 Authored by mattwr18


      Outdated (history rewrite) - original diff


      @@ -0,0 +1,41 @@
      +Feature: Persistent Links
      +  As a user
      +  I want to click on a link with an 'href' having an unmodifiable id of a user

      I doubt this is how a user of the site would think about it, but maybe I am just being pedantic.... I would expect them to think more along the lines of I want to avoid clicking on links that lead nowhere or an error page

  • Hannes Heine
    Hannes Heine @Elweyn started a thread on commit 76dfd08c
  • 4 asyncData: async context => {
    5 const {
    6 params: { id, slug },
    7 redirect,
    8 error,
    9 app: { apolloProvider }
    10 } = context
    11 const idOrSlug = id || slug
    12
    13 const variables = { idOrSlug }
    14 const client = apolloProvider.defaultClient
    15
    16 let response
    17 let resource
    18 response = await client.query({ query: queryId, variables })
    19 resource = response.data[Object.keys(response.data)[0]][0]
    • Created by: Tirokk

      mattwr18 Authored by mattwr18


      Outdated (history rewrite) - original diff


      @@ -0,0 +1,32 @@
      +export default function(options = {}) {
      +  const { queryId, querySlug, path, message = 'Page not found.' } = options
      +  return {
      +    asyncData: async context => {
      +      const {
      +        params: { id, slug },
      +        redirect,
      +        error,
      +        app: { apolloProvider }
      +      } = context
      +      const idOrSlug = id || slug
      +
      +      const variables = { idOrSlug }
      +      const client = apolloProvider.defaultClient
      +
      +      let response
      +      let thing
      +      response = await client.query({ query: queryId, variables })
      +      thing = response.data[Object.keys(response.data)[0]][0]

      I know naming is difficult, but thing is not at all clear as to what it is supposed to represent

    • Created by: Tirokk

      roschaefer Authored by roschaefer


      resource?

    • Created by: Tirokk

      roschaefer Authored by roschaefer


      at the moment it can be a post or a user

  • Created by: Mogge

    Review: Changes requested

    @roschaefer is there no way we can component test this? I saw that you are testing it at the level of cypress, maybe that is enough for this use case, but I thought would at least ask

  • Created by: Mogge

    Review: Approved

  • Please register or sign in to reply
    Loading