fix: tax id, add feedback project

This commit is contained in:
Arman committed 2023-12-04 17:12:05 +01:00
1 parent be7af56214
commit 95b88842a6
5 files changed
+33 -8

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ export type Organization = Models.Team<Record<string, unknown>> & {
billingTrialDays?: number;
billingAddressId?: string;
amount: number;
taxId?: string;
billingTaxId?: string;
};
export type BillingLimits = {
@@ -12,13 +12,13 @@
let taxId: string;
onMount(() => {
taxId = $organization?.taxId;
taxId = $organization?.billingTaxId;
});
async function updateTaxId() {
try {
await sdk.forConsole.billing.updateTaxId($organization.$id, taxId);
await invalidate(Dependencies.ADDRESS);
await invalidate(Dependencies.ORGANIZATION);
addNotification({
type: 'success',
message: `${$organization.name} tax ID has been successfully updated`
@@ -49,7 +49,7 @@
</svelte:fragment>
<svelte:fragment slot="actions">
<Button disabled={$organization?.taxId === taxId} submit>Update</Button>
<Button disabled={$organization?.billingTaxId === taxId} submit>Update</Button>
</svelte:fragment>
</CardGrid>
</Form>
+3 -2
View File
@@ -42,7 +42,7 @@
{ id: '41612', value: $supportData.category },
{ id: '48493', value: $user?.name ?? '' },
{ id: '48492', value: $organization.$id ?? '' },
// { id: '48491', value: $user?.projectId ?? '' },
{ id: '48491', value: $supportData?.project ?? '' },
{ id: '48490', value: $user?.$id ?? '' }
]
})
@@ -68,7 +68,8 @@
$supportData = {
message: null,
category: 'general',
file: null
file: null,
project: null
};
}
</script>
+25 -2
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { FormList, InputTextarea } from '$lib/elements/forms';
import { FormList, InputSelect, InputTextarea } from '$lib/elements/forms';
import { WizardStep } from '$lib/layout';
import { app } from '$lib/stores/app';
import { wizard } from '$lib/stores/wizard';
@@ -7,11 +7,25 @@
import Light from '$lib/images/support/support-wizard-light.svg';
import Dark from '$lib/images/support/support-wizard-dark.svg';
import { Pill } from '$lib/elements';
import { onMount } from 'svelte';
import { sdk } from '$lib/stores/sdk';
// import { Collapsible, CollapsibleItem } from '$lib/components';
// let files: FileList;
$wizard.media = $app.themeInUse === 'dark' ? Dark : Light;
// let files: FileList;
let options: {
value: string;
label: string;
}[];
onMount(async () => {
const projectList = await sdk.forConsole.projects.list();
options = projectList.projects.map((project) => ({
value: project.$id,
label: project.name
}));
});
</script>
<WizardStep>
@@ -35,6 +49,15 @@
</div>
<div class="common-section">
<FormList>
{#if options?.length}
<InputSelect
id="project"
label="Choose a project"
placeholder="Select project"
optionalText="(optional)"
bind:value={$supportData.project}
{options} />
{/if}
<InputTextarea
label="Tell us a bit more"
id="message"
@@ -4,6 +4,7 @@ export type SupportData = {
message: string;
category: string;
file?: File | null;
project?: string
};
export const supportData = writable<SupportData>({