mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-16 13:21:57 +00:00
Format Task resources (#443)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
fe585ec596
commit
2f1733cd47
plugins/task-resources/src
@ -25,15 +25,15 @@
|
|||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
|
|
||||||
let name: string = ''
|
let name: string = ''
|
||||||
let description: string = ''
|
const description: string = ''
|
||||||
|
|
||||||
export function canClose(): boolean {
|
export function canClose (): boolean {
|
||||||
return name === ''
|
return name === ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
function createProject() {
|
function createProject () {
|
||||||
client.createDoc(task.class.Project, core.space.Model, {
|
client.createDoc(task.class.Project, core.space.Model, {
|
||||||
name,
|
name,
|
||||||
description,
|
description,
|
||||||
@ -46,7 +46,7 @@
|
|||||||
<SpaceCreateCard
|
<SpaceCreateCard
|
||||||
label={task.string.CreateProject}
|
label={task.string.CreateProject}
|
||||||
okAction={createProject}
|
okAction={createProject}
|
||||||
canSave={name ? true : false}
|
canSave={name.length > 0}
|
||||||
on:close={() => { dispatch('close') }}
|
on:close={() => { dispatch('close') }}
|
||||||
>
|
>
|
||||||
<Grid column={1} rowGap={1.5}>
|
<Grid column={1} rowGap={1.5}>
|
||||||
|
@ -17,10 +17,10 @@
|
|||||||
import contact, { Employee, EmployeeAccount } from '@anticrm/contact'
|
import contact, { Employee, EmployeeAccount } from '@anticrm/contact'
|
||||||
import type { Data, Ref, Space } from '@anticrm/core'
|
import type { Data, Ref, Space } from '@anticrm/core'
|
||||||
import { generateId } from '@anticrm/core'
|
import { generateId } from '@anticrm/core'
|
||||||
|
import { OK, Status } from '@anticrm/platform'
|
||||||
import { Card, getClient, UserBox } from '@anticrm/presentation'
|
import { Card, getClient, UserBox } from '@anticrm/presentation'
|
||||||
import { Task } from '@anticrm/task'
|
import { Task } from '@anticrm/task'
|
||||||
import { EditBox, Grid, Status as StatusControl } from '@anticrm/ui'
|
import { EditBox, Grid, Status as StatusControl } from '@anticrm/ui'
|
||||||
import { Status, OK, Severity } from '@anticrm/platform'
|
|
||||||
import view from '@anticrm/view'
|
import view from '@anticrm/view'
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte'
|
||||||
import task from '../plugin'
|
import task from '../plugin'
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
//
|
//
|
||||||
// Copyright © 2020 Anticrm Platform Contributors.
|
// Copyright © 2020 Anticrm Platform Contributors.
|
||||||
//
|
//
|
||||||
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
|
// 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
|
// 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
|
// 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
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
//
|
//
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
|
@ -34,7 +34,7 @@ export async function uploadFile (space: Ref<Space>, file: File, attachedTo: Ref
|
|||||||
body: data
|
body: data
|
||||||
})
|
})
|
||||||
if (resp.status !== 200) {
|
if (resp.status !== 200) {
|
||||||
throw new Error('Can\'t upload file.')
|
throw new Error("Can't upload file.")
|
||||||
}
|
}
|
||||||
const uuid = await resp.text()
|
const uuid = await resp.text()
|
||||||
console.log(uuid)
|
console.log(uuid)
|
||||||
|
Loading…
Reference in New Issue
Block a user