mirror of
https://github.com/hcengineering/platform.git
synced 2026-10-01 05:55:09 +02:00
Fix webpack build conflicts (#985)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -1,94 +0,0 @@
|
||||
<!--
|
||||
// Copyright © 2020 Anticrm Platform Contributors.
|
||||
//
|
||||
// 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 { Ref, Space, Doc, Class, FindOptions } from '@anticrm/core'
|
||||
import type { Issue } from '@anticrm/task'
|
||||
import { createQuery } from '@anticrm/presentation'
|
||||
import { CircleButton, IconAdd, showPopup, Label } from '@anticrm/ui'
|
||||
import CreateTask from './CreateTask.svelte'
|
||||
// import FileDuo from "./icons/FileDuo.svelte"
|
||||
import { Table } from '@anticrm/view-resources'
|
||||
|
||||
import core from '@anticrm/core'
|
||||
import task from '../plugin'
|
||||
|
||||
export let objectId: Ref<Doc>
|
||||
export let space: Ref<Space>
|
||||
export let _class: Ref<Class<Doc>>
|
||||
|
||||
let tasks: Issue[] = []
|
||||
|
||||
const query = createQuery()
|
||||
$: query.query(task.class.Issue, { attachedTo: objectId }, result => { tasks = result })
|
||||
|
||||
const createApp = (ev: MouseEvent): void => {
|
||||
showPopup(CreateTask, { parent: { _id: objectId, _class, space } }, ev.target as HTMLElement, () => {})
|
||||
}
|
||||
|
||||
const options: FindOptions<Issue> = {
|
||||
lookup: {
|
||||
state: task.class.State,
|
||||
space: core.class.Space
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="applications-container">
|
||||
<div class="flex-row-center">
|
||||
<div class="title">Tasks</div>
|
||||
<CircleButton icon={IconAdd} size={'small'} on:click={createApp} />
|
||||
</div>
|
||||
{#if tasks.length > 0}
|
||||
<Table
|
||||
_class={task.class.Issue}
|
||||
config={['', '$lookup.space.name', '$lookup.state']}
|
||||
{options}
|
||||
query={ { attachedTo: objectId } }
|
||||
/>
|
||||
{:else}
|
||||
<div class="flex-col-center mt-5 createapp-container">
|
||||
<!-- <FileDuo size={'large'} /> -->
|
||||
<div class="text-sm content-dark-color mt-2">
|
||||
<Label label={task.string.NoTaskForObject} />
|
||||
</div>
|
||||
<div class="text-sm">
|
||||
<div class='over-underline' on:click={createApp}><Label label={task.string.CreateTask} /></div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.applications-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.title {
|
||||
margin-right: .75rem;
|
||||
font-weight: 500;
|
||||
font-size: 1.25rem;
|
||||
color: var(--theme-caption-color);
|
||||
}
|
||||
}
|
||||
|
||||
.createapp-container {
|
||||
padding: 1rem;
|
||||
color: var(--theme-caption-color);
|
||||
background: var(--theme-bg-accent-color);
|
||||
border: 1px solid var(--theme-bg-accent-color);
|
||||
border-radius: .75rem;
|
||||
}
|
||||
</style>
|
||||
@@ -15,10 +15,11 @@
|
||||
<script lang="ts">
|
||||
import type { Ref } from '@anticrm/core'
|
||||
import { createQuery } from '@anticrm/presentation'
|
||||
import { DropdownLabels } from '@anticrm/ui'
|
||||
import type { DropdownTextItem } from '@anticrm/ui/src/types'
|
||||
import type { KanbanTemplate, KanbanTemplateSpace } from '@anticrm/task'
|
||||
import task from '@anticrm/task'
|
||||
import { DropdownLabels } from '@anticrm/ui'
|
||||
import type { DropdownTextItem } from '@anticrm/ui/src/types'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import plugin from '../../plugin'
|
||||
|
||||
export let folders: Ref<KanbanTemplateSpace>[]
|
||||
@@ -32,7 +33,12 @@
|
||||
$: items = templates.map(x => ({ id: x._id, label: x.title }))
|
||||
|
||||
let selectedItem: string | undefined
|
||||
$: template = selectedItem === undefined ? undefined : selectedItem as Ref<KanbanTemplate>
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
$: {
|
||||
template = selectedItem === undefined ? undefined : selectedItem as Ref<KanbanTemplate>
|
||||
dispatch('change', template)
|
||||
}
|
||||
</script>
|
||||
|
||||
<DropdownLabels {items} bind:selected={selectedItem} title={plugin.string.States} />
|
||||
|
||||
Reference in New Issue
Block a user