-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added listviewcomponent, filter, sort & list view settings in ca…
…ll logs list
- Loading branch information
1 parent
869e895
commit 4aa4648
Showing
3 changed files
with
273 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<template> | ||
<ListView | ||
:columns="columns" | ||
:rows="rows" | ||
:options="{ | ||
getRowRoute: (row) => ({ | ||
name: 'Call Log', | ||
params: { callLogId: row.name }, | ||
}), | ||
selectable: options.selectable, | ||
}" | ||
row-key="name" | ||
> | ||
<ListHeader class="mx-5" /> | ||
<ListRows> | ||
<ListRow | ||
class="mx-5" | ||
v-for="row in rows" | ||
:key="row.name" | ||
v-slot="{ column, item }" | ||
:row="row" | ||
> | ||
<ListRowItem :item="item"> | ||
<template #prefix> | ||
<div v-if="['caller', 'receiver'].includes(column.key)"> | ||
<Avatar | ||
v-if="item.label" | ||
class="flex items-center" | ||
:image="item.image" | ||
:label="item.label" | ||
size="sm" | ||
/> | ||
</div> | ||
<div v-else-if="['type', 'duration'].includes(column.key)"> | ||
<FeatherIcon :name="item.icon" class="h-3 w-3" /> | ||
</div> | ||
</template> | ||
<div | ||
v-if="['modified', 'creation'].includes(column.key)" | ||
class="truncate text-base" | ||
> | ||
{{ item.timeAgo }} | ||
</div> | ||
<div v-else-if="column.key === 'status'" class="truncate text-base"> | ||
<Badge | ||
:variant="'subtle'" | ||
:theme="item.color" | ||
size="md" | ||
:label="item.label" | ||
/> | ||
</div> | ||
<div v-else-if="column.type === 'Check'"> | ||
<FormControl | ||
type="checkbox" | ||
:modelValue="item" | ||
:disabled="true" | ||
class="text-gray-900" | ||
/> | ||
</div> | ||
</ListRowItem> | ||
</ListRow> | ||
</ListRows> | ||
<ListSelectBanner /> | ||
</ListView> | ||
</template> | ||
<script setup> | ||
import { | ||
Avatar, | ||
ListView, | ||
ListHeader, | ||
ListRows, | ||
ListRow, | ||
ListSelectBanner, | ||
ListRowItem, | ||
FormControl, | ||
FeatherIcon, | ||
Badge, | ||
} from 'frappe-ui' | ||
const props = defineProps({ | ||
rows: { | ||
type: Array, | ||
required: true, | ||
}, | ||
columns: { | ||
type: Array, | ||
required: true, | ||
}, | ||
options: { | ||
type: Object, | ||
default: () => ({ | ||
selectable: true, | ||
}), | ||
}, | ||
}) | ||
</script> |
Oops, something went wrong.