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 { &.selected {
background-color: #e0ebf5 !important; background-color: #e0ebf5 !important;
} }
&.selected.highlighted {
background-color: #7bbefc !important;
}
&.highlighted { &.highlighted {
background-color: #ffeb99; background-color: #ffeb99;

View File

@ -83,7 +83,7 @@ describe('updateUrlFromStore', () => {
}, },
store = mockStore(state) store = mockStore(state)
updateUrlFromStore(store) 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 query
.split("&") .split("&")
.forEach((x) => { .forEach((x) => {
const [key, value] = x.split("=", 2) let [key, value] = x.split("=", 2)
value = decodeURIComponent(value)
switch (key) { switch (key) {
case Query.SEARCH: case Query.SEARCH:
store.dispatch(setFilter(value)) store.dispatch(setFilter(value))
@ -66,7 +67,7 @@ export function updateUrlFromStore(store) {
} }
const queryStr = Object.keys(query) const queryStr = Object.keys(query)
.filter(k => query[k]) .filter(k => query[k])
.map(k => `${k}=${query[k]}`) .map(k => `${k}=${encodeURIComponent(query[k])}`)
.join("&") .join("&")
let url let url