Activity update

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov
2021-08-18 12:57:06 +02:00
parent 522af1e9b1
commit 2e3c7c566c
4 changed files with 65 additions and 38 deletions
@@ -0,0 +1,56 @@
<!--
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2021 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import type { Doc } from '@anticrm/core'
import { Backlink as BacklinkComponent } from '@anticrm/presentation'
import type { Backlink } from '@anticrm/chunter'
import { CommentViewer } from '@anticrm/presentation'
import { ReferenceInput } from '@anticrm/text-editor'
import { createQuery } from '@anticrm/presentation'
import { Section, IconComments } from '@anticrm/ui'
import Bookmark from './icons/Bookmark.svelte'
import chunter from '@anticrm/chunter'
export let object: Doc
let backlinks: Backlink[]
const query = createQuery()
$: query.query(chunter.class.Backlink, { objectId: object._id }, result => { backlinks = result })
</script>
<Section icon={IconComments} label={'Comments'}>
<CommentViewer />
<div class="reference"><ReferenceInput /></div>
</Section>
{#if backlinks && backlinks.length > 0}
<Section icon={Bookmark} label={'Backlinks'}>
{#each backlinks as backlink}
<BacklinkComponent {backlink} />
{/each}
</Section>
{/if}
<style lang="scss">
.reference {
margin-top: 24px;
}
</style>
+3 -1
View File
@@ -15,10 +15,12 @@
import CreateChannel from './components/CreateChannel.svelte'
import ChannelView from './components/ChannelView.svelte'
import Activity from './components/Activity.svelte'
export default async () => ({
component: {
CreateChannel,
ChannelView
ChannelView,
Activity
}
})
+1 -1
View File
@@ -24,7 +24,7 @@ import chunter, { chunterId } from '@anticrm/chunter'
export default mergeIds(chunterId, chunter, {
component: {
CreateChannel: '' as AnyComponent,
ChannelView: '' as AnyComponent
ChannelView: '' as AnyComponent,
},
class: {
Channel: '' as Ref<Class<Channel>>,
@@ -15,31 +15,17 @@
<script lang="ts">
import { createEventDispatcher } from 'svelte'
import type { Ref, Space, Doc } from '@anticrm/core'
import { TextArea, EditBox, Dialog, Tabs, Section, Grid, IconComments } from '@anticrm/ui'
import { AttributeEditor, getClient, CommentViewer } from '@anticrm/presentation'
import { ReferenceInput } from '@anticrm/text-editor'
import { Dialog, Tabs } from '@anticrm/ui'
import { getClient } from '@anticrm/presentation'
import type { Candidate } from '@anticrm/recruit'
import type { Backlink } from '@anticrm/chunter'
import { Backlink as BacklinkComponent } from '@anticrm/presentation'
import DialogHeader from './DialogHeader.svelte'
import Address from './icons/Address.svelte'
import Attachment from './icons/Attachment.svelte'
import { createQuery } from '@anticrm/presentation'
import recruit from '../plugin'
import chunter from '@anticrm/chunter'
export let object: Candidate
const dispatch = createEventDispatcher()
let backlinks: Backlink[]
const client = getClient()
const query = createQuery()
$: query.query(chunter.class.Backlink, { objectId: object._id }, result => { backlinks = result })
const newValue = Object.assign({}, object)
@@ -64,10 +50,9 @@
},
{
label: 'Activity',
component: 'recruit:component:CandidateGeneral',
component: 'chunter:component:Activity',
props: {
object,
newValue,
object
}
}
]
@@ -80,21 +65,5 @@
on:close={() => { dispatch('close') }}>
<DialogHeader />
<Tabs model={tabModel}/>
<Section icon={IconComments} label={'Comments'}>
<CommentViewer />
<div class="reference"><ReferenceInput /></div>
</Section>
{#if backlinks && backlinks.length > 0}
<Section icon={Address} label={'Backlinks'}>
{#each backlinks as backlink}
<BacklinkComponent {backlink} />
{/each}
</Section>
{/if}
</Dialog>
<style lang="scss">
.reference {
margin-top: 24px;
}
</style>