Remove Reminders button from workspace. (#3319)

This commit is contained in:
Denis Bykhov 2023-06-01 22:35:21 +06:00 committed by GitHub
parent 92f465392d
commit 00e160ad86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 69 deletions

View File

@ -1,54 +0,0 @@
<!--
// Copyright © 2022 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 { EmployeeAccount } from '@hcengineering/contact'
import { getCurrentAccount } from '@hcengineering/core'
import { Table } from '@hcengineering/view-resources'
import { createQuery } from '@hcengineering/presentation'
import { Label, Scroller, deviceOptionsStore as deviceInfo } from '@hcengineering/ui'
import calendar from '../plugin'
const currentUser = getCurrentAccount() as EmployeeAccount
let remindersCount: number = 0
const query = createQuery()
$: query.query(calendar.mixin.Reminder, { state: 'active', participants: currentUser.employee }, (res) => {
remindersCount = res.length
})
$: isMobile = $deviceInfo.isMobile
</script>
<div class="notifyPopup" class:justify-center={!remindersCount} class:min-w-168={!isMobile}>
<div class="header">
<span class="fs-title overflow-label"><Label label={calendar.string.Reminders} /></span>
</div>
{#if remindersCount}
<Scroller>
<div class="px-4 clear-mins">
<Table
_class={calendar.mixin.Reminder}
config={['']}
options={{}}
query={{ state: 'active', participants: currentUser.employee }}
hiddenHeader
/>
</div>
</Scroller>
{:else}
<div class="flex-grow flex-center">
<Label label={calendar.string.NoReminders} />
</div>
{/if}
</div>

View File

@ -25,7 +25,6 @@ import Events from './components/Events.svelte'
import ReminderPresenter from './components/ReminderPresenter.svelte'
import ReminderViewlet from './components/activity/ReminderViewlet.svelte'
import EditEvent from './components/EditEvent.svelte'
import RemindersPopup from './components/RemindersPopup.svelte'
import EventPresenter from './components/EventPresenter.svelte'
import CreateEvent from './components/CreateEvent.svelte'
@ -49,7 +48,6 @@ export default async (): Promise<Resources> => ({
Events,
DateTimePresenter,
DocReminder,
RemindersPopup,
EventPresenter,
CreateEvent
},

View File

@ -85,8 +85,7 @@ const calendarPlugin = plugin(calendarId, {
PersonsPresenter: '' as AnyComponent,
Events: '' as AnyComponent,
DateTimePresenter: '' as AnyComponent,
DocReminder: '' as AnyComponent,
RemindersPopup: '' as AnyComponent
DocReminder: '' as AnyComponent
},
string: {
Title: '' as IntlString,

View File

@ -13,15 +13,13 @@
// limitations under the License.
-->
<script lang="ts">
import calendar, { calendarId } from '@hcengineering/calendar'
import contact, { Employee, EmployeeAccount } from '@hcengineering/contact'
import core, { Class, Doc, Ref, Space, getCurrentAccount, setCurrentAccount } from '@hcengineering/core'
import login from '@hcengineering/login'
import notification, { notificationId } from '@hcengineering/notification'
import { BrowserNotificatator, NotificationClientImpl } from '@hcengineering/notification-resources'
import { IntlString, getMetadata, getResource } from '@hcengineering/platform'
import { ActionContext, configurationStore, createQuery, getClient } from '@hcengineering/presentation'
import { resolvedLocationStore } from '@hcengineering/ui'
import { ActionContext, createQuery, getClient } from '@hcengineering/presentation'
import {
AnyComponent,
CompAndProps,
@ -46,6 +44,7 @@
openPanel,
popupstore,
resizeObserver,
resolvedLocationStore,
setResolvedLocation,
showPopup
} from '@hcengineering/ui'
@ -604,14 +603,6 @@
notify={hasNotification}
/>
</NavLink>
{#if $configurationStore.has(calendarId)}
<div class="spacer" />
<AppItem
icon={calendar.icon.Notifications}
label={calendar.string.Reminders}
on:click={() => showPopup(calendar.component.RemindersPopup, {}, notifyPosition)}
/>
{/if}
<div class="divider" />
<Applications
apps={getApps(apps)}