summaryrefslogtreecommitdiffstats
path: root/src/models/constants.ts
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-08-18 11:31:01 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-08-18 11:51:33 +0200
commit4d112fdb83abc07a3ff905dcf012aa09ef704daa (patch)
tree8b2afc90dafb5606649c3a55f2454423a31f8681 /src/models/constants.ts
parent1e89b3b22086b63499fe5403e9e083d741398249 (diff)
Use sharing constants from a package, not another app
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'src/models/constants.ts')
-rw-r--r--src/models/constants.ts36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/models/constants.ts b/src/models/constants.ts
index 856d8209..68e473f4 100644
--- a/src/models/constants.ts
+++ b/src/models/constants.ts
@@ -22,11 +22,7 @@
/// <reference types="@nextcloud/typings" />
import { translate as t } from '@nextcloud/l10n'
-
-interface OC extends Nextcloud.Common.OC {
- Share: any
-}
-declare const OC: OC
+import { Type } from '@nextcloud/sharing'
export type DefaultGroup = string
export type CircleConfig = number
@@ -121,56 +117,56 @@ export const PUBLIC_CIRCLE_CONFIG = {
}
-// Represents the picker options but also the
+// Represents the picker options but also the
// sorting of the members list
export const CIRCLES_MEMBER_GROUPING = [
{
- id: `picker-${OC.Share.SHARE_TYPE_USER}`,
+ id: `picker-${Type.SHARE_TYPE_USER}`,
label: t('contacts', 'Users'),
- share: OC.Share.SHARE_TYPE_USER,
+ share: Type.SHARE_TYPE_USER,
type: MEMBER_TYPE_USER
},
{
- id: `picker-${OC.Share.SHARE_TYPE_GROUP}`,
+ id: `picker-${Type.SHARE_TYPE_GROUP}`,
label: t('contacts', 'Groups'),
- share: OC.Share.SHARE_TYPE_GROUP,
+ share: Type.SHARE_TYPE_GROUP,
type: MEMBER_TYPE_GROUP
},
// TODO: implement federated
// {
- // id: `picker-${OC.Share.SHARE_TYPE_REMOTE}`,
+ // id: `picker-${Type.SHARE_TYPE_REMOTE}`,
// label: t('contacts', 'Federated users'),
- // share: OC.Share.SHARE_TYPE_REMOTE,
+ // share: Type.SHARE_TYPE_REMOTE,
// type: MEMBER_TYPE_USER
// },
// {
- // id: `picker-${OC.Share.SHARE_TYPE_REMOTE_GROUP}`,
+ // id: `picker-${Type.SHARE_TYPE_REMOTE_GROUP}`,
// label: t('contacts', 'Federated groups'),
- // share: OC.Share.SHARE_TYPE_REMOTE_GROUP,
+ // share: Type.SHARE_TYPE_REMOTE_GROUP,
// type: MEMBER_TYPE_GROUP
// },
{
- id: `picker-${OC.Share.SHARE_TYPE_CIRCLE}`,
+ id: `picker-${Type.SHARE_TYPE_CIRCLE}`,
label: t('contacts', 'Circles'),
- share: OC.Share.SHARE_TYPE_CIRCLE,
+ share: Type.SHARE_TYPE_CIRCLE,
type: MEMBER_TYPE_CIRCLE
},
{
- id: `picker-${OC.Share.SHARE_TYPE_EMAIL}`,
+ id: `picker-${Type.SHARE_TYPE_EMAIL}`,
label: t('contacts', 'Emails'),
- share: OC.Share.SHARE_TYPE_EMAIL,
+ share: Type.SHARE_TYPE_EMAIL,
type: MEMBER_TYPE_MAIL
},
// TODO: implement SHARE_TYPE_CONTACT
{
id: `picker-contact`,
label: t('contacts', 'Contacts'),
- share: OC.Share.SHARE_TYPE_EMAIL,
+ share: Type.SHARE_TYPE_EMAIL,
type: MEMBER_TYPE_CONTACT
},
]
-// Generating a map between share types and circle member types
+// Generating a map between share types and circle member types
export const SHARES_TYPES_MEMBER_MAP = CIRCLES_MEMBER_GROUPING.reduce((list, entry) => {
// ! Ignore duplicate share types
if (!list[entry.share]) {