fix: linter issues

This commit is contained in:
Arman
2023-12-19 10:39:17 +01:00
parent c610061658
commit 51fe5f05da
6 changed files with 33 additions and 37 deletions
+4 -5
View File
@@ -37,7 +37,6 @@
<Label {required} {hideRequired} {tooltip} {optionalText} hide={!showLabel} for={id}>
{label}
</Label>
<!-- <span class="label" use:label>Hotel Nights</span> -->
{/if}
<div class="u-flex u-gap-4">
{#if showDates}
@@ -137,10 +136,10 @@
border-radius: 100%;
user-select: none;
[aria-disabled='true'] {
pointer-events: none;
opacity: 0.4;
}
// [aria-disabled='true'] {
// pointer-events: none;
// opacity: 0.4;
// }
}
.dt-button {
aspect-ratio: 1/1;
+2 -1
View File
@@ -34,7 +34,8 @@
let showDropdown = false;
const { bandwidth, documents, storage, users, executions } = $organization?.billingLimits;
const { bandwidth, documents, storage, users, executions } = ($organization ?? {})
.billingLimits;
const limitedServices = [
{ name: 'bandwidth', value: bandwidth },
{ name: 'documents', value: documents },
+1 -1
View File
@@ -25,7 +25,7 @@ function createHeaderAlertStore() {
if (n.components.some((c) => c.id === component.id)) return n;
else {
n.components.push(component);
n.components = n.components;
n.components = [...n.components];
return n;
}
});
+16 -20
View File
@@ -18,27 +18,23 @@ export async function initializeStripe() {
if (!get(stripe)) return;
isStripeInitialized.set(true);
try {
const methods = await sdk.forConsole.billing.listPaymentMethods();
clientSecret = methods.paymentMethods[0]?.clientSecret;
// If there is no payment method, create an empty one and get the client secret
if (!clientSecret) {
paymentMethod = await sdk.forConsole.billing.createPaymentMethod();
clientSecret = paymentMethod.clientSecret;
}
// Set up the options for the stripe elements
const options = {
clientSecret: clientSecret,
appearance: get(app).themeInUse === 'dark' ? apperanceDark : apperanceLight
};
// Set up Elements and then create form
elements = get(stripe).elements(options);
paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
} catch (e) {
throw e;
const methods = await sdk.forConsole.billing.listPaymentMethods();
clientSecret = methods.paymentMethods[0]?.clientSecret;
// If there is no payment method, create an empty one and get the client secret
if (!clientSecret) {
paymentMethod = await sdk.forConsole.billing.createPaymentMethod();
clientSecret = paymentMethod.clientSecret;
}
// Set up the options for the stripe elements
const options = {
clientSecret: clientSecret,
appearance: get(app).themeInUse === 'dark' ? apperanceDark : apperanceLight
};
// Set up Elements and then create form
elements = get(stripe).elements(options);
paymentElement = elements.create('payment');
paymentElement.mount('#payment-element');
}
// TODO: fix redirect
+9 -9
View File
@@ -248,16 +248,16 @@
if (isCloud) {
if (!$page.url.pathname.includes('/console/onboarding')) {
}
try {
const orgs = await sdk.forConsole.teams.list([
Query.equal('billingPlan', 'tier-0')
]);
try {
const orgs = await sdk.forConsole.teams.list([
Query.equal('billingPlan', 'tier-0')
]);
checkForPostReleaseProModal(orgs);
checkForFreeOrgOverflow(orgs);
} catch (error) {
console.log(error);
checkForPostReleaseProModal(orgs);
checkForFreeOrgOverflow(orgs);
} catch (error) {
console.log(error);
}
}
}
@@ -40,13 +40,13 @@
}
function format(value: number): string {
const humanized = humanFileSize(value);
switch (metric) {
case 'executions':
case 'users':
return abbreviateNumber(value);
case 'storage':
case 'bandwidth':
const humanized = humanFileSize(value);
return humanized.value + humanized.unit;
}
}