Feat: Add SpeckleCon promo banner (#5569)
This commit is contained in:
@@ -157,8 +157,8 @@
|
||||
</LayoutSidebarMenuGroup>
|
||||
</div>
|
||||
</LayoutSidebarMenu>
|
||||
<template v-if="showIntelligenceCommunityStandUpPromo" #promo>
|
||||
<DashboardIntelligencePromo />
|
||||
<template v-if="showSpeckleCon25Promo" #promo>
|
||||
<DashboardSpeckleConPromo />
|
||||
</template>
|
||||
</LayoutSidebar>
|
||||
</div>
|
||||
@@ -234,14 +234,14 @@ const { result: permissionsResult } = useQuery(
|
||||
const { result } = useQuery(dashboardSidebarQuery, () => ({}), {
|
||||
enabled: isWorkspacesEnabled.value
|
||||
})
|
||||
const { hasDismissedIntelligenceCommunityStandUpBanner } = useActiveUserMeta()
|
||||
const { hasDismissedSpeckleCon25Banner } = useActiveUserMeta()
|
||||
|
||||
const isOpenMobile = ref(false)
|
||||
const showExplainerVideoDialog = ref(false)
|
||||
|
||||
const showIntelligenceCommunityStandUpPromo = computed(() => {
|
||||
if (hasDismissedIntelligenceCommunityStandUpBanner.value) return false
|
||||
return dayjs().isBefore('2025-09-10', 'day')
|
||||
const showSpeckleCon25Promo = computed(() => {
|
||||
if (hasDismissedSpeckleCon25Banner.value) return false
|
||||
return dayjs().isBefore('2025-11-07', 'day')
|
||||
})
|
||||
const activeWorkspace = computed(() => result.value?.activeUser?.activeWorkspace)
|
||||
const canListDashboards = computed(() => {
|
||||
|
||||
+9
-19
@@ -15,24 +15,19 @@
|
||||
Upcoming event
|
||||
</span>
|
||||
<h3 class="text-body-xs font-semibold leading-tight tracking-tight">
|
||||
Speckle Intelligence Live
|
||||
See how the best do it
|
||||
</h3>
|
||||
<p v-if="dateIsSetp9" class="text-body-3xs leading-tight">
|
||||
Community StandUp happening tomorrow!
|
||||
</p>
|
||||
<p v-else class="text-body-3xs leading-tight">
|
||||
Tune into our Community
|
||||
<br />
|
||||
StandUp - Sept 10.
|
||||
<p class="text-body-3xs leading-tight">
|
||||
Join global AEC leaders at SpeckleCon in London, Nov 7th.
|
||||
</p>
|
||||
<NuxtLink
|
||||
to="https://streamyard.com/watch/RhTZBgkzRcRe"
|
||||
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">Register</span>
|
||||
<span class="text-body-3xs font-semibold">Get tickets</span>
|
||||
<ArrowUpRightIcon class="h-2 w-2 mt-px stroke-2 stroke-foreground" />
|
||||
</NuxtLink>
|
||||
</div>
|
||||
@@ -43,24 +38,19 @@
|
||||
import { ArrowUpRightIcon, XMarkIcon } from '@heroicons/vue/24/solid'
|
||||
import { useMixpanel } from '~~/lib/core/composables/mp'
|
||||
import { useActiveUserMeta } from '~~/lib/user/composables/meta'
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
const mixpanel = useMixpanel()
|
||||
const { updateIntelligenceCommunityStandUpBannerDismissed } = useActiveUserMeta()
|
||||
const { updateSpeckleCon25BannerDismissed } = useActiveUserMeta()
|
||||
|
||||
const onCTAClick = () => {
|
||||
mixpanel.track('Intelligence Community StandUp CTA Clicked')
|
||||
mixpanel.track('SpeckleCon 2025 CTA Clicked')
|
||||
}
|
||||
|
||||
const dateIsSetp9 = computed(() => {
|
||||
return dayjs().isSame('2025-09-09', 'day')
|
||||
})
|
||||
|
||||
const dismissBanner = async () => {
|
||||
await updateIntelligenceCommunityStandUpBannerDismissed(true)
|
||||
await updateSpeckleCon25BannerDismissed(true)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
mixpanel.track('Intelligence Community StandUp Banner Shown')
|
||||
mixpanel.track('SpeckleCon 2025 Banner Shown')
|
||||
})
|
||||
</script>
|
||||
@@ -421,9 +421,9 @@ 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 legacyProjectsExplainerCollapsed\n intelligenceCommunityStandUpBannerDismissed\n }\n }\n }\n": typeof types.ActiveUserMetaDocument,
|
||||
"\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n speckleCon25BannerDismissed\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 UpdateIntelligenceCommunityStandUpBannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setIntelligenceCommunityStandUpBannerDismissed(value: $value)\n }\n }\n }\n": typeof types.UpdateIntelligenceCommunityStandUpBannerDismissedDocument,
|
||||
"\n mutation UpdateSpeckleCon25BannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setSpeckleCon25BannerDismissed(value: $value)\n }\n }\n }\n": typeof types.UpdateSpeckleCon25BannerDismissedDocument,
|
||||
"\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,
|
||||
@@ -956,9 +956,9 @@ 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 legacyProjectsExplainerCollapsed\n intelligenceCommunityStandUpBannerDismissed\n }\n }\n }\n": types.ActiveUserMetaDocument,
|
||||
"\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n speckleCon25BannerDismissed\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 UpdateIntelligenceCommunityStandUpBannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setIntelligenceCommunityStandUpBannerDismissed(value: $value)\n }\n }\n }\n": types.UpdateIntelligenceCommunityStandUpBannerDismissedDocument,
|
||||
"\n mutation UpdateSpeckleCon25BannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setSpeckleCon25BannerDismissed(value: $value)\n }\n }\n }\n": types.UpdateSpeckleCon25BannerDismissedDocument,
|
||||
"\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,
|
||||
@@ -2729,7 +2729,7 @@ 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 legacyProjectsExplainerCollapsed\n intelligenceCommunityStandUpBannerDismissed\n }\n }\n }\n"): (typeof documents)["\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n intelligenceCommunityStandUpBannerDismissed\n }\n }\n }\n"];
|
||||
export function graphql(source: "\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n speckleCon25BannerDismissed\n }\n }\n }\n"): (typeof documents)["\n query ActiveUserMeta {\n activeUser {\n meta {\n legacyProjectsExplainerCollapsed\n speckleCon25BannerDismissed\n }\n }\n }\n"];
|
||||
/**
|
||||
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
||||
*/
|
||||
@@ -2737,7 +2737,7 @@ export function graphql(source: "\n mutation UpdateLegacyProjectsExplainer($val
|
||||
/**
|
||||
* 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 UpdateIntelligenceCommunityStandUpBannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setIntelligenceCommunityStandUpBannerDismissed(value: $value)\n }\n }\n }\n"): (typeof documents)["\n mutation UpdateIntelligenceCommunityStandUpBannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setIntelligenceCommunityStandUpBannerDismissed(value: $value)\n }\n }\n }\n"];
|
||||
export function graphql(source: "\n mutation UpdateSpeckleCon25BannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setSpeckleCon25BannerDismissed(value: $value)\n }\n }\n }\n"): (typeof documents)["\n mutation UpdateSpeckleCon25BannerDismissed($value: Boolean!) {\n activeUserMutations {\n meta {\n setSpeckleCon25BannerDismissed(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
@@ -6,7 +6,7 @@ export const activeUserMetaQuery = graphql(`
|
||||
activeUser {
|
||||
meta {
|
||||
legacyProjectsExplainerCollapsed
|
||||
intelligenceCommunityStandUpBannerDismissed
|
||||
speckleCon25BannerDismissed
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,11 +22,11 @@ export const updateLegacyProjectsExplainerMutation = graphql(`
|
||||
}
|
||||
`)
|
||||
|
||||
export const updateIntelligenceCommunityStandUpBannerDismissedMutation = graphql(`
|
||||
mutation UpdateIntelligenceCommunityStandUpBannerDismissed($value: Boolean!) {
|
||||
export const updateSpeckleCon25BannerDismissedMutation = graphql(`
|
||||
mutation UpdateSpeckleCon25BannerDismissed($value: Boolean!) {
|
||||
activeUserMutations {
|
||||
meta {
|
||||
setIntelligenceCommunityStandUpBannerDismissed(value: $value)
|
||||
setSpeckleCon25BannerDismissed(value: $value)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,8 +37,8 @@ export function useActiveUserMeta() {
|
||||
const { mutate: updateLegacyProjectsExplainer } = useMutation(
|
||||
updateLegacyProjectsExplainerMutation
|
||||
)
|
||||
const { mutate: updateIntelligenceCommunityStandUpBanner } = useMutation(
|
||||
updateIntelligenceCommunityStandUpBannerDismissedMutation
|
||||
const { mutate: updateSpeckleCon25Banner } = useMutation(
|
||||
updateSpeckleCon25BannerDismissedMutation
|
||||
)
|
||||
const apollo = useApolloClient().client
|
||||
const cache = apollo.cache
|
||||
@@ -51,8 +51,8 @@ export function useActiveUserMeta() {
|
||||
() => meta.value?.legacyProjectsExplainerCollapsed
|
||||
)
|
||||
|
||||
const hasDismissedIntelligenceCommunityStandUpBanner = computed(
|
||||
() => meta.value?.intelligenceCommunityStandUpBannerDismissed
|
||||
const hasDismissedSpeckleCon25Banner = computed(
|
||||
() => meta.value?.speckleCon25BannerDismissed
|
||||
)
|
||||
|
||||
const updateLegacyProjectsExplainerCollapsed = async (value: boolean) => {
|
||||
@@ -69,8 +69,8 @@ export function useActiveUserMeta() {
|
||||
)
|
||||
}
|
||||
|
||||
const updateIntelligenceCommunityStandUpBannerDismissed = async (value: boolean) => {
|
||||
await updateIntelligenceCommunityStandUpBanner({ value })
|
||||
const updateSpeckleCon25BannerDismissed = async (value: boolean) => {
|
||||
await updateSpeckleCon25Banner({ value })
|
||||
|
||||
modifyObjectField(
|
||||
cache,
|
||||
@@ -78,7 +78,7 @@ export function useActiveUserMeta() {
|
||||
'meta',
|
||||
({ helpers: { createUpdatedValue } }) =>
|
||||
createUpdatedValue(({ update }) => {
|
||||
update('intelligenceCommunityStandUpBannerDismissed', () => value)
|
||||
update('speckleCon25BannerDismissed', () => value)
|
||||
})
|
||||
)
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export function useActiveUserMeta() {
|
||||
return {
|
||||
hasCollapsedLegacyProjectsExplainer,
|
||||
updateLegacyProjectsExplainerCollapsed,
|
||||
hasDismissedIntelligenceCommunityStandUpBanner,
|
||||
updateIntelligenceCommunityStandUpBannerDismissed
|
||||
hasDismissedSpeckleCon25Banner,
|
||||
updateSpeckleCon25BannerDismissed
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ type UserMeta {
|
||||
newWorkspaceExplainerDismissed: Boolean!
|
||||
speckleConBannerDismissed: Boolean!
|
||||
intelligenceCommunityStandUpBannerDismissed: Boolean!
|
||||
speckleCon25BannerDismissed: Boolean!
|
||||
legacyProjectsExplainerCollapsed: Boolean!
|
||||
}
|
||||
|
||||
@@ -11,6 +12,7 @@ type UserMetaMutations {
|
||||
setNewWorkspaceExplainerDismissed(value: Boolean!): Boolean!
|
||||
setSpeckleConBannerDismissed(value: Boolean!): Boolean!
|
||||
setIntelligenceCommunityStandUpBannerDismissed(value: Boolean!): Boolean!
|
||||
setSpeckleCon25BannerDismissed(value: Boolean!): Boolean!
|
||||
setLegacyProjectsExplainerCollapsed(value: Boolean!): Boolean!
|
||||
}
|
||||
|
||||
|
||||
@@ -318,6 +318,7 @@ export const UsersMeta = buildMetaTableHelper(
|
||||
'newWorkspaceExplainerDismissed',
|
||||
'speckleConBannerDismissed',
|
||||
'intelligenceCommunityStandUpBannerDismissed',
|
||||
'speckleCon25BannerDismissed',
|
||||
'legacyProjectsExplainerCollapsed',
|
||||
// Used in tests
|
||||
'foo',
|
||||
|
||||
@@ -4987,6 +4987,7 @@ export type UserMeta = {
|
||||
intelligenceCommunityStandUpBannerDismissed: Scalars['Boolean']['output'];
|
||||
legacyProjectsExplainerCollapsed: Scalars['Boolean']['output'];
|
||||
newWorkspaceExplainerDismissed: Scalars['Boolean']['output'];
|
||||
speckleCon25BannerDismissed: Scalars['Boolean']['output'];
|
||||
speckleConBannerDismissed: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
@@ -5001,6 +5002,7 @@ export type UserMetaMutations = {
|
||||
setIntelligenceCommunityStandUpBannerDismissed: Scalars['Boolean']['output'];
|
||||
setLegacyProjectsExplainerCollapsed: Scalars['Boolean']['output'];
|
||||
setNewWorkspaceExplainerDismissed: Scalars['Boolean']['output'];
|
||||
setSpeckleCon25BannerDismissed: Scalars['Boolean']['output'];
|
||||
setSpeckleConBannerDismissed: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
@@ -5026,6 +5028,11 @@ export type UserMetaMutationsSetNewWorkspaceExplainerDismissedArgs = {
|
||||
};
|
||||
|
||||
|
||||
export type UserMetaMutationsSetSpeckleCon25BannerDismissedArgs = {
|
||||
value: Scalars['Boolean']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type UserMetaMutationsSetSpeckleConBannerDismissedArgs = {
|
||||
value: Scalars['Boolean']['input'];
|
||||
};
|
||||
@@ -8628,6 +8635,7 @@ export type UserMetaResolvers<ContextType = GraphQLContext, ParentType extends R
|
||||
intelligenceCommunityStandUpBannerDismissed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
|
||||
legacyProjectsExplainerCollapsed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
|
||||
newWorkspaceExplainerDismissed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
|
||||
speckleCon25BannerDismissed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
|
||||
speckleConBannerDismissed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
};
|
||||
@@ -8637,6 +8645,7 @@ export type UserMetaMutationsResolvers<ContextType = GraphQLContext, ParentType
|
||||
setIntelligenceCommunityStandUpBannerDismissed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType, RequireFields<UserMetaMutationsSetIntelligenceCommunityStandUpBannerDismissedArgs, 'value'>>;
|
||||
setLegacyProjectsExplainerCollapsed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType, RequireFields<UserMetaMutationsSetLegacyProjectsExplainerCollapsedArgs, 'value'>>;
|
||||
setNewWorkspaceExplainerDismissed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType, RequireFields<UserMetaMutationsSetNewWorkspaceExplainerDismissedArgs, 'value'>>;
|
||||
setSpeckleCon25BannerDismissed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType, RequireFields<UserMetaMutationsSetSpeckleCon25BannerDismissedArgs, 'value'>>;
|
||||
setSpeckleConBannerDismissed?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType, RequireFields<UserMetaMutationsSetSpeckleConBannerDismissedArgs, 'value'>>;
|
||||
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
|
||||
};
|
||||
@@ -9450,6 +9459,18 @@ export type SetIntelligenceCommunityStandUpBannerDismissedMutationVariables = Ex
|
||||
|
||||
export type SetIntelligenceCommunityStandUpBannerDismissedMutation = { __typename?: 'Mutation', activeUserMutations: { __typename?: 'ActiveUserMutations', meta: { __typename?: 'UserMetaMutations', setIntelligenceCommunityStandUpBannerDismissed: boolean } } };
|
||||
|
||||
export type GetSpeckleCon25BannerDismissedQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type GetSpeckleCon25BannerDismissedQuery = { __typename?: 'Query', activeUser?: { __typename?: 'User', meta: { __typename?: 'UserMeta', speckleCon25BannerDismissed: boolean } } | null };
|
||||
|
||||
export type SetSpeckleCon25BannerDismissedMutationVariables = Exact<{
|
||||
input: Scalars['Boolean']['input'];
|
||||
}>;
|
||||
|
||||
|
||||
export type SetSpeckleCon25BannerDismissedMutation = { __typename?: 'Mutation', activeUserMutations: { __typename?: 'ActiveUserMutations', meta: { __typename?: 'UserMetaMutations', setSpeckleCon25BannerDismissed: boolean } } };
|
||||
|
||||
export type GetLegacyProjectsExplainerCollapsedQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
@@ -10805,6 +10826,8 @@ export const GetSpeckleConBannerDismissedDocument = {"kind":"Document","definiti
|
||||
export const SetSpeckleConBannerDismissedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetSpeckleConBannerDismissed"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUserMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setSpeckleConBannerDismissed"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]}}]} as unknown as DocumentNode<SetSpeckleConBannerDismissedMutation, SetSpeckleConBannerDismissedMutationVariables>;
|
||||
export const GetIntelligenceCommunityStandUpBannerDismissedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetIntelligenceCommunityStandUpBannerDismissed"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"intelligenceCommunityStandUpBannerDismissed"}}]}}]}}]}}]} as unknown as DocumentNode<GetIntelligenceCommunityStandUpBannerDismissedQuery, GetIntelligenceCommunityStandUpBannerDismissedQueryVariables>;
|
||||
export const SetIntelligenceCommunityStandUpBannerDismissedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetIntelligenceCommunityStandUpBannerDismissed"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUserMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setIntelligenceCommunityStandUpBannerDismissed"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]}}]} as unknown as DocumentNode<SetIntelligenceCommunityStandUpBannerDismissedMutation, SetIntelligenceCommunityStandUpBannerDismissedMutationVariables>;
|
||||
export const GetSpeckleCon25BannerDismissedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSpeckleCon25BannerDismissed"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"speckleCon25BannerDismissed"}}]}}]}}]}}]} as unknown as DocumentNode<GetSpeckleCon25BannerDismissedQuery, GetSpeckleCon25BannerDismissedQueryVariables>;
|
||||
export const SetSpeckleCon25BannerDismissedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetSpeckleCon25BannerDismissed"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUserMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setSpeckleCon25BannerDismissed"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]}}]} as unknown as DocumentNode<SetSpeckleCon25BannerDismissedMutation, SetSpeckleCon25BannerDismissedMutationVariables>;
|
||||
export const GetLegacyProjectsExplainerCollapsedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetLegacyProjectsExplainerCollapsed"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUser"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"legacyProjectsExplainerCollapsed"}}]}}]}}]}}]} as unknown as DocumentNode<GetLegacyProjectsExplainerCollapsedQuery, GetLegacyProjectsExplainerCollapsedQueryVariables>;
|
||||
export const SetLegacyProjectsExplainerCollapsedDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"SetLegacyProjectsExplainerCollapsed"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"Boolean"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"activeUserMutations"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"meta"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"setLegacyProjectsExplainerCollapsed"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"value"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]}}]} as unknown as DocumentNode<SetLegacyProjectsExplainerCollapsedMutation, SetLegacyProjectsExplainerCollapsedMutationVariables>;
|
||||
export const AdminMutationsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"AdminMutations"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"AdminUpdateEmailVerificationInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"admin"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateEmailVerification"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}]}]}}]}}]} as unknown as DocumentNode<AdminMutationsMutation, AdminMutationsMutationVariables>;
|
||||
|
||||
@@ -239,6 +239,13 @@ export default {
|
||||
})
|
||||
return !!metaVal?.value
|
||||
},
|
||||
speckleCon25BannerDismissed: async (parent, _args, ctx) => {
|
||||
const metaVal = await ctx.loaders.users.getUserMeta.load({
|
||||
userId: parent.userId,
|
||||
key: UsersMeta.metaKey.speckleCon25BannerDismissed
|
||||
})
|
||||
return !!metaVal?.value
|
||||
},
|
||||
legacyProjectsExplainerCollapsed: async (parent, _args, ctx) => {
|
||||
const metaVal = await ctx.loaders.users.getUserMeta.load({
|
||||
userId: parent.userId,
|
||||
@@ -550,6 +557,16 @@ export default {
|
||||
args.value
|
||||
)
|
||||
|
||||
return !!res.value
|
||||
},
|
||||
setSpeckleCon25BannerDismissed: async (_parent, args, ctx) => {
|
||||
const meta = metaHelpers(Users, db)
|
||||
const res = await meta.set(
|
||||
ctx.userId!,
|
||||
UsersMeta.metaKey.speckleCon25BannerDismissed,
|
||||
args.value
|
||||
)
|
||||
|
||||
return !!res.value
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +250,26 @@ export const setIntelligenceCommunityStandUpBannerDismissedMutation = gql`
|
||||
}
|
||||
`
|
||||
|
||||
export const getSpeckleCon25BannerDismissedQuery = gql`
|
||||
query GetSpeckleCon25BannerDismissed {
|
||||
activeUser {
|
||||
meta {
|
||||
speckleCon25BannerDismissed
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const setSpeckleCon25BannerDismissedMutation = gql`
|
||||
mutation SetSpeckleCon25BannerDismissed($input: Boolean!) {
|
||||
activeUserMutations {
|
||||
meta {
|
||||
setSpeckleCon25BannerDismissed(value: $input)
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const getLegacyProjectsExplainerCollapsedQuery = gql`
|
||||
query GetLegacyProjectsExplainerCollapsed {
|
||||
activeUser {
|
||||
|
||||
@@ -8,7 +8,9 @@ import {
|
||||
SetNewWorkspaceExplainerDismissedDocument,
|
||||
SetSpeckleConBannerDismissedDocument,
|
||||
GetIntelligenceCommunityStandUpBannerDismissedDocument,
|
||||
SetIntelligenceCommunityStandUpBannerDismissedDocument
|
||||
SetIntelligenceCommunityStandUpBannerDismissedDocument,
|
||||
GetSpeckleCon25BannerDismissedDocument,
|
||||
SetSpeckleCon25BannerDismissedDocument
|
||||
} from '@/modules/core/graph/generated/graphql'
|
||||
import type { TestApolloServer } from '@/test/graphqlHelper'
|
||||
import { testApolloServer } from '@/test/graphqlHelper'
|
||||
@@ -95,6 +97,24 @@ describe('UserMeta GraphQL', () => {
|
||||
.to.be.true
|
||||
})
|
||||
|
||||
it('speckleCon25BannerDismissed get/set works', async () => {
|
||||
const getRes = await apollo.execute(GetSpeckleCon25BannerDismissedDocument, {})
|
||||
expect(getRes).to.not.haveGraphQLErrors()
|
||||
expect(getRes.data?.activeUser?.meta.speckleCon25BannerDismissed).to.be.false
|
||||
|
||||
const setRes = await apollo.execute(SetSpeckleCon25BannerDismissedDocument, {
|
||||
input: true
|
||||
})
|
||||
|
||||
expect(setRes).to.not.haveGraphQLErrors()
|
||||
expect(setRes.data?.activeUserMutations?.meta.setSpeckleCon25BannerDismissed).to.be
|
||||
.true
|
||||
|
||||
const getRes2 = await apollo.execute(GetSpeckleCon25BannerDismissedDocument, {})
|
||||
expect(getRes2).to.not.haveGraphQLErrors()
|
||||
expect(getRes2.data?.activeUser?.meta.speckleCon25BannerDismissed).to.be.true
|
||||
})
|
||||
|
||||
it('setLegacyProjectsExplainerCollapsed get/set works', async () => {
|
||||
const getRes = await apollo.execute(GetLegacyProjectsExplainerCollapsedDocument, {})
|
||||
expect(getRes).to.not.haveGraphQLErrors()
|
||||
|
||||
Reference in New Issue
Block a user