Activity sidebar (#327)

* Show activity sidebar in detail page

* Add localized format distance util

* Update use-time-from-now composition to use localized dates

* Install marked

* Add activity delta strings

* Show all activity records in sidebar

* Add correct permutations of users

* Make avatar rounded square

* Finish posting comments

* Remove empty test file

* Fix tests
This commit is contained in:
Rijk van Zanten
2020-04-06 15:25:58 -04:00
committed by GitHub
parent 281d2865c7
commit bba4dae46d
23 changed files with 400 additions and 120 deletions

View File

@@ -60,6 +60,10 @@
:collection="collection"
v-model="edits"
/>
<template #drawer>
<activity-drawer-detail :collection="collection" :primary-key="primaryKey" />
</template>
</private-view>
</template>
@@ -72,6 +76,7 @@ import { i18n } from '@/lang';
import router from '@/router';
import CollectionsNotFound from '../not-found/';
import useCollection from '@/compositions/use-collection';
import ActivityDrawerDetail from '@/components/activity-drawer-detail';
type Values = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -80,7 +85,7 @@ type Values = {
export default defineComponent({
name: 'collections-detail',
components: { CollectionsNavigation, CollectionsNotFound },
components: { CollectionsNavigation, CollectionsNotFound, ActivityDrawerDetail },
props: {
collection: {
type: String,
@@ -169,12 +174,12 @@ export default defineComponent({
try {
if (isNew.value === true) {
await api.post(
`/${currentProjectKey}/items/${props.collection}`,
`/${currentProjectKey.value}/items/${props.collection}`,
edits.value
);
} else {
await api.patch(
`/${currentProjectKey}/items/${props.collection}/${props.primaryKey}`,
`/${currentProjectKey.value}/items/${props.collection}/${props.primaryKey}`,
edits.value
);
}
@@ -183,7 +188,7 @@ export default defineComponent({
alert(error);
} finally {
saving.value = true;
router.push(`/${currentProjectKey}/collections/${props.collection}`);
router.push(`/${currentProjectKey.value}/collections/${props.collection}`);
}
}
}