mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-07 00:09:34 +00:00
checkpoint
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
bb08165fef
commit
34cecc90e1
@ -80,7 +80,7 @@ $: {
|
|||||||
.popup {
|
.popup {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
backdrop-filter: blur(.5rem);
|
backdrop-filter: blur(30px);
|
||||||
filter: drop-shadow(0 1.5rem 4rem rgba(0, 0, 0, .6));
|
filter: drop-shadow(0 1.5rem 4rem rgba(0, 0, 0, .6));
|
||||||
}
|
}
|
||||||
.modal-overlay {
|
.modal-overlay {
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import type { Ref, Class, Doc, Space, FindOptions } from '@anticrm/core'
|
import type { Ref, Class, Doc, Space, FindOptions, State } from '@anticrm/core'
|
||||||
import { buildModel } from '../utils'
|
import { buildModel } from '../utils'
|
||||||
import { getClient } from '@anticrm/presentation'
|
import { getClient } from '@anticrm/presentation'
|
||||||
import { Label, showPopup, Loading, ScrollBox } from '@anticrm/ui'
|
import { Label, showPopup, Loading, ScrollBox } from '@anticrm/ui'
|
||||||
@ -29,13 +29,20 @@
|
|||||||
import KanbanCard from './KanbanCard.svelte'
|
import KanbanCard from './KanbanCard.svelte'
|
||||||
import KanbanCardEmpty from './KanbanCardEmpty.svelte'
|
import KanbanCardEmpty from './KanbanCardEmpty.svelte'
|
||||||
|
|
||||||
export let _class: Ref<Class<Doc>>
|
import core from '@anticrm/core'
|
||||||
|
import { _ID_SEPARATOR } from '@anticrm/platform';
|
||||||
|
|
||||||
|
export let _class: Ref<Class<(Doc & { state: Ref<State> })>>
|
||||||
export let space: Ref<Space>
|
export let space: Ref<Space>
|
||||||
export let open: AnyComponent
|
export let open: AnyComponent
|
||||||
export let options: FindOptions<Doc> | undefined
|
export let options: FindOptions<Doc> | undefined
|
||||||
export let config: string[]
|
export let config: string[]
|
||||||
|
|
||||||
let objects: Doc[]
|
let states: State[] = []
|
||||||
|
let objects: (Doc & { state: Ref<State> })[]
|
||||||
|
|
||||||
|
const statesQuery = createQuery()
|
||||||
|
$: statesQuery.query(core.class.State, { space }, result => { states = result })
|
||||||
|
|
||||||
const query = createQuery()
|
const query = createQuery()
|
||||||
$: query.query(_class, { space }, result => { objects = result }, options)
|
$: query.query(_class, { space }, result => { objects = result }, options)
|
||||||
@ -58,30 +65,16 @@
|
|||||||
showPopup(open, { object, space }, 'float')
|
showPopup(open, { object, space }, 'float')
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ICard {
|
const colors = [
|
||||||
_id: number
|
'#7C6FCD',
|
||||||
firstName: string
|
'#6F7BC5',
|
||||||
lastName: string
|
'#A5D179',
|
||||||
description: string
|
'#77C07B',
|
||||||
state: number
|
'#F28469'
|
||||||
}
|
|
||||||
let dragCard: ICard
|
|
||||||
let states: Array<Object> = [
|
|
||||||
{ _id: 0, label: 'In progress', color: '#7C6FCD' },
|
|
||||||
{ _id: 1, label: 'Under review', color: '#6F7BC5' },
|
|
||||||
{ _id: 2, label: 'Interview', color: '#A5D179' },
|
|
||||||
{ _id: 3, label: 'Offer', color: '#77C07B' },
|
|
||||||
{ _id: 4, label: 'Assigned', color: '#F28469' }
|
|
||||||
]
|
|
||||||
const cards: Array<ICard> = [
|
|
||||||
{ _id: 0, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 0 },
|
|
||||||
{ _id: 1, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 0 },
|
|
||||||
{ _id: 2, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 0 },
|
|
||||||
{ _id: 3, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 1 },
|
|
||||||
{ _id: 4, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 1 },
|
|
||||||
{ _id: 5, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 2 },
|
|
||||||
{ _id: 6, firstName: 'Chen', lastName: 'Rosamund', description: '8:30AM, July 12 Voltron, San Francisco', state: 3 },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
let dragCard: (Doc & { state: Ref<State>}) | undefined
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#await buildModel(client, _class, config, options)}
|
{#await buildModel(client, _class, config, options)}
|
||||||
@ -90,21 +83,21 @@
|
|||||||
<div class="kanban-container">
|
<div class="kanban-container">
|
||||||
<ScrollBox>
|
<ScrollBox>
|
||||||
<div class="kanban-content">
|
<div class="kanban-content">
|
||||||
{#each states as state}
|
{#each states as state, i}
|
||||||
<KanbanPanel label={state.label} color={state.color} counter={4}
|
<KanbanPanel label={state.label} color={colors[i]} counter={4}
|
||||||
on:dragover={(event) => {
|
on:dragover={(event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
}}
|
}}
|
||||||
on:drop={(event) => {
|
on:drop={(event) => {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
if (dragCard) {
|
if (dragCard) {
|
||||||
dragCard.state = state._id
|
client.updateDoc(_class, space, dragCard._id, { state: state._id })
|
||||||
dragCard = undefined
|
dragCard = undefined
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<KanbanCardEmpty label={'Create new application'} />
|
<KanbanCardEmpty label={'Create new application'} />
|
||||||
{#each cards.filter((c) => c.state === state._id) as card}
|
{#each objects.filter((c) => c.state === state._id) as card}
|
||||||
<KanbanCard {card} draggable={true}
|
<KanbanCard {card} draggable={true}
|
||||||
on:dragstart={() => {
|
on:dragstart={() => {
|
||||||
dragCard = card
|
dragCard = card
|
||||||
|
Loading…
Reference in New Issue
Block a user