Skip to content

Commit

Permalink
chore(constants): Remove deprecated Type and implement ShareType
Browse files Browse the repository at this point in the history
Signed-off-by: Grigory V <scratchx@gmx.com>
  • Loading branch information
GVodyanov authored and hamza221 committed Sep 18, 2024
1 parent 5fa95be commit c2e8eea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/models/constants.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { Type } from '@nextcloud/sharing';
import { ShareType } from '@nextcloud/sharing';
export type DefaultGroup = string;
export type DefaultChart = string;
export type CircleConfig = number;
Expand Down Expand Up @@ -32,7 +32,7 @@ export declare const PUBLIC_CIRCLE_CONFIG: {
export declare const CIRCLES_MEMBER_GROUPING: {
id: string;
label: string;
share: Type;
share: ShareType;
type: number;
}[];
export declare const SHARES_TYPES_MEMBER_MAP: {};
Expand Down
28 changes: 14 additions & 14 deletions src/models/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// <reference types="@nextcloud/typings" />

import { translate as t } from '@nextcloud/l10n'
import { Type } from '@nextcloud/sharing'
import { ShareType } from '@nextcloud/sharing'

export type DefaultGroup = string
export type DefaultChart = string
Expand Down Expand Up @@ -115,47 +115,47 @@ export const PUBLIC_CIRCLE_CONFIG = {
// sorting of the members list
export const CIRCLES_MEMBER_GROUPING = [
{
id: `picker-${Type.SHARE_TYPE_USER}`,
id: `picker-${ShareType.User}`,
label: t('contacts', 'users'),
share: Type.SHARE_TYPE_USER,
share: ShareType.User,
type: MEMBER_TYPE_USER,
},
{
id: `picker-${Type.SHARE_TYPE_GROUP}`,
id: `picker-${ShareType.Group}`,
label: t('contacts', 'groups'),
share: Type.SHARE_TYPE_GROUP,
share: ShareType.Group,
type: MEMBER_TYPE_GROUP,
},
// TODO: implement federated
// {
// id: `picker-${Type.SHARE_TYPE_REMOTE}`,
// id: `picker-${ShareType.Remote}`,
// label: t('contacts', 'federated users'),
// share: Type.SHARE_TYPE_REMOTE,
// share: ShareType.Remote,
// type: MEMBER_TYPE_USER
// },
// {
// id: `picker-${Type.SHARE_TYPE_REMOTE_GROUP}`,
// id: `picker-${ShareType.RemoteGroup}`,
// label: t('contacts', 'federated groups'),
// share: Type.SHARE_TYPE_REMOTE_GROUP,
// share: ShareType.RemoteGroup,
// type: MEMBER_TYPE_GROUP
// },
{
id: `picker-${Type.SHARE_TYPE_CIRCLE}`,
id: `picker-${ShareType.Team}`,
label: t('contacts', 'teams'),
share: Type.SHARE_TYPE_CIRCLE,
share: ShareType.Team,
type: MEMBER_TYPE_CIRCLE,
},
{
id: `picker-${Type.SHARE_TYPE_EMAIL}`,
id: `picker-${ShareType.Email}`,
label: t('contacts', 'email addresses'),
share: Type.SHARE_TYPE_EMAIL,
share: ShareType.Email,
type: MEMBER_TYPE_MAIL,
},
// TODO: implement SHARE_TYPE_CONTACT
{
id: 'picker-contact',
label: t('contacts', 'teams'),
share: Type.SHARE_TYPE_EMAIL,
share: ShareType.Email,
type: MEMBER_TYPE_CONTACT,
},
]
Expand Down

0 comments on commit c2e8eea

Please sign in to comment.