Skip to content
This repository was archived by the owner on Apr 19, 2023. It is now read-only.

Commit 52857d3

Browse files
✨ Don't show settings to basic members
1 parent db45e74 commit 52857d3

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

components/Navbar.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
>
1515
<nuxt-link v-else class="item" to="/dashboard">Dashboard</nuxt-link>
1616
<nuxt-link
17-
v-if="activeOrganization && activeOrganization !== 'undefined'"
17+
v-if="
18+
activeOrganization &&
19+
activeOrganization !== 'undefined' &&
20+
loggedInMembership !== 4
21+
"
1822
class="item"
1923
:to="`/manage/${activeOrganization}/settings`"
2024
>Settings</nuxt-link
@@ -204,12 +208,16 @@ export default class Card extends Vue {
204208
notificationCount = 0;
205209
showNav = false;
206210
activeOrganization: string | null = null;
211+
loggedInMembership = 3;
207212
@Watch("$route")
208213
private onRouteChanged() {
209214
this.updateNavBar();
210215
}
211216
private updateNavBar() {
212217
this.showNav = false;
218+
this.loggedInMembership = parseInt(
219+
this.$store.getters["manage/loggedInMembership"](this.$route.params.team)
220+
);
213221
if (this.$route.path.startsWith("/onboarding")) {
214222
this.isVisible = false;
215223
} else {
@@ -232,6 +240,9 @@ export default class Card extends Vue {
232240
this.updateNavBar();
233241
}
234242
private created() {
243+
this.loggedInMembership = parseInt(
244+
this.$store.getters["manage/loggedInMembership"](this.$route.params.team)
245+
);
235246
if (typeof document !== "undefined" && document.body)
236247
document.body.addEventListener("click", event => {
237248
const path = event.composedPath();

pages/manage/_team/settings.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
Update settings
5353
</button>
5454
</form>
55-
<Domains style="margin-top: 2rem" />
55+
<Domains v-if="loggedInMembership !== 4" style="margin-top: 2rem" />
5656
</main>
5757
</template>
5858

@@ -92,11 +92,15 @@ library.add(faSync);
9292
export default class ManageSettings extends Vue {
9393
loading = "";
9494
organization: Organization = emptyOrganization;
95+
loggedInMembership = 3;
9596
9697
private created() {
9798
this.organization = {
9899
...this.$store.getters["manage/organization"](this.$route.params.team)
99100
};
101+
this.loggedInMembership = parseInt(
102+
this.$store.getters["manage/loggedInMembership"](this.$route.params.team)
103+
);
100104
}
101105
102106
private load() {

0 commit comments

Comments
 (0)