Feat: Remove SpeckleCon banner/workspace explainer code (#5071)
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
<template>
|
||||
<CommonCard class="relative !px-3 !py-2.5 bg-foundation shadow-sm">
|
||||
<FormButton
|
||||
class="absolute top-1 right-1"
|
||||
size="sm"
|
||||
color="subtle"
|
||||
:icon-right="XMarkIcon"
|
||||
hide-text
|
||||
@click="dismissSpeckleConBanner"
|
||||
>
|
||||
<span class="sr-only">Close</span>
|
||||
</FormButton>
|
||||
<div class="flex flex-col gap-y-2 text-foreground">
|
||||
<span class="text-[10px] font-mono uppercase tracking-widest">
|
||||
Upcoming event
|
||||
</span>
|
||||
<h3 class="text-body-xs font-semibold leading-tight tracking-tight">
|
||||
SpeckleCON:
|
||||
<br />
|
||||
Too useful to ignore
|
||||
</h3>
|
||||
<p class="text-body-3xs leading-tight">
|
||||
Join us! 7 Nov, 2025
|
||||
<br />
|
||||
London, UK
|
||||
</p>
|
||||
<NuxtLink
|
||||
to="https://conf.speckle.systems/"
|
||||
target="_blank"
|
||||
external
|
||||
class="flex gap-1 items-center border-b border-transparent hover:border-highlight-3 max-w-max -mb-0.5"
|
||||
@click="onCTAClick"
|
||||
>
|
||||
<span class="text-body-3xs font-semibold">Learn more</span>
|
||||
<ArrowUpRightIcon class="h-2 w-2 mt-px stroke-2 stroke-foreground" />
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</CommonCard>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ArrowUpRightIcon, XMarkIcon } from '@heroicons/vue/24/solid'
|
||||
import { useMixpanel } from '~~/lib/core/composables/mp'
|
||||
import { useActiveUserMeta } from '~~/lib/user/composables/meta'
|
||||
|
||||
const mixpanel = useMixpanel()
|
||||
const { updateSpeckleConBannerDismissed } = useActiveUserMeta()
|
||||
|
||||
const onCTAClick = () => {
|
||||
mixpanel.track('SpeckleCON CTA Clicked', {
|
||||
location: 'sidebar'
|
||||
})
|
||||
}
|
||||
|
||||
const dismissSpeckleConBanner = async () => {
|
||||
await updateSpeckleConBannerDismissed(true)
|
||||
}
|
||||
</script>
|
||||
@@ -140,9 +140,6 @@
|
||||
</LayoutSidebarMenuGroup>
|
||||
</div>
|
||||
</LayoutSidebarMenu>
|
||||
<template v-if="showSpeckleConPromo" #promo>
|
||||
<DashboardPromo />
|
||||
</template>
|
||||
</LayoutSidebar>
|
||||
</div>
|
||||
</template>
|
||||
@@ -167,8 +164,6 @@ import { useRoute } from 'vue-router'
|
||||
import { useActiveUser } from '~~/lib/auth/composables/activeUser'
|
||||
import { useNavigation } from '~~/lib/navigation/composables/navigation'
|
||||
import { useMixpanel } from '~~/lib/core/composables/mp'
|
||||
import dayjs from 'dayjs'
|
||||
import { useActiveUserMeta } from '~/lib/user/composables/meta'
|
||||
|
||||
const { isLoggedIn } = useActiveUser()
|
||||
const isWorkspacesEnabled = useIsWorkspacesEnabled()
|
||||
@@ -176,7 +171,6 @@ const route = useRoute()
|
||||
const { activeWorkspaceSlug, isProjectsActive } = useNavigation()
|
||||
const { $intercom } = useNuxtApp()
|
||||
const mixpanel = useMixpanel()
|
||||
const { hasDismissedSpeckleConBanner } = useActiveUserMeta()
|
||||
|
||||
const isOpenMobile = ref(false)
|
||||
const showExplainerVideoDialog = ref(false)
|
||||
@@ -195,11 +189,6 @@ const showSidebar = computed(() => {
|
||||
: isLoggedIn.value
|
||||
})
|
||||
|
||||
const showSpeckleConPromo = computed(() => {
|
||||
if (hasDismissedSpeckleConBanner.value) return false
|
||||
return dayjs('2025-11-08').isAfter(dayjs())
|
||||
})
|
||||
|
||||
const openChat = () => {
|
||||
$intercom.show()
|
||||
isOpenMobile.value = false
|
||||
|
||||
@@ -364,10 +364,8 @@ type Documents = {
|
||||
"\n fragment AppAuthorAvatar on AppAuthor {\n id\n name\n avatar\n }\n": typeof types.AppAuthorAvatarFragmentDoc,
|
||||
"\n fragment LimitedUserAvatar on LimitedUser {\n id\n name\n avatar\n }\n": typeof types.LimitedUserAvatarFragmentDoc,
|
||||
"\n fragment ActiveUserAvatar on User {\n id\n name\n avatar\n }\n": typeof types.ActiveUserAvatarFragmentDoc,
|
||||
"\n query ActiveUserMeta {\n activeUser {\n meta {\n newWorkspaceExplainerDismissed\n legacyProjectsExplainerCollapsed\n speckleConBannerDismissed\n }\n }\n }\n": typeof types.ActiveUserMetaDocument,
|
||||
"\n mutation UpdateWorkspaceExplainer($value: Boolean!) {\n activeUserMutations {\n meta {\n setNewWorkspaceExplainerDismissed(value: $value)\n }\n }\n }\n": typeof types.UpdateWorkspaceExplainerDocument,
|
||||
"\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n }\n }\n }\n": typeof types.ActiveUserMetaDocument,
|
||||
"\n mutation UpdateLegacyProjectsExplainer($value: Boolean!) {\n activeUserMutations {\n meta {\n setLegacyProjectsExplainerCollapsed(value: $value)\n }\n }\n }\n": typeof types.UpdateLegacyProjectsExplainerDocument,
|
||||
"\n mutation UpdateSpeckleConBannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setSpeckleConBannerDismissed(value: $value)\n }\n }\n }\n": typeof types.UpdateSpeckleConBannerDismissedDocument,
|
||||
"\n subscription OnUserProjectsUpdate {\n userProjectsUpdated {\n type\n id\n project {\n ...ProjectDashboardItem\n workspaceId\n }\n }\n }\n ": typeof types.OnUserProjectsUpdateDocument,
|
||||
"\n mutation UpdateUser($input: UserUpdateInput!) {\n activeUserMutations {\n update(user: $input) {\n id\n name\n bio\n company\n avatar\n }\n }\n }\n": typeof types.UpdateUserDocument,
|
||||
"\n mutation UpdateNotificationPreferences($input: JSONObject!) {\n userNotificationPreferencesUpdate(preferences: $input)\n }\n": typeof types.UpdateNotificationPreferencesDocument,
|
||||
@@ -824,10 +822,8 @@ const documents: Documents = {
|
||||
"\n fragment AppAuthorAvatar on AppAuthor {\n id\n name\n avatar\n }\n": types.AppAuthorAvatarFragmentDoc,
|
||||
"\n fragment LimitedUserAvatar on LimitedUser {\n id\n name\n avatar\n }\n": types.LimitedUserAvatarFragmentDoc,
|
||||
"\n fragment ActiveUserAvatar on User {\n id\n name\n avatar\n }\n": types.ActiveUserAvatarFragmentDoc,
|
||||
"\n query ActiveUserMeta {\n activeUser {\n meta {\n newWorkspaceExplainerDismissed\n legacyProjectsExplainerCollapsed\n speckleConBannerDismissed\n }\n }\n }\n": types.ActiveUserMetaDocument,
|
||||
"\n mutation UpdateWorkspaceExplainer($value: Boolean!) {\n activeUserMutations {\n meta {\n setNewWorkspaceExplainerDismissed(value: $value)\n }\n }\n }\n": types.UpdateWorkspaceExplainerDocument,
|
||||
"\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n }\n }\n }\n": types.ActiveUserMetaDocument,
|
||||
"\n mutation UpdateLegacyProjectsExplainer($value: Boolean!) {\n activeUserMutations {\n meta {\n setLegacyProjectsExplainerCollapsed(value: $value)\n }\n }\n }\n": types.UpdateLegacyProjectsExplainerDocument,
|
||||
"\n mutation UpdateSpeckleConBannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setSpeckleConBannerDismissed(value: $value)\n }\n }\n }\n": types.UpdateSpeckleConBannerDismissedDocument,
|
||||
"\n subscription OnUserProjectsUpdate {\n userProjectsUpdated {\n type\n id\n project {\n ...ProjectDashboardItem\n workspaceId\n }\n }\n }\n ": types.OnUserProjectsUpdateDocument,
|
||||
"\n mutation UpdateUser($input: UserUpdateInput!) {\n activeUserMutations {\n update(user: $input) {\n id\n name\n bio\n company\n avatar\n }\n }\n }\n": types.UpdateUserDocument,
|
||||
"\n mutation UpdateNotificationPreferences($input: JSONObject!) {\n userNotificationPreferencesUpdate(preferences: $input)\n }\n": types.UpdateNotificationPreferencesDocument,
|
||||
@@ -2351,19 +2347,11 @@ export function graphql(source: "\n fragment ActiveUserAvatar on User {\n id
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n query ActiveUserMeta {\n activeUser {\n meta {\n newWorkspaceExplainerDismissed\n legacyProjectsExplainerCollapsed\n speckleConBannerDismissed\n }\n }\n }\n"): (typeof documents)["\n query ActiveUserMeta {\n activeUser {\n meta {\n newWorkspaceExplainerDismissed\n legacyProjectsExplainerCollapsed\n speckleConBannerDismissed\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n mutation UpdateWorkspaceExplainer($value: Boolean!) {\n activeUserMutations {\n meta {\n setNewWorkspaceExplainerDismissed(value: $value)\n }\n }\n }\n"): (typeof documents)["\n mutation UpdateWorkspaceExplainer($value: Boolean!) {\n activeUserMutations {\n meta {\n setNewWorkspaceExplainerDismissed(value: $value)\n }\n }\n }\n"];
|
||||
export function graphql(source: "\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n }\n }\n }\n"): (typeof documents)["\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n mutation UpdateLegacyProjectsExplainer($value: Boolean!) {\n activeUserMutations {\n meta {\n setLegacyProjectsExplainerCollapsed(value: $value)\n }\n }\n }\n"): (typeof documents)["\n mutation UpdateLegacyProjectsExplainer($value: Boolean!) {\n activeUserMutations {\n meta {\n setLegacyProjectsExplainerCollapsed(value: $value)\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
export function graphql(source: "\n mutation UpdateSpeckleConBannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setSpeckleConBannerDismissed(value: $value)\n }\n }\n }\n"): (typeof documents)["\n mutation UpdateSpeckleConBannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setSpeckleConBannerDismissed(value: $value)\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -5,19 +5,7 @@ export const activeUserMetaQuery = graphql(`
|
||||
query ActiveUserMeta {
|
||||
activeUser {
|
||||
meta {
|
||||
newWorkspaceExplainerDismissed
|
||||
legacyProjectsExplainerCollapsed
|
||||
speckleConBannerDismissed
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
export const updateWorkspaceExplainerMutation = graphql(`
|
||||
mutation UpdateWorkspaceExplainer($value: Boolean!) {
|
||||
activeUserMutations {
|
||||
meta {
|
||||
setNewWorkspaceExplainerDismissed(value: $value)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,27 +21,11 @@ export const updateLegacyProjectsExplainerMutation = graphql(`
|
||||
}
|
||||
`)
|
||||
|
||||
export const updateSpeckleConBannerDismissedMutation = graphql(`
|
||||
mutation UpdateSpeckleConBannerDismissed($value: Boolean!) {
|
||||
activeUserMutations {
|
||||
meta {
|
||||
setSpeckleConBannerDismissed(value: $value)
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
export function useActiveUserMeta() {
|
||||
const { result } = useQuery(activeUserMetaQuery)
|
||||
const { mutate: updateWorkspaceExplainer } = useMutation(
|
||||
updateWorkspaceExplainerMutation
|
||||
)
|
||||
const { mutate: updateLegacyProjectsExplainer } = useMutation(
|
||||
updateLegacyProjectsExplainerMutation
|
||||
)
|
||||
const { mutate: updateSpeckleConBanner } = useMutation(
|
||||
updateSpeckleConBannerDismissedMutation
|
||||
)
|
||||
const apollo = useApolloClient().client
|
||||
const cache = apollo.cache
|
||||
const { activeUser } = useActiveUser()
|
||||
@@ -61,32 +33,10 @@ export function useActiveUserMeta() {
|
||||
const activeUserId = computed(() => activeUser.value?.id ?? '')
|
||||
const meta = computed(() => result.value?.activeUser?.meta)
|
||||
|
||||
const hasDismissedNewWorkspaceExplainer = computed(
|
||||
() => meta.value?.newWorkspaceExplainerDismissed ?? true
|
||||
)
|
||||
|
||||
const hasCollapsedLegacyProjectsExplainer = computed(
|
||||
() => meta.value?.legacyProjectsExplainerCollapsed
|
||||
)
|
||||
|
||||
const hasDismissedSpeckleConBanner = computed(
|
||||
() => meta.value?.speckleConBannerDismissed ?? false
|
||||
)
|
||||
|
||||
const updateNewWorkspaceExplainerDismissed = async (value: boolean) => {
|
||||
await updateWorkspaceExplainer({ value })
|
||||
|
||||
modifyObjectField(
|
||||
cache,
|
||||
getCacheId('User', activeUserId.value),
|
||||
'meta',
|
||||
({ helpers: { createUpdatedValue } }) =>
|
||||
createUpdatedValue(({ update }) => {
|
||||
update('newWorkspaceExplainerDismissed', () => value)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
const updateLegacyProjectsExplainerCollapsed = async (value: boolean) => {
|
||||
await updateLegacyProjectsExplainer({ value })
|
||||
|
||||
@@ -101,26 +51,8 @@ export function useActiveUserMeta() {
|
||||
)
|
||||
}
|
||||
|
||||
const updateSpeckleConBannerDismissed = async (value: boolean) => {
|
||||
await updateSpeckleConBanner({ value })
|
||||
|
||||
modifyObjectField(
|
||||
cache,
|
||||
getCacheId('User', activeUserId.value),
|
||||
'meta',
|
||||
({ helpers: { createUpdatedValue } }) =>
|
||||
createUpdatedValue(({ update }) => {
|
||||
update('speckleConBannerDismissed', () => value)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
return {
|
||||
hasDismissedNewWorkspaceExplainer,
|
||||
hasCollapsedLegacyProjectsExplainer,
|
||||
hasDismissedSpeckleConBanner,
|
||||
updateNewWorkspaceExplainerDismissed,
|
||||
updateLegacyProjectsExplainerCollapsed,
|
||||
updateSpeckleConBannerDismissed
|
||||
updateLegacyProjectsExplainerCollapsed
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user