summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2021-07-06 16:15:16 +0200
committerGitHub <noreply@github.com>2021-07-06 16:15:16 +0200
commit5b8a8c49f7bf4691c90f09e7437492976f1d6aca (patch)
treed604ea4aab57b0878c9c03c2f0caaadf94c54a45
parent87984399e3b18ac699c21c56cc3ebc56110bfc63 (diff)
parent19e2539e1d1e2aef2973820314033f41331e7e51 (diff)
Merge pull request #2336 from nextcloud/fix/personal
Hide configs if personal
-rw-r--r--src/components/CircleDetails.vue2
-rw-r--r--src/models/circle.d.ts4
-rw-r--r--src/models/circle.ts7
-rw-r--r--src/models/constants.d.ts1
-rw-r--r--src/models/constants.ts2
5 files changed, 15 insertions, 1 deletions
diff --git a/src/components/CircleDetails.vue b/src/components/CircleDetails.vue
index 20552a86..d45208e1 100644
--- a/src/components/CircleDetails.vue
+++ b/src/components/CircleDetails.vue
@@ -91,7 +91,7 @@
@update:value="onDescriptionChangeDebounce" />
</section>
- <section v-if="circle.isOwner" class="circle-details-section">
+ <section v-if="circle.isOwner && !circle.isPersonal" class="circle-details-section">
<CircleConfigs class="circle-details-section__configs" :circle="circle" />
</section>
diff --git a/src/models/circle.d.ts b/src/models/circle.d.ts
index 25dc0536..8f991fe4 100644
--- a/src/models/circle.d.ts
+++ b/src/models/circle.d.ts
@@ -107,6 +107,10 @@ export default class Circle {
*/
set config(config: number);
/**
+ * Circle is personal
+ */
+ get isPersonal(): boolean;
+ /**
* Circle requires invite to be confirmed by moderator or above
*/
get requireJoinAccept(): boolean;
diff --git a/src/models/circle.ts b/src/models/circle.ts
index de08d191..6fbc569d 100644
--- a/src/models/circle.ts
+++ b/src/models/circle.ts
@@ -216,6 +216,13 @@ export default class Circle {
}
/**
+ * Circle is personal
+ */
+ get isPersonal() {
+ return (this._data.config & CircleConfigs.PERSONAL) !== 0
+ }
+
+ /**
* Circle requires invite to be confirmed by moderator or above
*/
get requireJoinAccept() {
diff --git a/src/models/constants.d.ts b/src/models/constants.d.ts
index 172623bb..e9532cf2 100644
--- a/src/models/constants.d.ts
+++ b/src/models/constants.d.ts
@@ -63,6 +63,7 @@ export declare enum MemberTypes {
CONTACT
}
export declare enum CircleConfigs {
+ PERSONAL,
SYSTEM,
VISIBLE,
OPEN,
diff --git a/src/models/constants.ts b/src/models/constants.ts
index 67b0e7ee..856d8209 100644
--- a/src/models/constants.ts
+++ b/src/models/constants.ts
@@ -65,6 +65,7 @@ const MEMBER_TYPE_CIRCLE: MemberType = 16
export const CIRCLE_DESC = t('contacts', 'Circles allow you to create groups with other users on a Nextcloud instance and share with them.')
// Circles config flags
+const CIRCLE_CONFIG_PERSONAL: CircleConfig = 2 // Personal circle, only the owner can see it.
const CIRCLE_CONFIG_SYSTEM: CircleConfig = 4 // System Circle (not managed by the official front-end). Meaning some config are limited
const CIRCLE_CONFIG_VISIBLE: CircleConfig = 8 // Visible to everyone, if not visible, people have to know its name to be able to find it
const CIRCLE_CONFIG_OPEN: CircleConfig = 16 // Circle is open, people can join
@@ -195,6 +196,7 @@ export enum MemberTypes {
}
export enum CircleConfigs {
+ PERSONAL = CIRCLE_CONFIG_PERSONAL,
SYSTEM = CIRCLE_CONFIG_SYSTEM,
VISIBLE = CIRCLE_CONFIG_VISIBLE,
OPEN = CIRCLE_CONFIG_OPEN,