Filter communications in the frontend
Since we will know about communications we just moved into another state in frontend land.
This commit is contained in:
parent
3a3cd78cac
commit
633abd19a9
2 changed files with 12 additions and 1 deletions
|
|
@ -533,6 +533,7 @@ export interface CommunicationDTO {
|
||||||
created: string;
|
created: string;
|
||||||
id: string;
|
id: string;
|
||||||
source: string;
|
source: string;
|
||||||
|
status: string;
|
||||||
type: string;
|
type: string;
|
||||||
uri: string;
|
uri: string;
|
||||||
}
|
}
|
||||||
|
|
@ -541,6 +542,7 @@ export class Communication {
|
||||||
public created: Date,
|
public created: Date,
|
||||||
public id: string,
|
public id: string,
|
||||||
public source: string,
|
public source: string,
|
||||||
|
public status: string,
|
||||||
public type: string,
|
public type: string,
|
||||||
public uri: string,
|
public uri: string,
|
||||||
) {}
|
) {}
|
||||||
|
|
@ -549,6 +551,7 @@ export class Communication {
|
||||||
new Date(json.created),
|
new Date(json.created),
|
||||||
json.id,
|
json.id,
|
||||||
json.source,
|
json.source,
|
||||||
|
json.status,
|
||||||
json.type,
|
json.type,
|
||||||
json.uri,
|
json.uri,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
</template>
|
</template>
|
||||||
<template #left>
|
<template #left>
|
||||||
<CommunicationColumnList
|
<CommunicationColumnList
|
||||||
:all="storeCommunication.all"
|
:all="visibleCommunications"
|
||||||
@deselect="handleDeselect"
|
@deselect="handleDeselect"
|
||||||
:loading="storeCommunication.loading"
|
:loading="storeCommunication.loading"
|
||||||
:selectedID="selectedId"
|
:selectedID="selectedId"
|
||||||
|
|
@ -192,6 +192,14 @@ const selectedReport = computedAsync(
|
||||||
return await storePublicReport.byURI(selectedCommunication.value.source);
|
return await storePublicReport.byURI(selectedCommunication.value.source);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
const visibleCommunications = computed((): Communication[] => {
|
||||||
|
if (!storeCommunication.all) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
return storeCommunication.all.filter((c: Communication) => {
|
||||||
|
return c.status == "new" || c.status == "opened";
|
||||||
|
});
|
||||||
|
});
|
||||||
const handleDeselect = (id: string) => {
|
const handleDeselect = (id: string) => {
|
||||||
selectedId.value = undefined;
|
selectedId.value = undefined;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue