summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-07-06 15:45:14 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-07-06 15:45:14 +0200
commit19e2539e1d1e2aef2973820314033f41331e7e51 (patch)
treea8d3a21fb0c36c31424359c21801aaa46e3990ed
parent92164231cfaaee2f4d0dce182ff567840f5ab696 (diff)
Hide configs if personal
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-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,