Skip to content

Commit

Permalink
Merge branch 'main' into andrew/web-899-sort-models-and-scene-explore…
Browse files Browse the repository at this point in the history
…r-the-same
  • Loading branch information
andrewwallacespeckle committed May 29, 2024
2 parents e2f557b + c3676a9 commit c5e613e
Show file tree
Hide file tree
Showing 41 changed files with 901 additions and 651 deletions.
4 changes: 3 additions & 1 deletion docker-compose-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ services:
# Actual Speckle Server dependencies

postgres:
image: 'postgres:14.5-alpine'
build:
context: .
dockerfile: docker/postgres/Dockerfile
restart: always
environment:
POSTGRES_DB: speckle
Expand Down
25 changes: 25 additions & 0 deletions docker/postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM postgres:14.5-alpine as builder

RUN apk add --no-cache 'git=~2.36' \
'build-base=~0.5' \
'clang=~13.0' \
'llvm13=~13.0'

WORKDIR /
RUN git clone --branch 1.1.9 https://github.com/aiven/aiven-extras.git aiven-extras

WORKDIR /aiven-extras
RUN git checkout 36598ab \
&& git clean -df \
&& make \
&& make install

FROM postgres:14.5-alpine

COPY --from=builder /aiven-extras/aiven_extras.control /usr/local/share/postgresql/extension/aiven_extras.control
COPY --from=builder /aiven-extras/sql/aiven_extras.sql /usr/local/share/postgresql/extension/aiven_extras--1.1.9.sql
COPY --from=builder /aiven-extras/aiven_extras.so /usr/local/lib/postgresql/aiven_extras.so

EXPOSE 5432

CMD ["postgres"]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<form @submit="onSubmit">
<form method="post" @submit="onSubmit">
<div class="flex flex-col space-y-2">
<FormTextInput
type="email"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<form @submit="onSubmit">
<form method="post" @submit="onSubmit">
<div class="flex flex-col space-y-2">
<FormTextInput
type="text"
Expand Down
103 changes: 84 additions & 19 deletions packages/frontend-2/components/automate/automation/CreateDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
<LayoutDialog
v-model:open="open"
max-width="lg"
title="Create Automation"
:title="title"
:buttons-wrapper-classes="buttonsWrapperClasses"
:buttons="buttons"
:on-submit="onDialogSubmit"
prevent-close-on-click-outside
>
<template v-if="isTestAutomation" #header>
Create
<span class="font-extrabold text-fancy-gradient">Test</span>
Automation
</template>
<div class="flex flex-col gap-11">
<CommonStepsNumber
v-if="shouldShowStepsWidget"
Expand Down Expand Up @@ -57,7 +62,8 @@ import {
import {
ArrowRightIcon,
ChevronLeftIcon,
ChevronRightIcon
ChevronRightIcon,
CodeBracketIcon
} from '@heroicons/vue/24/outline'
import { graphql } from '~/lib/common/generated/gql'
import { Automate, type Optional } from '@speckle/shared'
Expand Down Expand Up @@ -106,6 +112,12 @@ const props = defineProps<{
preselectedProject?: Optional<FormSelectProjects_ProjectFragment>
}>()
const open = defineModel<boolean>('open', { required: true })
const config = useRuntimeConfig()
const enableCreateTestAutomation = computed(() => {
return config.public.FF_TEST_AUTOMATIONS_ENABLED
})
const { handleSubmit: handleDetailsSubmit } = useForm<DetailsFormValues>()
const stepsOrder = computed(() => [
Expand Down Expand Up @@ -139,7 +151,7 @@ const { enumStep, step } = useEnumSteps({ order: stepsOrder })
const {
items: stepsWidgetSteps,
model: stepsWidgetModel,
shouldShowWidget: shouldShowStepsWidget
shouldShowWidget
} = useEnumStepsWidgetSetup({ enumStep, widgetStepsMap: stepsWidgetData })
const parametersStep = ref<{ submit: () => Promise<void> }>()
Expand All @@ -152,23 +164,51 @@ const selectedModel = ref<FormSelectModels_ModelFragment>()
const selectedFunction = ref<Optional<CreateAutomationSelectableFunction>>()
const functionParameters = ref<Record<string, unknown>>()
const hasParameterErrors = ref(false)
const isTestAutomation = ref(false)
const shouldShowStepsWidget = computed(() => {
return !!shouldShowWidget.value && !isTestAutomation.value
})
const title = computed(() => {
return isTestAutomation.value ? undefined : 'Create Automation'
})
const buttons = computed((): LayoutDialogButton[] => {
switch (enumStep.value) {
case AutomationCreateSteps.SelectFunction:
return [
{
id: 'selectFnNext',
text: 'Next',
props: {
iconRight: ChevronRightIcon,
disabled: !selectedFunction.value
},
onClick: () => {
step.value++
}
case AutomationCreateSteps.SelectFunction: {
const selectFnNextButton: LayoutDialogButton = {
id: 'selectFnNext',
text: 'Next',
props: {
iconRight: ChevronRightIcon,
disabled: !selectedFunction.value
},
onClick: () => {
step.value++
}
]
}
const createTestAutomationButton: LayoutDialogButton = {
id: 'createTestAutomation',
text: 'Create test automation',
props: {
color: 'secondary',
iconLeft: CodeBracketIcon,
textColor: 'primary'
},
onClick: () => {
isTestAutomation.value = true
step.value = 2
}
}
const stepButtons = enableCreateTestAutomation.value
? [createTestAutomationButton, selectFnNextButton]
: [selectFnNextButton]
return stepButtons
}
case AutomationCreateSteps.FunctionParameters:
return [
{
Expand All @@ -191,8 +231,8 @@ const buttons = computed((): LayoutDialogButton[] => {
submit: true
}
]
case AutomationCreateSteps.AutomationDetails:
return [
case AutomationCreateSteps.AutomationDetails: {
const automationButtons: LayoutDialogButton[] = [
{
id: 'detailsPrev',
text: 'Previous',
Expand All @@ -210,6 +250,30 @@ const buttons = computed((): LayoutDialogButton[] => {
disabled: creationLoading.value
}
]
const testAutomationButtons: LayoutDialogButton[] = [
{
id: 'detailsPrev',
text: 'Back',
props: {
color: 'secondary',
iconLeft: ChevronLeftIcon,
textColor: 'primary'
},
onClick: reset
},
{
id: 'submitTestAutomation',
text: 'Create',
disabled: !automationName.value,
onClick: () => {
// TODO: Make request
}
}
]
return isTestAutomation.value ? testAutomationButtons : automationButtons
}
case AutomationCreateSteps.Done:
return [
{
Expand Down Expand Up @@ -242,7 +306,7 @@ const buttons = computed((): LayoutDialogButton[] => {
const buttonsWrapperClasses = computed(() => {
switch (enumStep.value) {
case AutomationCreateSteps.SelectFunction:
return 'justify-end'
return enableCreateTestAutomation.value ? 'justify-between' : 'justify-end'
case AutomationCreateSteps.Done:
return 'flex-col sm:flex-row sm:justify-between'
default:
Expand All @@ -267,6 +331,7 @@ const reset = () => {
selectedModel.value = undefined
automationName.value = undefined
automationId.value = undefined
isTestAutomation.value = false
}
const onDetailsSubmit = handleDetailsSubmit(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-2/components/automate/function/Card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>
</div>
</div>
<div class="label-light text-foreground-2 line-clamp-3 h-16">
<div class="label-light text-foreground-2 line-clamp-3 h-16 whitespace-normal">
{{ plaintextDescription }}
</div>
<div v-if="!noButtons" class="flex flex-col sm:flex-row sm:self-end gap-2">
Expand Down
12 changes: 6 additions & 6 deletions packages/frontend-2/components/automate/function/CardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ const props = defineProps<{
const classes = computed(() => {
const classParts = ['grid gap-4 lg:gap-6']
if (!props.vertical) {
classParts.push('sm:grid-cols-2')
if (!props.smallView) {
classParts.push('lg:grid-cols-3')
}
if (props.vertical) {
classParts.push('grid-cols-1')
} else if (props.smallView) {
classParts.push('grid-cols-1 sm:grid-cols-2')
} else {
classParts.push('grid-cols-1 sm:grid-cols-2 lg:grid-cols-3')
}
return classParts.join(' ')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
show-required
:rules="nameRules"
validate-on-value-update
autocomplete="off"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
v-on="on"
/>
<FormButton
v-if="canCreateFunction"
v-if="canCreateFunction && false"
:icon-left="PlusIcon"
@click="() => (createDialogOpen = true)"
>
Expand Down
5 changes: 5 additions & 0 deletions packages/frontend-2/components/project/VisibilitySelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
:label-id="labelId"
:button-id="buttonId"
by="id"
:help="
disabled
? 'You must be an Owner of this project to change this setting'
: undefined
"
>
<template #something-selected="{ value }">
<div class="text-sm">
Expand Down
Loading

0 comments on commit c5e613e

Please sign in to comment.