Skip to content

Commit

Permalink
Merge branch 'main' into better-deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Uroš Marolt committed Jan 9, 2024
2 parents 0479efc + f2a3eca commit 9640053
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 10 deletions.
19 changes: 19 additions & 0 deletions backend/src/database/repositories/memberRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,25 @@ class MemberRepository {
})
}

const seq = SequelizeRepository.getSequelize(options)
result.segments = await seq.query(
`
SELECT
s.id,
s.name
FROM mv_activities_cube a
JOIN segments s ON s.id = a."segmentId"
WHERE a."memberId" = :id
GROUP BY s.id
`,
{
replacements: {
id,
},
type: QueryTypes.SELECT,
},
)

return result
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const connect = () => {
icon: 'ri-information-line',
confirmButtonText: 'I\'m the GitHub organization admin',
cancelButtonText: 'Invite organization admin to this workspace',
verticalCancelButtonClass: 'btn btn--md btn--bordererd w-full',
verticalCancelButtonClass: 'btn btn--md bg-white hover:bg-gray-100 shadow border border-gray-50 w-full hover:text-gray-600 hover:border-gray-100',
verticalConfirmButtonClass: 'btn btn--md btn--primary w-full !mb-2',
vertical: true,
distinguishCancelAndClose: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
&& props.integration.connectComponent
"
:integration="props.integration"
@invite-colleagues="emit('inviteColleagues')"
>
<template
#default="{
Expand Down Expand Up @@ -73,6 +74,7 @@ const props = defineProps({
default: () => ({}),
},
});
const emit = defineEmits(['inviteColleagues']);
const isCalDialogOpen = ref();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ import AppFormItem from '@/shared/form/form-item.vue';
import useVuelidate from '@vuelidate/core';
import AppOnboardUserArrayInput from '@/modules/onboard/components/onboard-user-array-input.vue';
import { RoleEnum } from '@/modules/user/types/Roles';
import { minValue } from '@vuelidate/validators';
type Form = {
activeIntegrations: number;
invitedUsers: {
emails: string[];
roles: string[];
Expand All @@ -58,7 +60,11 @@ const form = computed<Form>({
},
});
const $v = useVuelidate({}, form);
const $v = useVuelidate({
activeIntegrations: {
minValue: minValue(1),
},
}, form);
const addUser = () => {
form.value.invitedUsers.push({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ const inviteColleagues: OnboardStepConfig = {
name: 'Invite colleagues',
component: AppOnboardInviteColleaguesStep,
cta: 'Finish setup',
ctaTooltip: ({ activeIntegrations }) => {
if (!activeIntegrations) {
return 'To proceed, go back and click on the Sync data step to connect at least 1 integration';
}

return null;
},
textColor: (currentStep: number) => ({
'text-gray-400': currentStep < 3,
'text-brand-400': currentStep > 3,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/modules/onboard/config/steps/sync-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const syncData: OnboardStepConfig = {
name: 'Sync data',
component: AppOnboardSyncDataStep,
cta: 'Continue',
ctaTooltip: 'Connect at least 1 integration to proceed',
ctaTooltip: () => 'Connect at least 1 integration to proceed',
submitActionInfo: 'Although you have integrations getting set up, you can proceed with the workspace setup.',
sideInfo: [
{
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/modules/onboard/pages/onboard-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
</div>
<el-tooltip
placement="top"
:disabled="!stepConfig.ctaTooltip || !$v.$invalid"
:content="stepConfig.ctaTooltip"
:disabled="!stepConfig.ctaTooltip?.(form) || !$v.$invalid"
:content="stepConfig.ctaTooltip?.(form)"
>
<div>
<el-button
Expand Down
17 changes: 12 additions & 5 deletions frontend/src/modules/onboard/types/OnboardStepsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ export interface OnboardStepConfig {
name: string;
component: any;
textColor: (currentStep: number) => {
[key: string]: boolean
}
[key: string]: boolean;
};
bgColor: (currentStep: number) => {
[key: string]: boolean
}
[key: string]: boolean;
};
cta: string;
ctaTooltip?: string;
ctaTooltip?: (form: {
tenantName: string;
activeIntegrations: number;
invitedUsers: {
emails: string[];
roles: string[];
}[];
}) => string | null;
submitActionInfo?: string;
sideInfo?: {
icon: string;
Expand Down

0 comments on commit 9640053

Please sign in to comment.