@outliant/sunrise-utils 1.3.4 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,8 +4,15 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [1.3.5](https://github.com/outliant/sunrise-utils/compare/1.3.4...1.3.5)
8
+
9
+ - chore: global search updates #86b428rnf [`#44`](https://github.com/outliant/sunrise-utils/pull/44)
10
+
7
11
  #### [1.3.4](https://github.com/outliant/sunrise-utils/compare/1.3.3...1.3.4)
8
12
 
13
+ > 12 March 2025
14
+
15
+ - chore(release): 1.3.4 [`d54041f`](https://github.com/outliant/sunrise-utils/commit/d54041fd7a9818598f29c9e1e1a04465d4ac8f89)
9
16
  - chore: minor change [`d76dce2`](https://github.com/outliant/sunrise-utils/commit/d76dce28e644091321aef72bd68cc853a6e1b1e4)
10
17
 
11
18
  #### [1.3.3](https://github.com/outliant/sunrise-utils/compare/1.3.2...1.3.3)
@@ -30,13 +30,21 @@ class ProjectPipeline {
30
30
  ];
31
31
 
32
32
  if (departmentId) {
33
- mustQuery.push({
34
- term: {
35
- department_id: {
36
- value: departmentId
37
- }
38
- }
39
- });
33
+ mustQuery.push(
34
+ Array.isArray(departmentId)
35
+ ? {
36
+ terms: {
37
+ department_id: departmentId
38
+ }
39
+ }
40
+ : {
41
+ term: {
42
+ department_id: {
43
+ value: departmentId
44
+ }
45
+ }
46
+ }
47
+ );
40
48
  }
41
49
 
42
50
  if (query.search && query.search.length > 0) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@outliant/sunrise-utils",
3
3
  "description": "Helper functions for project Sunrise",
4
- "version": "1.3.4",
4
+ "version": "1.3.5",
5
5
  "license": "ISC",
6
6
  "author": "Outliant",
7
7
  "main": "index.js",
@@ -164,6 +164,55 @@ describe('projectPipeline', function () {
164
164
  ]
165
165
  }
166
166
  }
167
+ },
168
+ {
169
+ search: '41853',
170
+ departmentId: [DEPARTMENT_ID, 'test-departmentId-2'],
171
+ expected: {
172
+ bool: {
173
+ must: [
174
+ {
175
+ term: {
176
+ organization_id: {
177
+ value: ORG_ID
178
+ }
179
+ }
180
+ },
181
+ {
182
+ terms: {
183
+ department_id: [
184
+ DEPARTMENT_ID,
185
+ 'test-departmentId-2'
186
+ ]
187
+ }
188
+ },
189
+ {
190
+ bool: {
191
+ should: [
192
+ {
193
+ wildcard: {
194
+ id: {
195
+ value: '*41853*'
196
+ }
197
+ }
198
+ },
199
+ {
200
+ multi_match: {
201
+ query: '41853',
202
+ fields: ['project_id^5']
203
+ }
204
+ },
205
+ {
206
+ match_phrase_prefix: {
207
+ name: '41853'
208
+ }
209
+ }
210
+ ]
211
+ }
212
+ }
213
+ ]
214
+ }
215
+ }
167
216
  }
168
217
  ];
169
218
 
@@ -175,7 +224,7 @@ describe('projectPipeline', function () {
175
224
 
176
225
  const result = projectPipeline.buildFiltersQuery(
177
226
  ORG_ID,
178
- DEPARTMENT_ID,
227
+ entry.departmentId || DEPARTMENT_ID,
179
228
  [],
180
229
  query,
181
230
  ['project_id']