feat(workspaces): toggle embedded viewer branding (#4762)
* feat(viewer): embedded viewer option to hide speckle branding * chore(viewer): can edit embed options policy * chore(embeds): tests for new policy and gql
This commit is contained in:
@@ -29,6 +29,8 @@ export type Workspace = {
|
||||
logo: string | null
|
||||
domainBasedMembershipProtectionEnabled: boolean
|
||||
discoverabilityEnabled: boolean
|
||||
// TODO: Create new table/structure if embeds get more configuration
|
||||
isEmbedSpeckleBrandingHidden: boolean
|
||||
}
|
||||
|
||||
export type LimitedWorkspace = Pick<
|
||||
|
||||
@@ -14,7 +14,6 @@ export = !FF_WORKSPACES_MODULE_ENABLED
|
||||
workspace: async () => {
|
||||
throw new WorkspacesModuleDisabledError()
|
||||
},
|
||||
|
||||
workspaceBySlug: async () => {
|
||||
throw new WorkspacesModuleDisabledError()
|
||||
},
|
||||
@@ -109,6 +108,11 @@ export = !FF_WORKSPACES_MODULE_ENABLED
|
||||
workspace: async () => {
|
||||
// Return type is always workspace or null, to make the FE implementation easier we force return null in this case
|
||||
return null
|
||||
},
|
||||
embedOptions: async () => {
|
||||
return {
|
||||
hideSpeckleBranding: false
|
||||
}
|
||||
}
|
||||
},
|
||||
AdminQueries: {
|
||||
|
||||
@@ -9,7 +9,8 @@ export const Workspaces = buildTableHelper('workspaces', [
|
||||
'updatedAt',
|
||||
'logo',
|
||||
'domainBasedMembershipProtectionEnabled',
|
||||
'discoverabilityEnabled'
|
||||
'discoverabilityEnabled',
|
||||
'isEmbedSpeckleBrandingHidden'
|
||||
])
|
||||
|
||||
export const WorkspaceAcl = buildTableHelper('workspace_acl', [
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import { Knex } from 'knex'
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
await knex.schema.alterTable('workspaces', (table) => {
|
||||
table.boolean('isEmbedSpeckleBrandingHidden').notNullable().defaultTo(false)
|
||||
})
|
||||
}
|
||||
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
await knex.schema.alterTable('workspaces', (table) => {
|
||||
table.dropColumn('isEmbedSpeckleBrandingHidden')
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user