fix: deep link fragment escaping (via #4832)
* `test/e2e` -> `test/e2e-selenium` * add Cypress * ESLint fixes * MOAR cypress * `integration` -> `tests` * wire Cypress up to a hot e2e server * add failing tests for #4537 * add petstore for future use * don't tack `operations/` onto href path * escape generated URL fragments * Update package.json
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { setHash } from "./helpers"
|
||||
import zenscroll from "zenscroll"
|
||||
import { createDeepLinkPath } from "core/utils"
|
||||
import Im, { fromJS } from "immutable"
|
||||
|
||||
const SCROLL_TO = "layout_scroll_to"
|
||||
@@ -31,9 +32,9 @@ export const show = (ori, { getConfigs, layoutSelectors }) => (...args) => {
|
||||
}
|
||||
|
||||
if (urlHashArray.length === 2) {
|
||||
setHash(`/${type}/${assetName}`)
|
||||
setHash(createDeepLinkPath(`/${type}/${assetName}`))
|
||||
} else if (urlHashArray.length === 1) {
|
||||
setHash(`/${type}`)
|
||||
setHash(createDeepLinkPath(`/${type}`))
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
@@ -72,7 +73,9 @@ export const parseDeepLinkHash = (rawHash) => ({ layoutActions, layoutSelectors,
|
||||
hash = hash.slice(1)
|
||||
}
|
||||
|
||||
const isShownKey = layoutSelectors.isShownKeyFromUrlHashArray(hash.split("/"))
|
||||
const hashArray = hash.split("/").map(val => (val || "").replace(/_/g, " "))
|
||||
|
||||
const isShownKey = layoutSelectors.isShownKeyFromUrlHashArray(hashArray)
|
||||
|
||||
layoutActions.show(isShownKey, true) // TODO: 'show' operation tag
|
||||
layoutActions.scrollTo(isShownKey)
|
||||
|
||||
Reference in New Issue
Block a user