web: minor fixes

This commit is contained in:
Maximilian Hils 2021-10-08 18:34:39 +02:00
parent c43a2ef8dc
commit c2d8674a7b
3 changed files with 7 additions and 3 deletions

View File

@ -64,6 +64,9 @@
&.selected {
background-color: #e0ebf5 !important;
}
&.selected.highlighted {
background-color: #7bbefc !important;
}
&.highlighted {
background-color: #ffeb99;

View File

@ -83,7 +83,7 @@ describe('updateUrlFromStore', () => {
},
store = mockStore(state)
updateUrlFromStore(store)
expect(history.replaceState).toBeCalledWith(undefined, '', '/#/flows/123/request?s=~u foo')
expect(history.replaceState).toBeCalledWith(undefined, '', '/#/flows/123/request?s=~u%20foo')
})
})

View File

@ -33,7 +33,8 @@ export function updateStoreFromUrl(store) {
query
.split("&")
.forEach((x) => {
const [key, value] = x.split("=", 2)
let [key, value] = x.split("=", 2)
value = decodeURIComponent(value)
switch (key) {
case Query.SEARCH:
store.dispatch(setFilter(value))
@ -66,7 +67,7 @@ export function updateUrlFromStore(store) {
}
const queryStr = Object.keys(query)
.filter(k => query[k])
.map(k => `${k}=${query[k]}`)
.map(k => `${k}=${encodeURIComponent(query[k])}`)
.join("&")
let url