Skip to content

Commit 90512b2

Browse files
committed
adding seprator OR in query
1 parent a24eb67 commit 90512b2

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/styles/_advancedSearchComponents.scss

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
max-width: 750px;
66
margin-left: 10px;
77
margin-right: 10px;
8-
box-shadow:
9-
0px 3px 1px -2px rgba(0, 0, 0, 0.2),
10-
0px 2px 2px 0px rgba(0, 0, 0, 0.14),
11-
0px 1px 5px 0px rgba(0, 0, 0, 0.12);
8+
box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
9+
0px 2px 2px 0px rgba(0, 0, 0, 0.14),
10+
0px 1px 5px 0px rgba(0, 0, 0, 0.12);
1211

1312
&.advancedSearchSelectMobile {
1413
max-width: 100%;
@@ -42,6 +41,5 @@
4241
margin: 4px;
4342
border-radius: 16px;
4443
font-size: 14px;
45-
height: 32px;
4644
}
4745
}

src/utils/queryUtil.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ const generateSelectionQuery = (principle, selection) => {
1515
queryString += "principle=" + principle + "&";
1616
objectEntriesArr.forEach((item) => {
1717
if (item[1] && item[1].length) {
18-
queryString += item[0] + "=" + item[1] + "&";
18+
//Replace spaces with _ in the string in order to avoid + sign in URL
19+
item[1] = item[1].map((str) => {
20+
return str.replace(/\s/g, "_");
21+
});
22+
queryString += item[0] + "=" + item[1].join("OR") + "&";
1923
}
2024
});
2125
//Removing the last "&" from the string

src/views/Registry/ResultTableView.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,25 +154,25 @@ export default {
154154
//For objectTypes
155155
else if (paramValues[0] === "objectTypes") {
156156
this.advancedSearchStore.objectTypeSelected = {
157-
objectTypes: paramValues[1],
157+
objectTypes: paramValues[1].split("OR"),
158158
};
159159
}
160160
//For subjects
161161
else if (paramValues[0] === "subjects") {
162162
this.advancedSearchStore.subjectSelected = {
163-
subjects: paramValues[1],
163+
subjects: paramValues[1].split("OR"),
164164
};
165165
}
166166
//For organisations
167167
else if (paramValues[0] === "organisations") {
168168
this.advancedSearchStore.organisationSelected = {
169-
organisations: paramValues[1],
169+
organisations: paramValues[1].split("OR"),
170170
};
171171
}
172172
//For toolNames
173173
else if (paramValues[0] === "toolNames") {
174174
this.advancedSearchStore.toolsSelected = {
175-
toolNames: paramValues[1],
175+
toolNames: paramValues[1].split("OR"),
176176
};
177177
}
178178
});

0 commit comments

Comments
 (0)