Removable shared messages (#2559)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
Denis Bykhov 2023-01-30 00:03:00 +06:00 committed by GitHub
parent 017e1cc1d7
commit 3ba2958b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 69 deletions

View File

@ -157,7 +157,9 @@ export function createModel (builder: Builder): void {
txClass: core.class.TxCreateDoc,
component: gmail.activity.TxSharedCreate,
label: gmail.string.SharedMessages,
display: 'content'
display: 'content',
editable: true,
hideOnRemove: true
},
gmail.ids.TxSharedCreate
)

View File

@ -123,7 +123,9 @@ export function createModel (builder: Builder): void {
txClass: core.class.TxCreateDoc,
component: telegram.activity.TxSharedCreate,
label: telegram.string.SharedMessages,
display: 'content'
display: 'content',
editable: true,
hideOnRemove: true
},
telegram.ids.TxSharedCreate
)

View File

@ -121,28 +121,26 @@
}
</script>
{#if enabled}
<div class="popupPanel-body__main-header bottom-divider p-2">
<div class="popupPanel-body__main-header bottom-divider p-2">
<div class="flex-between">
{#if selectable}
<div class="flex-between">
<span><b>{selected.size}</b> <Label label={gmail.string.MessagesSelected} /></span>
<div class="flex">
<div>
<Button label={gmail.string.Cancel} size={'small'} on:click={clear} />
</div>
<div class="ml-3">
<Button
label={gmail.string.PublishSelected}
size={'small'}
kind={'primary'}
disabled={!selected.size}
on:click={share}
/>
</div>
<span><b>{selected.size}</b> <Label label={gmail.string.MessagesSelected} /></span>
<div class="flex">
<div>
<Button label={gmail.string.Cancel} size={'small'} on:click={clear} />
</div>
<div class="ml-3">
<Button
label={gmail.string.PublishSelected}
size={'small'}
kind={'primary'}
disabled={!selected.size}
on:click={share}
/>
</div>
</div>
{:else}
<div class="flex-between">
{#if enabled}
<Button
label={gmail.string.CreateMessage}
size={'small'}
@ -151,18 +149,18 @@
newMessage = true
}}
/>
<Button
icon={IconShare}
kind={'transparent'}
showTooltip={{ label: gmail.string.ShareMessages }}
on:click={async () => {
selectable = !selectable
}}
/>
</div>
{/if}
<Button
icon={IconShare}
kind={'transparent'}
showTooltip={{ label: gmail.string.ShareMessages }}
on:click={async () => {
selectable = !selectable
}}
/>
{/if}
</div>
{/if}
</div>
<Scroller>
<div class="popupPanel-body__main-content py-4 clear-mins flex-no-shrink">
{#if messages && messages.length > 0}

View File

@ -224,17 +224,16 @@
showPopup(Reconnect, {}, eventToHTMLElement(e), onReconnect)
}}
/>
{:else}
<Button
icon={IconShare}
kind={'transparent'}
size={'medium'}
showTooltip={{ label: telegram.string.Share }}
on:click={async () => {
selectable = !selectable
}}
/>
{/if}
<Button
icon={IconShare}
kind={'transparent'}
size={'medium'}
showTooltip={{ label: telegram.string.Share }}
on:click={async () => {
selectable = !selectable
}}
/>
</svelte:fragment>
<Scroller bottomStart autoscroll>
@ -243,36 +242,34 @@
{/if}
</Scroller>
{#if integration !== undefined && !integration.disabled}
<div class="popupPanel-body__main-header ref-input" class:selectable>
{#if selectable}
<div class="flex-between">
<span>{selected.size} messages selected</span>
<div class="flex">
<div>
<Button label={telegram.string.Cancel} size={'medium'} on:click={clear} />
</div>
<div class="ml-3">
<Button
label={telegram.string.PublishSelected}
size={'medium'}
kind={'primary'}
disabled={!selected.size}
on:click={share}
/>
</div>
<div class="popupPanel-body__main-header ref-input" class:selectable>
{#if selectable}
<div class="flex-between">
<span>{selected.size} messages selected</span>
<div class="flex">
<div>
<Button label={telegram.string.Cancel} size={'medium'} on:click={clear} />
</div>
<div class="ml-3">
<Button
label={telegram.string.PublishSelected}
size={'medium'}
kind={'primary'}
disabled={!selected.size}
on:click={share}
/>
</div>
</div>
{:else}
<AttachmentRefInput
space={telegram.space.Telegram}
_class={telegram.class.NewMessage}
{objectId}
on:message={onMessage}
/>
{/if}
</div>
{/if}
</div>
{:else if integration !== undefined && !integration.disabled}
<AttachmentRefInput
space={telegram.space.Telegram}
_class={telegram.class.NewMessage}
{objectId}
on:message={onMessage}
/>
{/if}
</div>
</Panel>
{/if}
@ -281,7 +278,7 @@
padding: 0.5rem 0 1.5rem;
&.selectable {
padding: 1rem 0;
padding: 1rem;
color: var(--theme-caption-color);
border-top: 1px solid var(--divider-color);
}