@outliant/sunrise-utils 1.4.6 → 1.4.7

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.4.7](https://github.com/outliant/sunrise-utils/compare/1.4.6...1.4.7)
8
+
9
+ - chore: fix buildSourceParams [`0fc19b4`](https://github.com/outliant/sunrise-utils/commit/0fc19b4c51aa0d156d421b71354c389224d1a1d2)
10
+
7
11
  #### [1.4.6](https://github.com/outliant/sunrise-utils/compare/1.4.5...1.4.6)
8
12
 
13
+ > 28 September 2025
14
+
15
+ - chore(release): 1.4.6 [`67814b8`](https://github.com/outliant/sunrise-utils/commit/67814b8d929954e79af2e34f115395e47c851e71)
9
16
  - chore: updated banners [`3741165`](https://github.com/outliant/sunrise-utils/commit/37411650bc099c24f70be996e8386dcf5b5d304e)
10
17
 
11
18
  #### [1.4.5](https://github.com/outliant/sunrise-utils/compare/1.4.4...1.4.5)
@@ -10,7 +10,7 @@ module.exports = (columns = [], filterColumns = []) => {
10
10
  if (isUuid(c)) {
11
11
  projectFields.push(`'${c}'`);
12
12
  } else {
13
- const columnData = filterColumns.find((x) => x.type === c);
13
+ const columnData = filterColumns.find((x) => x.value === c);
14
14
  if (columnData && !_.isEmpty(columnData.select_fields)) {
15
15
  _source = _.concat(_source, columnData.select_fields);
16
16
  } else {
@@ -75,7 +75,13 @@ module.exports.defaultCustomColumns = [
75
75
  type: 'owner',
76
76
  field_type: 'select',
77
77
  options: [],
78
- select_fields: ['user_id', 'team_id']
78
+ select_fields: [
79
+ 'owner',
80
+ 'user_id',
81
+ 'team_id',
82
+ 'is_complete',
83
+ 'completed_by'
84
+ ]
79
85
  },
80
86
  {
81
87
  name: 'Ready At',
@@ -199,7 +205,7 @@ module.exports.defaultCustomColumns = [
199
205
  type: 'completed_by',
200
206
  field_type: 'select',
201
207
  options: [],
202
- select_fields: ['owner', 'completed_by']
208
+ select_fields: ['completed_by', 'user_id', 'team_id']
203
209
  },
204
210
  {
205
211
  name: 'Completed At',
@@ -159,7 +159,7 @@ class ProjectPipeline {
159
159
  * @returns {Object} - Elasticsearch params object.
160
160
  */
161
161
  buildSourceParams(columns = []) {
162
- return sourceParams(columns, defaultCustomColumns);
162
+ return sourceParams(columns, this.defaultCustomColumns);
163
163
  }
164
164
  }
165
165
 
@@ -233,7 +233,7 @@ class TaskPipeline {
233
233
  * @returns {Object} - Elasticsearch params object.
234
234
  */
235
235
  buildSourceParams(columns = []) {
236
- return sourceParams(columns, defaultCustomColumns);
236
+ return sourceParams(columns, this.defaultCustomColumns);
237
237
  }
238
238
  }
239
239
 
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.4.6",
4
+ "version": "1.4.7",
5
5
  "license": "ISC",
6
6
  "author": "Outliant",
7
7
  "main": "index.js",
@@ -10,7 +10,7 @@ const taskPipeline = require('../../lib/taskPipeline');
10
10
  // Helpers
11
11
  const taskFilterHelper = require('../../helpers/taskFilter');
12
12
 
13
- describe('taskPipeline', function () {
13
+ describe.only('taskPipeline', function () {
14
14
  const testOrgId = 'test-org';
15
15
  const testDepartmentId = 'test-department';
16
16
 
@@ -72,56 +72,20 @@ describe('taskPipeline', function () {
72
72
  expect(filter).to.deep.equal({
73
73
  bool: {
74
74
  must: [
75
- {
76
- term: {
77
- organization_id: {
78
- value: 'test-org'
79
- }
80
- }
81
- },
82
- {
83
- term: {
84
- department_id: {
85
- value: 'test-department'
86
- }
87
- }
88
- },
89
- {
90
- term: {
91
- project_id: {
92
- value: 'test-project'
93
- }
94
- }
95
- },
75
+ { term: { organization_id: { value: 'test-org' } } },
76
+ { term: { department_id: { value: 'test-department' } } },
77
+ { term: { project_id: { value: 'test-project' } } },
96
78
  {
97
79
  bool: {
98
80
  must: [
99
- {
100
- term: {
101
- is_ready: true
102
- }
103
- },
104
- {
105
- term: {
106
- is_complete: false
107
- }
108
- },
81
+ { term: { is_ready: true } },
82
+ { term: { is_complete: false } },
109
83
  {
110
84
  bool: {
111
85
  should: [
86
+ { term: { is_paused: false } },
112
87
  {
113
- term: {
114
- is_paused: false
115
- }
116
- },
117
- {
118
- bool: {
119
- must_not: {
120
- exists: {
121
- field: 'is_paused'
122
- }
123
- }
124
- }
88
+ bool: { must_not: { exists: { field: 'is_paused' } } }
125
89
  }
126
90
  ]
127
91
  }
@@ -132,20 +96,16 @@ describe('taskPipeline', function () {
132
96
  {
133
97
  bool: {
134
98
  should: [
135
- {
136
- term: {
137
- on_hold: false
138
- }
139
- },
140
- {
141
- bool: {
142
- must_not: {
143
- exists: {
144
- field: 'on_hold'
145
- }
146
- }
147
- }
148
- }
99
+ { term: { on_hold: false } },
100
+ { bool: { must_not: { exists: { field: 'on_hold' } } } }
101
+ ]
102
+ }
103
+ },
104
+ {
105
+ bool: {
106
+ should: [
107
+ { term: { deleted: false } },
108
+ { bool: { must_not: { exists: { field: 'deleted' } } } }
149
109
  ]
150
110
  }
151
111
  }
@@ -176,7 +136,15 @@ describe('taskPipeline', function () {
176
136
  must: [
177
137
  { term: { organization_id: { value: 'test-org' } } },
178
138
  { term: { department_id: { value: 'test-department' } } },
179
- { bool: { must: [{ term: { on_hold: true } }] } }
139
+ { bool: { must: [{ term: { on_hold: true } }] } },
140
+ {
141
+ bool: {
142
+ should: [
143
+ { term: { deleted: false } },
144
+ { bool: { must_not: { exists: { field: 'deleted' } } } }
145
+ ]
146
+ }
147
+ }
180
148
  ]
181
149
  }
182
150
  });
@@ -202,37 +170,21 @@ describe('taskPipeline', function () {
202
170
  expect(filter).to.deep.equal({
203
171
  bool: {
204
172
  must: [
173
+ { term: { organization_id: { value: 'test-org' } } },
174
+ { term: { department_id: { value: 'test-department' } } },
205
175
  {
206
- term: {
207
- organization_id: {
208
- value: 'test-org'
209
- }
210
- }
211
- },
212
- {
213
- term: {
214
- department_id: {
215
- value: 'test-department'
216
- }
176
+ bool: {
177
+ should: [
178
+ { term: { on_hold: false } },
179
+ { bool: { must_not: { exists: { field: 'on_hold' } } } }
180
+ ]
217
181
  }
218
182
  },
219
183
  {
220
184
  bool: {
221
185
  should: [
222
- {
223
- term: {
224
- on_hold: false
225
- }
226
- },
227
- {
228
- bool: {
229
- must_not: {
230
- exists: {
231
- field: 'on_hold'
232
- }
233
- }
234
- }
235
- }
186
+ { term: { deleted: false } },
187
+ { bool: { must_not: { exists: { field: 'deleted' } } } }
236
188
  ]
237
189
  }
238
190
  }
@@ -271,6 +223,14 @@ describe('taskPipeline', function () {
271
223
  { bool: { must_not: { exists: { field: 'on_hold' } } } }
272
224
  ]
273
225
  }
226
+ },
227
+ {
228
+ bool: {
229
+ should: [
230
+ { term: { deleted: false } },
231
+ { bool: { must_not: { exists: { field: 'deleted' } } } }
232
+ ]
233
+ }
274
234
  }
275
235
  ]
276
236
  }
@@ -732,14 +692,18 @@ describe('taskPipeline', function () {
732
692
  '2acbd4b2-8242-46ec-9949-b058f783314b',
733
693
  '7fb0c729-478b-4c89-ae68-8d6e2360e39a',
734
694
  '18d7567f-873a-40a2-a94a-ee82242b0fa5',
735
- '80e83585-91d3-463c-8fff-e4f0311f694f'
695
+ '80e83585-91d3-463c-8fff-e4f0311f694f',
696
+ 'is_paused',
697
+ 'task_age'
736
698
  ])
737
699
  ).to.be.deep.equal({
738
700
  _source: [
739
701
  'project_id',
702
+ 'owner',
740
703
  'user_id',
741
704
  'team_id',
742
705
  'is_complete',
706
+ 'completed_by',
743
707
  'completed_at',
744
708
  'is_ready',
745
709
  'ready_at',
@@ -749,15 +713,14 @@ describe('taskPipeline', function () {
749
713
  'region_id',
750
714
  'notes',
751
715
  'project_banner',
752
- 'owner',
753
- 'completed_by',
754
716
  'critical_path',
755
717
  'due_date',
756
718
  'is_starred',
757
719
  'marked_incomplete_at',
758
720
  'was_marked_incomplete',
759
721
  'deleted',
760
- 'updated_at'
722
+ 'updated_at',
723
+ 'is_paused'
761
724
  ],
762
725
  script_fields: {
763
726
  filtered_fields: {