240 persistent links
Merge request reports
Activity
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
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!!
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" Created by: Tirokk
Authored by mattwr18
Outdated (history rewrite) - original diff
@@ -17,7 +17,7 @@ Feature: Create a post for active citizenship. """ And I click on "Save" - Then I get redirected to "/post/my-first-post/" + Then I get redirected to ".../my-first-post"
It's not so clear how this works until one checks out https://github.com/Human-Connection/Human-Connection/pull/248/files#diff-cc51d55abc8d6a1b33fd1f8885365953R227, but maybe there is nothing one can do about that
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
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
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
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