mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
Inbox and chat fixes (#6803)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
parent
d3a7759ef7
commit
b5f6a83ce6
@ -388,7 +388,7 @@ export function createModel (builder: Builder): void {
|
||||
core.space.Model,
|
||||
{
|
||||
label: notification.string.Inbox,
|
||||
icon: notification.icon.Inbox,
|
||||
icon: notification.icon.Notifications,
|
||||
alias: notificationId,
|
||||
hidden: true,
|
||||
locationResolver: notification.resolver.Location,
|
||||
|
@ -0,0 +1,26 @@
|
||||
<!--
|
||||
// Copyright © 2024 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">
|
||||
import { markupToJSON } from '@hcengineering/text'
|
||||
import LiteNode from './markup/lite/LiteNode.svelte'
|
||||
|
||||
export let message: string
|
||||
|
||||
$: node = markupToJSON(message)
|
||||
</script>
|
||||
|
||||
<div class="text-markup-view">
|
||||
<LiteNode {node} />
|
||||
</div>
|
@ -0,0 +1,30 @@
|
||||
<!--
|
||||
// Copyright © 2024 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">
|
||||
import { MarkupNode } from '@hcengineering/text'
|
||||
|
||||
import LiteNodeContent from './LiteNodeContent.svelte'
|
||||
import NodeMarks from '../NodeMarks.svelte'
|
||||
|
||||
export let node: MarkupNode
|
||||
</script>
|
||||
|
||||
{#if node}
|
||||
{@const marks = node.marks ?? []}
|
||||
|
||||
<NodeMarks {marks}>
|
||||
<LiteNodeContent {node} />
|
||||
</NodeMarks>
|
||||
{/if}
|
@ -0,0 +1,105 @@
|
||||
<!--
|
||||
// Copyright © 2024 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">
|
||||
import { Class, Doc, Ref } from '@hcengineering/core'
|
||||
import { AttrValue, MarkupNode, MarkupNodeType, MarkupMarkType } from '@hcengineering/text'
|
||||
|
||||
import LiteNodes from './LiteNodes.svelte'
|
||||
import ObjectNode from '../ObjectNode.svelte'
|
||||
import NodeMarks from '../NodeMarks.svelte'
|
||||
|
||||
export let node: MarkupNode
|
||||
|
||||
function toRef (objectId: string): Ref<Doc> {
|
||||
return objectId as Ref<Doc>
|
||||
}
|
||||
|
||||
function toClassRef (objectClass: string): Ref<Class<Doc>> {
|
||||
if (objectClass === 'contact:class:Employee') {
|
||||
return 'contact:mixin:Employee' as Ref<Class<Doc>>
|
||||
}
|
||||
return objectClass as Ref<Class<Doc>>
|
||||
}
|
||||
|
||||
function toString (value: AttrValue | undefined): string | undefined {
|
||||
return value !== undefined ? `${value}` : undefined
|
||||
}
|
||||
|
||||
function toNumber (value: AttrValue | undefined): number | undefined {
|
||||
if (typeof value === 'boolean') {
|
||||
return value ? 1 : 0
|
||||
}
|
||||
|
||||
return value !== undefined ? (typeof value === 'string' ? parseInt(value) : value) : undefined
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if node}
|
||||
{@const attrs = node.attrs ?? {}}
|
||||
{@const nodes = node.content ?? []}
|
||||
|
||||
{#if node.type === MarkupNodeType.doc}
|
||||
<LiteNodes {nodes} />
|
||||
{:else if node.type === MarkupNodeType.text}
|
||||
{node.text}
|
||||
{:else if node.type === MarkupNodeType.paragraph}
|
||||
<p class="p-inline contrast" class:overflow-label={true} style:margin="0">
|
||||
<LiteNodes {nodes} />
|
||||
</p>
|
||||
{:else if node.type === MarkupNodeType.blockquote}
|
||||
<LiteNodes {nodes} />
|
||||
{:else if node.type === MarkupNodeType.horizontal_rule}
|
||||
<!-- nothing-->
|
||||
{:else if node.type === MarkupNodeType.heading}
|
||||
{@const level = toNumber(node.attrs?.level) ?? 1}
|
||||
{@const element = `h${level}`}
|
||||
<svelte:element this={element}>
|
||||
<LiteNodes {nodes} />
|
||||
</svelte:element>
|
||||
{:else if node.type === MarkupNodeType.code_block}
|
||||
<p class="p-inline contrast" class:overflow-label={true} style:margin="0">
|
||||
<NodeMarks
|
||||
marks={[
|
||||
{
|
||||
type: MarkupMarkType.code,
|
||||
attrs: {}
|
||||
}
|
||||
]}
|
||||
>
|
||||
<LiteNodes {nodes} />
|
||||
</NodeMarks>
|
||||
</p>
|
||||
{:else if node.type === MarkupNodeType.reference}
|
||||
{@const objectId = toString(attrs.id)}
|
||||
{@const objectClass = toString(attrs.objectclass)}
|
||||
{@const objectLabel = toString(attrs.label)}
|
||||
|
||||
{#if objectClass !== undefined && objectId !== undefined}
|
||||
<ObjectNode _id={toRef(objectId)} _class={toClassRef(objectClass)} title={objectLabel} />
|
||||
{:else}
|
||||
<LiteNodes {nodes} />
|
||||
{/if}
|
||||
{:else if node.type === MarkupNodeType.taskList}
|
||||
<!-- TODO not implemented -->
|
||||
{:else if node.type === MarkupNodeType.taskItem}
|
||||
<!-- TODO not implemented -->
|
||||
{:else if node.type === MarkupNodeType.subLink}
|
||||
<sub>
|
||||
<LiteNodes {nodes} />
|
||||
</sub>
|
||||
{:else}
|
||||
<LiteNodes {nodes} />
|
||||
{/if}
|
||||
{/if}
|
@ -0,0 +1,27 @@
|
||||
<!--
|
||||
// Copyright © 2024 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">
|
||||
import { MarkupNode } from '@hcengineering/text'
|
||||
|
||||
import LiteNode from './LiteNode.svelte'
|
||||
|
||||
export let nodes: MarkupNode[]
|
||||
</script>
|
||||
|
||||
{#if nodes}
|
||||
{#each nodes as node}
|
||||
<LiteNode {node} />
|
||||
{/each}
|
||||
{/if}
|
@ -47,6 +47,7 @@ export { default as BreadcrumbsElement } from './components/breadcrumbs/Breadcru
|
||||
export { default as ComponentExtensions } from './components/extensions/ComponentExtensions.svelte'
|
||||
export { default as DocCreateExtComponent } from './components/extensions/DocCreateExtComponent.svelte'
|
||||
export { default as SearchResult } from './components/SearchResult.svelte'
|
||||
export { default as LiteMessageViewer } from './components/LiteMessageViewer.svelte'
|
||||
export { default as DownloadFileButton } from './components/DownloadFileButton.svelte'
|
||||
export { default as FileTypeIcon } from './components/FileTypeIcon.svelte'
|
||||
export { default } from './plugin'
|
||||
|
@ -108,7 +108,7 @@ li {
|
||||
}
|
||||
|
||||
p {
|
||||
user-select: text;
|
||||
user-select:inherit;
|
||||
|
||||
a {
|
||||
word-break: break-all;
|
||||
|
@ -166,7 +166,7 @@ export const settingsSeparators: DefSeparators = [
|
||||
|
||||
export const mainSeparators: DefSeparators = [
|
||||
{ minSize: 30, size: 'auto', maxSize: 'auto' },
|
||||
{ minSize: 20, size: 30, maxSize: 45, float: 'sidebar' }
|
||||
{ minSize: 20, size: 30, maxSize: 80, float: 'sidebar' }
|
||||
]
|
||||
|
||||
export const secondNavSeparators: DefSeparators = [{ minSize: 7, size: 7.5, maxSize: 15, float: 'navigator' }, null]
|
||||
|
@ -14,7 +14,7 @@
|
||||
-->
|
||||
|
||||
<script lang="ts">
|
||||
import { getClient, MessageViewer } from '@hcengineering/presentation'
|
||||
import { getClient, LiteMessageViewer } from '@hcengineering/presentation'
|
||||
import { Person, type PersonAccount } from '@hcengineering/contact'
|
||||
import {
|
||||
Avatar,
|
||||
@ -150,7 +150,7 @@
|
||||
<Label label={intlLabel} />
|
||||
{/if}
|
||||
{#if text}
|
||||
<MessageViewer message={text} preview />
|
||||
<LiteMessageViewer message={text} />
|
||||
{/if}
|
||||
</span>
|
||||
{/if}
|
||||
|
@ -289,6 +289,7 @@
|
||||
border: 1px solid transparent;
|
||||
border-radius: 0.25rem;
|
||||
width: 100%;
|
||||
user-select: text;
|
||||
|
||||
&.clickable {
|
||||
cursor: pointer;
|
||||
|
@ -95,10 +95,12 @@
|
||||
}
|
||||
|
||||
let objectChatPanel: ObjectChatPanel | undefined
|
||||
let prevObjectId: Ref<Doc> | undefined = undefined
|
||||
|
||||
$: if (object._id) {
|
||||
$: if (prevObjectId !== object._id) {
|
||||
prevObjectId = object._id
|
||||
objectChatPanel = hierarchy.classHierarchyMixin(object._class, chunter.mixin.ObjectChatPanel)
|
||||
isAsideShown = objectChatPanel?.openByDefault === true
|
||||
isAsideShown = isAsideShown ?? objectChatPanel?.openByDefault === true
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -354,6 +354,8 @@
|
||||
|
||||
.notification {
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
|
||||
.embeddedMarker {
|
||||
position: absolute;
|
||||
|
Loading…
Reference in New Issue
Block a user