Skip to content

Commit 4827bc9

Browse files
[SDESK-7942]: Item sent to Personal space still available in the Sent Desk Output stage (#5192) (#5210)
* SDESK-7942: hide personal items from sent desk output * suggested fixes
1 parent d91c24b commit 4827bc9

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

scripts/apps/monitoring/services/CardsService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ export function CardsService(search, session, desks) {
141141
case SENT_OUTPUT:
142142
deskId = card._id.substring(0, card._id.indexOf(':'));
143143
query.filter({bool: {
144-
filter: {term: {'task.desk_history': deskId}},
144+
must: [
145+
{term: {'task.desk_history': deskId}},
146+
{exists: {field: 'task.desk'}},
147+
],
145148
must_not: {term: {'task.desk': deskId}},
146149
}});
147150
break;

scripts/apps/monitoring/tests/monitoring.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,19 @@ describe('monitoring', () => {
185185
});
186186
}));
187187

188+
it('can get criteria for sent desk output', inject((cards, session) => {
189+
var card: any = {_id: '1:sent', type: 'sentDeskOutput'};
190+
var criteria = cards.criteria(card);
191+
192+
expect(criteria.source.query.filtered.filter.and).toContain({bool: {
193+
must: [
194+
{term: {'task.desk_history': '1'}},
195+
{exists: {field: 'task.desk'}},
196+
],
197+
must_not: {term: {'task.desk': '1'}},
198+
}});
199+
}));
200+
188201
it('can get criteria for highlight', inject((cards, session) => {
189202
var card = {type: 'highlights'};
190203
var queryParam = {highlight: '123'};

0 commit comments

Comments
 (0)