2021-08-31 10:42:40 +00:00
|
|
|
<!--
|
|
|
|
// 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">
|
2021-09-10 14:26:16 +00:00
|
|
|
import type { Channel } from '@anticrm/contact'
|
2022-02-07 09:03:14 +00:00
|
|
|
import ChannelsView from './ChannelsView.svelte'
|
|
|
|
import { showPanel } from '@anticrm/ui'
|
|
|
|
import view from '@anticrm/view'
|
2021-09-01 15:11:01 +00:00
|
|
|
|
2022-02-02 13:24:52 +00:00
|
|
|
export let value: Channel[] | Channel | null
|
2022-02-07 09:03:14 +00:00
|
|
|
|
|
|
|
function click (ev: any) {
|
|
|
|
if (ev.detail.presenter !== undefined && Array.isArray(value)) {
|
|
|
|
const channel = value[0]
|
|
|
|
if (channel !== undefined) {
|
|
|
|
showPanel(
|
|
|
|
view.component.EditDoc,
|
|
|
|
channel.attachedTo,
|
|
|
|
channel.attachedToClass,
|
|
|
|
'full',
|
|
|
|
ev.detail.presenter
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-31 10:42:40 +00:00
|
|
|
</script>
|
|
|
|
|
2022-03-03 09:26:00 +00:00
|
|
|
<ChannelsView {value} size={'small'} length={'short'} on:click={click} />
|