Skip to content

Commit

Permalink
fix(fe2): Remove check for admin in workspace page create workspace b…
Browse files Browse the repository at this point in the history
…utton (#2852)

* Remove check for admin in workspace page

* Remove from promo banner

---------

Co-authored-by: Mike Tasset <[email protected]>
  • Loading branch information
andrewwallacespeckle and Mikehrn authored Sep 2, 2024
1 parent 8787a5c commit ba1331e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
6 changes: 1 addition & 5 deletions packages/frontend-2/components/workspaces/Promo/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
and better project management with your team. Get your workspace today!
</p>
<div class="flex mt-6 gap-2">
<FormButton :disabled="!isAdmin" color="outline" @click="$emit('create')">
<FormButton color="outline" @click="$emit('create')">
Create workspace
</FormButton>
<!-- <FormButton color="subtle">Learn more</FormButton> -->
Expand All @@ -41,10 +41,6 @@
</div>
</template>
<script setup lang="ts">
defineProps<{
isAdmin: boolean
}>()
defineEmits<{
(e: 'create'): void
}>()
Expand Down
10 changes: 2 additions & 8 deletions packages/frontend-2/components/workspaces/Promo/Page.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<template>
<div class="flex flex-col gap-12">
<WorkspacesPromoBanner :is-admin="isAdmin" @create="openWorkspaceCreateDialog" />
<WorkspacesPromoBanner @create="openWorkspaceCreateDialog" />

<section>
<div class="flex justify-between mb-2">
<h4 class="text-foreground-2 text-heading-sm">In a nutshell</h4>
<FormButton :disabled="!isAdmin" @click="openWorkspaceCreateDialog">
Create workspace
</FormButton>
<FormButton @click="openWorkspaceCreateDialog">Create workspace</FormButton>
</div>

<div class="mt-8 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
Expand Down Expand Up @@ -68,7 +66,6 @@
</template>
<script setup lang="ts">
import { useMixpanel } from '~~/lib/core/composables/mp'
import { Roles } from '@speckle/shared'
import {
UserGroupIcon,
LockClosedIcon,
Expand All @@ -79,11 +76,8 @@ import {
const showWorkspaceCreateDialog = ref(false)
const { activeUser: user } = useActiveUser()
const mixpanel = useMixpanel()
const isAdmin = computed(() => user.value?.role === Roles.Server.Admin)
const openWorkspaceCreateDialog = () => {
showWorkspaceCreateDialog.value = true
mixpanel.track('Create Workspace Button Clicked', {
Expand Down

0 comments on commit ba1331e

Please sign in to comment.