2021-08-07 14:49:14 +00:00
|
|
|
//
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
|
2021-09-25 16:48:22 +00:00
|
|
|
import type { Doc } from '@anticrm/core'
|
|
|
|
|
2021-08-07 14:49:14 +00:00
|
|
|
import StringEditor from './components/StringEditor.svelte'
|
|
|
|
import StringPresenter from './components/StringPresenter.svelte'
|
2021-10-04 19:18:23 +00:00
|
|
|
import BooleanEditor from './components/BooleanEditor.svelte'
|
2021-09-05 12:03:33 +00:00
|
|
|
import StatePresenter from './components/StatePresenter.svelte'
|
2021-10-05 14:34:52 +00:00
|
|
|
import TimestampPresenter from './components/TimestampPresenter.svelte'
|
2021-08-07 14:49:14 +00:00
|
|
|
import TableView from './components/TableView.svelte'
|
2021-09-06 08:40:20 +00:00
|
|
|
import KanbanView from './components/KanbanView.svelte'
|
2021-08-07 14:49:14 +00:00
|
|
|
|
2021-10-13 09:06:35 +00:00
|
|
|
import { getClient, MessageBox } from '@anticrm/presentation'
|
|
|
|
import { showPopup } from '@anticrm/ui'
|
2021-09-25 16:48:22 +00:00
|
|
|
|
2021-10-13 08:38:35 +00:00
|
|
|
export { TableView }
|
|
|
|
|
2021-10-13 09:06:35 +00:00
|
|
|
function Delete(object: Doc): void {
|
|
|
|
showPopup(MessageBox, {
|
|
|
|
label: 'Delete object',
|
|
|
|
message: 'Do you want to delete this object?'
|
|
|
|
}, undefined, (result) => {
|
|
|
|
if (result) {
|
|
|
|
const client = getClient()
|
|
|
|
client.removeDoc(object._class, object.space, object._id)
|
|
|
|
}
|
|
|
|
})
|
2021-09-25 16:48:22 +00:00
|
|
|
}
|
|
|
|
|
2021-08-07 14:49:14 +00:00
|
|
|
export default async () => ({
|
2021-09-25 16:48:22 +00:00
|
|
|
actionImpl: {
|
|
|
|
Delete
|
|
|
|
},
|
2021-08-07 14:49:14 +00:00
|
|
|
component: {
|
|
|
|
StringEditor,
|
|
|
|
StringPresenter,
|
2021-10-04 19:18:23 +00:00
|
|
|
BooleanEditor,
|
2021-09-05 12:03:33 +00:00
|
|
|
StatePresenter,
|
2021-09-06 08:40:20 +00:00
|
|
|
TableView,
|
2021-10-05 14:34:52 +00:00
|
|
|
KanbanView,
|
|
|
|
TimestampPresenter
|
2021-08-07 14:49:14 +00:00
|
|
|
},
|
|
|
|
})
|