Skip to content

Commit

Permalink
Merge branch 'main' of github.com:specklesystems/speckle-server into …
Browse files Browse the repository at this point in the history
…gergo/previews
  • Loading branch information
gjedlicska committed Jan 7, 2025
2 parents 9590220 + c252339 commit febb0bf
Show file tree
Hide file tree
Showing 334 changed files with 12,979 additions and 6,014 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ jobs:
S3_REGION: '' # optional, defaults to 'us-east-1'
ENCRYPTION_KEYS_PATH: 'test/assets/automate/encryptionKeys.json'
FF_BILLING_INTEGRATION_ENABLED: 'true'
RATELIMITER_ENABLED: 'false'
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -578,6 +579,7 @@ jobs:
S3_REGION: '' # optional, defaults to 'us-east-1'
ENCRYPTION_KEYS_PATH: 'test/assets/automate/encryptionKeys.json'
DISABLE_ALL_FFS: 'true'
RATELIMITER_ENABLED: 'false'

test-server-multiregion:
<<: *test-server-job
Expand Down Expand Up @@ -623,8 +625,8 @@ jobs:
MULTI_REGION_CONFIG_PATH: '../../.circleci/multiregion.test-ci.json'
FF_WORKSPACES_MODULE_ENABLED: 'true'
FF_WORKSPACES_MULTI_REGION_ENABLED: 'true'
FF_WORKSPACES_MULTI_REGION_BLOB_STORAGE_ENABLED: 'true'
RUN_TESTS_IN_MULTIREGION_MODE: true
RATELIMITER_ENABLED: 'false'

test-frontend-2:
docker: &docker-node-browsers-image
Expand Down Expand Up @@ -1049,7 +1051,6 @@ jobs:
docker-build-monitor-container:
<<: *build-job
environment:
FOLDER: utils
SPECKLE_SERVER_PACKAGE: monitor-deployment

docker-build-docker-compose-ingress:
Expand Down Expand Up @@ -1119,7 +1120,6 @@ jobs:
docker-publish-monitor-container:
<<: *publish-job
environment:
FOLDER: utils
SPECKLE_SERVER_PACKAGE: monitor-deployment

docker-publish-docker-compose-ingress:
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ redis-data/
.tshy-build
obj/
bin/

!packages/monitor-deployment/bin
!packages/preview-service/bin
!packages/server/bin

# Server
multiregion.json
Expand Down
24 changes: 24 additions & 0 deletions packages/dui3/lib/common/generated/gql/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ export type AdminInviteList = {
totalCount: Scalars['Int']['output'];
};

export type AdminMutations = {
__typename?: 'AdminMutations';
updateWorkspacePlan: Scalars['Boolean']['output'];
};


export type AdminMutationsUpdateWorkspacePlanArgs = {
input: AdminUpdateWorkspacePlanInput;
};

export type AdminQueries = {
__typename?: 'AdminQueries';
inviteList: AdminInviteList;
Expand Down Expand Up @@ -108,6 +118,12 @@ export type AdminQueriesWorkspaceListArgs = {
query?: InputMaybe<Scalars['String']['input']>;
};

export type AdminUpdateWorkspacePlanInput = {
plan: WorkspacePlans;
status: WorkspacePlanStatuses;
workspaceId: Scalars['ID']['input'];
};

export type AdminUserList = {
__typename?: 'AdminUserList';
cursor?: Maybe<Scalars['String']['output']>;
Expand Down Expand Up @@ -1240,6 +1256,7 @@ export type Mutation = {
_?: Maybe<Scalars['String']['output']>;
/** Various Active User oriented mutations */
activeUserMutations: ActiveUserMutations;
admin: AdminMutations;
adminDeleteUser: Scalars['Boolean']['output'];
/** Creates an personal api token. */
apiTokenCreate: Scalars['String']['output'];
Expand Down Expand Up @@ -4535,9 +4552,16 @@ export type WorkspaceSubscription = {
billingInterval: BillingInterval;
createdAt: Scalars['DateTime']['output'];
currentBillingCycleEnd: Scalars['DateTime']['output'];
seats: WorkspaceSubscriptionSeats;
updatedAt: Scalars['DateTime']['output'];
};

export type WorkspaceSubscriptionSeats = {
__typename?: 'WorkspaceSubscriptionSeats';
guest: Scalars['Int']['output'];
plan: Scalars['Int']['output'];
};

export type WorkspaceTeamFilter = {
/** Limit team members to provided role(s) */
roles?: InputMaybe<Array<Scalars['String']['input']>>;
Expand Down
2 changes: 1 addition & 1 deletion packages/fileimport-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN chmod +x /usr/bin/tini
RUN apt-get update -y \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
curl=8.5.0-2ubuntu10.5 \
curl=8.5.0-2ubuntu10.6 \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
--no-install-recommends \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Speckle.WebIfc.Importer" Version="0.0.5" />
<PackageReference Include="Speckle.WebIfc.Importer" Version="0.0.7" />
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
</ItemGroup>

Expand Down
15 changes: 12 additions & 3 deletions packages/fileimport-service/knex.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,25 @@ const isDevEnv = process.env.NODE_ENV !== 'production'
let dbClients
const getDbClients = async () => {
if (dbClients) return dbClients
const maxConnections =
parseInt(process.env.POSTGRES_MAX_CONNECTIONS_FILE_IMPORT_SERVICE) || 1
const maxConnections = parseInt(
process.env['POSTGRES_MAX_CONNECTIONS_FILE_IMPORT_SERVICE'] || '1'
)
const connectionAcquireTimeoutMillis = parseInt(
process.env['POSTGRES_CONNECTION_ACQUIRE_TIMEOUT_MILLIS'] || '16000'
)
const connectionCreateTimeoutMillis = parseInt(
process.env['POSTGRES_CONNECTION_CREATE_TIMEOUT_MILLIS'] || '5000'
)

const configArgs = {
migrationDirs: [],
isTestEnv: isDevEnv,
isDevOrTestEnv: isDevEnv,
logger,
maxConnections,
applicationName: 'speckle_fileimport_service'
applicationName: 'speckle_fileimport_service',
connectionAcquireTimeoutMillis,
connectionCreateTimeoutMillis
}
if (!FF_WORKSPACES_MULTI_REGION_ENABLED) {
const mainClient = configureKnexClient(
Expand Down
2 changes: 1 addition & 1 deletion packages/fileimport-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@speckle/shared": "workspace:^",
"bcrypt": "^5.0.1",
"crypto-random-string": "^3.3.1",
"knex": "^2.4.1",
"knex": "^2.5.1",
"pg": "^8.7.3",
"pino": "^8.7.0",
"pino-http": "^8.0.0",
Expand Down
6 changes: 5 additions & 1 deletion packages/frontend-2/components/automate/runs/StatusBadge.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<template>
<CommonBadge :color-classes="[runStatusClasses(run), 'shrink-0 grow-0'].join(' ')">
<CommonBadge
:color-classes="
[runStatusClasses(run), 'shrink-0 grow-0 text-foreground'].join(' ')
"
>
{{ run.status.toUpperCase() }}
</CommonBadge>
</template>
Expand Down
49 changes: 38 additions & 11 deletions packages/frontend-2/components/billing/Alert.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
<template>
<div>
<CommonAlert v-if="!hasValidPlan" :color="alertColor" :actions="actions">
<template #title>
<template v-if="!hasValidPlan">
<div
v-if="condensed"
class="flex items-center justify-between rounded-md p-2 pl-3 text-body-3xs font-medium bg-info-lighter text-primary-focus gap-x-2"
>
{{ title }}
</template>
<template #description>
{{ description }}
</template>
</CommonAlert>
<FormButton
v-if="actions.length > 0"
size="sm"
:disabled="actions[0].disabled"
@click="actions[0].onClick"
>
{{ actions[0].title }}
</FormButton>
</div>
<CommonAlert v-else :color="alertColor" :actions="actions">
<template #title>
{{ title }}
</template>
<template #description>
{{ description }}
</template>
</CommonAlert>
</template>
</div>
</template>

Expand Down Expand Up @@ -39,6 +55,7 @@ graphql(`
const props = defineProps<{
workspace: BillingAlert_WorkspaceFragment
actions?: Array<AlertAction>
condensed?: boolean
}>()
const { billingPortalRedirect } = useBillingActions()
Expand All @@ -62,9 +79,17 @@ const trialDaysLeft = computed(() => {
})
const title = computed(() => {
if (isTrial.value) {
return `You have ${trialDaysLeft.value} day${
trialDaysLeft.value !== 1 ? 's' : ''
} left on your free trial`
if (trialDaysLeft.value === 0) {
return 'Final day of free trial'
}
if (props.condensed) {
return `${trialDaysLeft.value} day${
trialDaysLeft.value !== 1 ? 's' : ''
} left in trial`
} else
return `You have ${trialDaysLeft.value} day${
trialDaysLeft.value !== 1 ? 's' : ''
} left on your free trial`
}
switch (planStatus.value) {
case WorkspacePlanStatuses.CancelationScheduled:
Expand Down Expand Up @@ -98,6 +123,8 @@ const description = computed(() => {
return ''
}
})
const hasValidPlan = computed(() => planStatus.value === WorkspacePlanStatuses.Valid)
const alertColor = computed<AlertColor>(() => {
switch (planStatus.value) {
case WorkspacePlanStatuses.PaymentFailed:
Expand All @@ -110,6 +137,7 @@ const alertColor = computed<AlertColor>(() => {
return 'neutral'
}
})
const actions = computed((): AlertAction[] => {
const actions: Array<AlertAction> = props.actions ?? []
Expand All @@ -129,5 +157,4 @@ const actions = computed((): AlertAction[] => {
return actions
})
const hasValidPlan = computed(() => planStatus.value === WorkspacePlanStatuses.Valid)
</script>
5 changes: 3 additions & 2 deletions packages/frontend-2/components/dashboard/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
v-if="isWorkspacesEnabled"
collapsible
title="Workspaces"
:plus-click="isNotGuest ? handlePlusClick : undefined"
plus-text="Create workspace"
:icon-click="isNotGuest ? handlePlusClick : undefined"
icon-text="Create workspace"
>
<NuxtLink :to="workspacesRoute" @click="handleIntroducingWorkspacesClick">
<LayoutSidebarMenuGroupItem
Expand All @@ -83,6 +83,7 @@
:active="isActive(item.to)"
:tag="
item.plan.status === WorkspacePlanStatuses.Trial ||
item.plan.status === WorkspacePlanStatuses.Expired ||
!item.plan.status
? 'TRIAL'
: undefined
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<NuxtLink :to="webflowItem.url" target="_blank">
<NuxtLink :to="webflowItem.url" target="_blank" @click="trackClick">
<div
class="bg-foundation border border-outline-3 rounded-xl flex flex-col overflow-hidden hover:border-outline-5 transition"
>
Expand All @@ -17,33 +17,29 @@
>
<HeaderLogoBlock no-link minimal class="scale-150" />
</div>
<div class="p-5 pb-4">
<div class="p-5">
<h3 class="text-body-2xs text-foreground truncate">
{{ webflowItem.title }}
</h3>
<p class="text-body-3xs text-foreground-2 mt-2">
<span v-tippy="createdOn.full">
{{ createdOn.relative }}
</span>
<template v-if="webflowItem.readTime">
<span class="pl-1 pr-2">•</span>
{{ webflowItem.readTime }}m read
</template>
</p>
</div>
</div>
</NuxtLink>
</template>

<script lang="ts" setup>
import type { WebflowItem } from '~/lib/dashboard/helpers/types'
import { useMixpanel } from '~~/lib/core/composables/mp'
const mixpanel = useMixpanel()
const props = defineProps<{
webflowItem: WebflowItem
}>()
const createdOn = computed(() => ({
full: formattedFullDate(props.webflowItem.createdOn),
relative: formattedRelativeDate(props.webflowItem.createdOn, { capitalize: true })
}))
const trackClick = () => {
mixpanel.track('Tutorial clicked', {
title: props.webflowItem.title,
id: props.webflowItem.id
})
}
</script>
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<template>
<section v-if="!error">
<h2 class="text-heading-sm text-foreground-2 mb-4">Blog</h2>
<h2 class="text-heading-sm text-foreground-2 mb-4">Tutorials</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
<DashboardBlogCard
<DashboardTutorialsCard
v-for="webflowItem in webflowItems"
:key="webflowItem.id"
:webflow-item="webflowItem"
Expand Down
5 changes: 3 additions & 2 deletions packages/frontend-2/components/form/select/ServerRoles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
:disabled-item-tooltip="
!allowGuest ? 'The Guest role isn\'t enabled on the server' : ''
"
name="serverRoles"
:name="name ?? 'serverRoles'"
label="Role"
:show-label="showLabel"
class="min-w-[110px]"
Expand Down Expand Up @@ -75,7 +75,8 @@ const props = defineProps({
allowAdmin: Boolean,
allowArchived: Boolean,
fullyControlValue: Boolean,
showLabel: Boolean
showLabel: Boolean,
name: String
})
const elementToWatchForChanges = ref(null as Nullable<HTMLElement>)
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend-2/components/form/select/WorkspaceRoles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ const props = defineProps({
hideDescription: {
required: false,
type: Boolean
},
allowUnset: {
required: false,
type: Boolean,
default: true
}
})
Expand Down
Loading

0 comments on commit febb0bf

Please sign in to comment.