Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ import { IntegrationService } from '@/modules/integration/integration-service';

const props = defineProps<{
config: IntegrationConfig,
progress: IntegrationProgress | null,
progress: IntegrationProgress[] | null,
progressError: boolean
}>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const props = defineProps<{
modelValue?: string,
}>();

const emit = defineEmits<{(e: 'update:modelValue', value: string)}>();
const emit = defineEmits<{(e: 'update:modelValue', value: string): void}>();

const model = computed({
get() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<div class="flex items-center gap-1.5">
<lf-icon name="circle-notch" type="solid" class="text-gray-500 animate-spin" :size="16" />
<app-integration-progress-bar
:progress="progress.find((p) => p.platform === integration.platform)"
:progress="progress?.find((p) => p.platform === integration.platform)"
hide-bar
text-class="!text-tiny"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ const onSuccess = () => {
emit('onSuccess');
};

const onError = (error: AxiosError) => {
const onError = (error: AxiosError<string>) => {
ToastStore.error(
error?.response?.data ? error.response.data
: `Something went wrong while ${props.id ? 'updating' : 'creating'} the project`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { computed } from 'vue';
import LfIcon from '@/ui-kit/icon/Icon.vue';

const props = defineProps<{
progress: IntegrationProgress | null,
progress: IntegrationProgress | null | undefined,
barOnly?: boolean,
hideBar?: boolean,
textClass?: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,14 @@ const props = withDefaults(defineProps<{
segments: () => ([]),
});

const progress = ref<IntegrationProgress | null>(null);
const progress = ref<IntegrationProgress[] | null>(null);
const progressError = ref(false);

const fetchUpdates = () => {
IntegrationService.fetchIntegrationsProgress(props.segments)
.then((data: IntegrationProgress) => {
const parsedData = data.platform === 'github-nango' ? {
...data,
platform: 'github',
} : data;

progress.value = parsedData;
if (parsedData.length === 0) {
.then((data: IntegrationProgress[]) => {
progress.value = data;
if (data.length === 0) {
pause();
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const props = defineProps<{
showParts?: boolean,
}>();

const statusPriority = {
const statusPriority: Record<string, number> = {
ok: 1,
'in-progress': 2,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import AppIntegrationProgress from '@/modules/integration/components/integration
import AppIntegrationProgressWrapper from '@/modules/integration/components/integration-progress-wrapper.vue';
import { lfIntegrations } from '@/config/integrations';
import { ToastStore } from '@/shared/message/notification';
import type { IntegrationProgress } from '@/modules/integration/types/IntegrationProgress';

export const showIntegrationProgressNotification = (platform, segmentId) => {
export const showIntegrationProgressNotification = (platform: string, segmentId: string) => {
const label = lfIntegrations()[platform]?.name;
const defaultSlot = ({ progress }) => {
const integrationProgress = (progress || []).find((p) => p.platform === platform);
const defaultSlot = ({ progress }: { progress: IntegrationProgress[] | null }) => {
const integrationProgress = (progress || []).find((p: IntegrationProgress) => p.platform === platform);
const text = h('p', {
class: 'text-2xs text-black leading-4.5 pb-4',
}, 'Sit back and relax. We will send you an email when the entire process is completed.');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export interface IntegrationProgress {
data: Record<string, any>
percentage?: number;
platform: string;
reportStatus: 'ok' | 'in-progress' | 'calculating';
segmentId: string;
Expand Down
24 changes: 14 additions & 10 deletions frontend/src/modules/lf/segments/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ const isAdminOnly = () => {

export default {
// Project Groups
listProjectGroups({
search = null, offset, limit, reset = false, adminOnly,
} = {}) {
listProjectGroups({ search = null, offset, limit, reset = false, adminOnly } = {}) {
if (reset) {
this.projectGroups.pagination = {
pageSize: 20,
Expand Down Expand Up @@ -132,9 +130,7 @@ export default {
},
// Projects
/** @param {{ parentSlug?: string | null, search?: string | null, offset?: number, limit?: number, reset?: boolean }} [params] */
listProjects({
parentSlug = null, search = null, offset, limit, reset = false,
} = {}) {
listProjects({ parentSlug = null, search = null, offset, limit, reset = false } = {}) {
this.projects.loading = true;

if (parentSlug) {
Expand Down Expand Up @@ -201,7 +197,9 @@ export default {
this.listProjects();
})
.catch((err) => {
ToastStore.error(getAxiosErrorMessage(err, 'Something went wrong while creating the project'));
ToastStore.error(
getAxiosErrorMessage(err, 'Something went wrong while creating the project'),
);
})
.finally(() => Promise.resolve());
},
Expand All @@ -212,7 +210,9 @@ export default {
this.updateProjectList(id, data);
})
.catch((err) => {
ToastStore.error(getAxiosErrorMessage(err, 'Something went wrong while updating the project'));
ToastStore.error(
getAxiosErrorMessage(err, 'Something went wrong while updating the project'),
);
})
.finally(() => Promise.resolve());
},
Expand Down Expand Up @@ -244,7 +244,9 @@ export default {
this.listProjects();
})
.catch((err) => {
ToastStore.error(getAxiosErrorMessage(err, 'Something went wrong while creating the sub-project'));
ToastStore.error(
getAxiosErrorMessage(err, 'Something went wrong while creating the sub-project'),
);
})
.finally(() => Promise.resolve());
},
Expand All @@ -255,7 +257,9 @@ export default {
this.listProjects();
})
.catch((err) => {
ToastStore.error(getAxiosErrorMessage(err, 'Something went wrong while updating the sub-project'));
ToastStore.error(
getAxiosErrorMessage(err, 'Something went wrong while updating the sub-project'),
);
})
.finally(() => Promise.resolve());
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<span class="text-sm font-medium">In progress</span>
</div>
<app-integration-progress-bar
:progress="progress.find((p) => p.platform === integrationStatus.platform)"
:progress="progress?.find((p) => p.platform === integrationStatus.platform)"
hide-bar
text-class="!text-tiny"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import { computed } from 'vue';
import LfIcon from '@/ui-kit/icon/Icon.vue';
import { formatNumber } from '@/utils/number';
import type { OverviewTrends } from '@/modules/admin/modules/overview/types/overview.types';
import type { OverviewTrends } from '../../types/overview.types';

const props = withDefaults(
defineProps<{
Expand Down
20 changes: 12 additions & 8 deletions frontend/src/shared/modules/merge/types/MemberMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ import type { Member } from '@/modules/member/types/Member';
import type { AxiosError } from 'axios';

export interface SuccessMessage {
primaryMember: Member;
secondaryMember: Member;
selectedProjectGroupId: number;
primaryMember: Member;
secondaryMember: Member;
selectedProjectGroupId: number;
}

export interface ErrorMessage {
error: AxiosError
error: AxiosError;
}

export interface MemberMessage {
loadingMessage: () => void;
successMessage: ({ primaryMember, secondaryMember, selectedProjectGroupId }: SuccessMessage) => void;
apiErrorMessage: ({ error }: ErrorMessage) => boolean;
}
loadingMessage: () => void;
successMessage: ({
primaryMember,
secondaryMember,
selectedProjectGroupId,
}: SuccessMessage) => void;
apiErrorMessage: ({ error }: ErrorMessage) => boolean;
}
11 changes: 7 additions & 4 deletions frontend/src/ui-kit/contenteditable/Contenteditable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ const props = defineProps<{

const emit = defineEmits<{(e: 'update:modelValue', value: string): any }>();

const editable = ref<any>(null);
const editable = ref<HTMLElement | null>(null);
const proxy = ref<string>(props.modelValue);
const onInput = (e: InputEvent) => {
const value = e.target?.innerText;
const onInput = (e: Event) => {
// shortcut: cast hides a null target; input events always have one. revisit: if onInput is reused
const value = (e.target as HTMLElement).innerText;
proxy.value = value;
emit('update:modelValue', value);
};

const setDefualtValue = () => {
editable.value.innerText = props.modelValue;
if (editable.value) {
editable.value.innerText = props.modelValue;
}
};

watch(() => props.modelValue, () => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ui-kit/dropdown/Dropdown.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Regular = {
placement: 'bottom-start',
width: 'auto',
},
render: (args) => ({
render: (args: Record<string, unknown>) => ({
components: {
LfDropdown,
LfDropdownItem,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ui-kit/dropdown/DropdownItem.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const Regular = {
disabled: false,
type: 'regular',
},
render: (args) => ({
render: (args: Record<string, unknown>) => ({
components: {
LfDropdownItem,
},
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/ui-kit/field-messages/FieldMessages.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,20 @@

<script setup lang="ts">
import { computed } from 'vue';
import type { ErrorObject } from '@vuelidate/core';
import LfFieldMessage from '@/ui-kit/field-message/FieldMessage.vue';

const props = withDefaults(defineProps<{
validation: any,
errorMessages?: Record<string, string>
errorMessages?: Record<string, string>,
hideDefault?: boolean,
}>(), {
errorMessages: () => ({}),
});

const errors = computed(() => (props.validation?.$errors || []));

const errorMessage = (error) => {
const errorMessage = (error: ErrorObject) => {
const prop = error.$validator;
if (
props.errorMessages
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/ui-kit/lfx/popover/popover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ const scheduleClose = () => {
};

onMounted(() => {
if (import.meta.client) {
// shortcut: import.meta.client is always undefined under Vite (bug on main). revisit: fix hover popovers
if ((import.meta as ImportMeta & { client?: boolean }).client) {
createPopperInstance();
if (props.triggerEvent === 'hover') {
trigger.value?.addEventListener('mouseenter', openPopover);
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/ui-kit/search/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<template #prefix>
<lf-icon name="search" />
</template>
<template v-if="valueProxy.length" #suffix>
<template v-if="typeof valueProxy === 'string' && valueProxy.length" #suffix>
<div @click="valueProxy = ''">
<lf-icon name="xmark-circle" type="regular" class="text-gray-300" />
</div>
Expand All @@ -24,7 +24,7 @@ const props = defineProps<{

const emit = defineEmits<{(e: 'update:modelValue', value: string | number): any }>();

const valueProxy = ref<string>(props.modelValue);
const valueProxy = ref<string | number>(props.modelValue);

const emitValue = (value: string | number) => emit('update:modelValue', value);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/ui-kit/tabs/Tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const parent = computed(() => {
return instance?.parent;
});

const isActive = computed<boolean>(() => parent.value.props.modelValue === props.name);
const isActive = computed<boolean>(() => parent.value?.props.modelValue === props.name);

const selectTab = () => {
parent.value?.emit('update:modelValue', props.name);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/utils/logRocket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { User } from '@/modules/user/types/User';

const APP_ID = 'nm6fil/crowddev';

const isLogRocketEnabled: () => void = () => config.env === 'production';
const isLogRocketEnabled: () => boolean = () => config.env === 'production';

const init = () => {
if (isLogRocketEnabled()) {
Expand Down
2 changes: 1 addition & 1 deletion frontend/typecheck-baseline.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{ "errors": 66 }
{ "errors": 31 }
Loading