Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Gearing Table and begins vuetify migration #405

Merged
merged 8 commits into from
Jan 11, 2024
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
987 changes: 248 additions & 739 deletions components/GearboxCalculator.vue

Large diffs are not rendered by default.

107 changes: 50 additions & 57 deletions components/NeedleTable.vue
Original file line number Diff line number Diff line change
@@ -1,62 +1,55 @@
<script lang="ts" setup>
import needlesTables from '~/data/suggestedNeedles.json';
const tables = ref(needlesTables);
const { data: needlesTables, pending, error }: any = await useFetch(() => '/api/needles/suggested');
const tableHeaders: any[] = [
{
title: 'Engine Size',
key: 'engineSize',
align: 'start',
},
{
title: 'Needle Std',
key: 'needleStd',
},
{
title: 'Needle Rich',
key: 'needleRich',
},
{
title: 'Needle Lean',
key: 'needleLean',
},
{
title: 'Spring Type',
key: 'springType',
},
];
</script>

<template>
<div class="column is-12">
<template v-for="(table, name, index) in tables" :key="index">
<div class="column is-12">
<div class="card">
<div class="card-header">
<h2 class="card-header-title">
<span class="pl-2">{{ table.title }}</span>
</h2>
</div>
<div class="card-content">
<client-only>
<o-table
:data="table.items"
:narrowed="true"
:hoverable="true"
:paginated="table.items.length >= 14 ? true : false"
:per-page="10"
icon-pack="fas"
:mobile-cards="false"
>
<o-table-column field="engineSize" label="Engine Size" v-slot:default="props">
<span v-html="props.row.engineSize"></span>
</o-table-column>
<o-table-column field="needleStd" label="Needle Std" v-slot:default="props">
<span v-html="props.row.needleStd"></span>
</o-table-column>
<o-table-column field="needleRich" label="Needle Rich" v-slot:default="props">
<span v-html="props.row.needleRich"></span>
</o-table-column>
<o-table-column field="needleLean" label="Needle Lean" v-slot:default="props">
<span v-html="props.row.needleLea"></span>
</o-table-column>
<o-table-column field="springType" label="Spring Type" v-slot:default="props">
<span v-html="props.row.springType"></span>
</o-table-column>
</o-table>
</client-only>
</div>
</div>
</div>
<div v-if="index === 2" :key="`${name}-${index}-patreon`" class="column is-12">
<div class="card">
<div class="card-content">
<patreon-card size="large" />
</div>
</div>
</div>
</template>
</div>
<v-row>
<v-col v-for="(table, name, index) in needlesTables" :key="index" cols="12">
<v-card>
<v-toolbar color="primary">
<v-icon class="ml-4" icon="fad fa-list-timeline"></v-icon>
<v-toolbar-title>{{ table.title }}</v-toolbar-title>
</v-toolbar>
<v-card-text>
<v-data-table :loading="pending" :items="table.items" density="compact" :headers="tableHeaders" fixed-header>
<template v-slot:item.needleStd="{ item }">
<p class="mt-4 text-subtitle-1 text-capitalize" v-html="item.needleStd"></p>
</template>
<template v-slot:item.needleRich="{ item }">
<p class="mt-4 text-subtitle-1 text-capitalize" v-html="item.needleRich"></p>
</template>
<template v-slot:item.needleLean="{ item }">
<p class="mt-4 text-subtitle-1 text-capitalize" v-html="item.needleLean"></p>
</template>
<template v-slot:item.springType="{ item }">
<p class="mt-4 text-subtitle-1 text-capitalize" v-html="item.springType"></p>
</template>
</v-data-table>
</v-card-text>
</v-card>
</v-col>
</v-row>
</template>

<style lang="scss" scoped>
.card-header {
background-color: whitesmoke;
}
</style>
27 changes: 10 additions & 17 deletions components/RegistrySubmission.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@
:items="['Saloon', 'Pickup', 'Estate', 'Cabriolet', 'Clubman', 'Van', 'Hornet']"
variant="outlined"
></v-select>
<!-- <o-field class="pb-3" :label-position="'on-border'" label="Build or First Registration Date">
<VueDatePicker v-model="details.buildDate" format="MM/dd/yyyy"></VueDatePicker>
</o-field> -->
</div>
<div class="column is-half">
<v-text-field
Expand Down Expand Up @@ -160,14 +157,9 @@
</div>
</div>
<div v-if="!admin">
<o-button
:disabled="!form"
class="card-footer-item"
label="Submit"
variant="primary"
size="medium"
@click="submit()"
/>
<v-btn :disabled="!form" prepend-icon="fad fa-paper-plane" size="x-large" color="primary" @click="submit()">
Submit
</v-btn>
</div>
<div v-if="admin">
<v-text-field
Expand All @@ -186,14 +178,15 @@
append-inner-icon="fad fa-asterisk"
variant="outlined"
></v-text-field>
<o-button
<v-btn
:disabled="!form"
class="card-footer-item"
label="Submit"
variant="primary"
size="medium"
prepend-icon="fad fa-paper-plane"
size="x-large"
color="primary"
@click="adminSubmit()"
/>
>
Submit
</v-btn>
</div>
</v-form>
</div>
Expand Down
35 changes: 0 additions & 35 deletions components/SkeletonLoader.vue

This file was deleted.

40 changes: 14 additions & 26 deletions components/WheelSubmit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
});
import type { IWheelsData } from '~/data/models/wheels';
import { humanFileSize } from '~/data/models/helper-utils';
import { useRecaptchaToken } from '~/composables/recaptcha';
const wheel = ref();
const pageLoad = ref(true);
const pageError = ref();
Expand Down Expand Up @@ -82,31 +81,20 @@
async function sendNewInfo() {
loading.value = true;

await useRecaptchaToken()
.then(async (res) => {
if (res) {
await storeWheelDetails().then(async (res: any) => {
await storeWheelImages(res?.data?._rawValue.uuid)
.then(() => {
hasSuccess.value = true;
step.value = 5;
})
.catch((err) => {
hasError.value = true;
console.error(err);
})
.finally(() => {
loading.value = false;
});
});
} else {
console.warn('Recaptcha failed');
}
})
.catch((err) => {
submitError.value = true;
console.error(`Recaptcha failed - ${err}`);
});
await storeWheelDetails().then(async (res: any) => {
await storeWheelImages(res?.data?._rawValue.uuid)
.then(() => {
hasSuccess.value = true;
step.value = 5;
})
.catch((err) => {
hasError.value = true;
console.error(err);
})
.finally(() => {
loading.value = false;
});
});
}

async function storeWheelDetails() {
Expand Down
5 changes: 0 additions & 5 deletions composables/recaptcha.ts

This file was deleted.

Loading