Skip to content

Commit

Permalink
Fix indentation in Home Page (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
guergana committed Dec 28, 2023
1 parent 25c0a6f commit df9d939
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions resources/js/Pages/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,58 +99,58 @@
</template>

<script setup lang="ts">
import { Head as InertiaHead, usePage } from '@inertiajs/inertia-vue3';
import { useStore } from '../store';
import { CdxDialog, CdxButton, CdxIcon, CdxMessage } from "@wikimedia/codex";
import { cdxIconDie, cdxIconInfo } from '@wikimedia/codex-icons';
import ItemIdSearchTextarea from '../Components/ItemIdSearchTextarea.vue';
import { ref, computed } from 'vue';
import type { Ref } from 'vue';
import { Inertia } from '@inertiajs/inertia';
interface ErrorMessages {
[ key : string ] : string
}
import { Head as InertiaHead, usePage } from '@inertiajs/inertia-vue3';
import { useStore } from '../store';
import { CdxDialog, CdxButton, CdxIcon, CdxMessage } from "@wikimedia/codex";
import { cdxIconDie, cdxIconInfo } from '@wikimedia/codex-icons';
import ItemIdSearchTextarea from '../Components/ItemIdSearchTextarea.vue';
import { ref, computed } from 'vue';
import type { Ref } from 'vue';
import { Inertia } from '@inertiajs/inertia';
interface ErrorMessages {
[ key : string ] : string
}
interface FlashMessages {
errors : { [ key : string ] : string }
}
interface FlashMessages {
errors : { [ key : string ] : string }
}
const textarea = ref<InstanceType<typeof ItemIdSearchTextarea> | null>(null);
const store = useStore();
const page = usePage();
const textareaInputValue: Ref<string> = ref(store.lastSearchedIds);
const textarea = ref<InstanceType<typeof ItemIdSearchTextarea> | null>(null);
const store = useStore();
const page = usePage();
const textareaInputValue: Ref<string> = ref(store.lastSearchedIds);
const faqDialog = ref(false);
const faqDialog = ref(false);
const serversideValidationError = computed<boolean>(() => {
const errors = page.props.value.errors as ErrorMessages;
return errors && Object.keys(errors).length > 0;
});
const serversideValidationError = computed<boolean>(() => {
const errors = page.props.value.errors as ErrorMessages;
return errors && Object.keys(errors).length > 0;
});
const unexpectedError = computed<string>(() => {
const flashMessages = page.props.value.flash as FlashMessages;
return (flashMessages.errors && flashMessages.errors.unexpected);
});
const unexpectedError = computed<string>(() => {
const flashMessages = page.props.value.flash as FlashMessages;
return (flashMessages.errors && flashMessages.errors.unexpected);
});
const loading = computed<boolean>(() => {
return (store.loading);
});
const loading = computed<boolean>(() => {
return (store.loading);
});
function send(): void{
(textarea as InstanceType<typeof ItemIdSearchTextarea>).value.validate();
function send(): void{
(textarea as InstanceType<typeof ItemIdSearchTextarea>).value.validate();
if((textarea as InstanceType<typeof ItemIdSearchTextarea>).value.validationError) {
return;
}
store.saveSearchedIds( textareaInputValue.value );
Inertia.get( '/results',
{ ids: (textarea as InstanceType<typeof ItemIdSearchTextarea>).value.serializeInput() }
);
if((textarea as InstanceType<typeof ItemIdSearchTextarea>).value.validationError) {
return;
}
store.saveSearchedIds( textareaInputValue.value );
Inertia.get( '/results',
{ ids: (textarea as InstanceType<typeof ItemIdSearchTextarea>).value.serializeInput() }
);
}
function showRandom(): void{
Inertia.get( '/random' );
}
function showRandom(): void{
Inertia.get( '/random' );
}
</script>

<style lang="scss">
Expand Down

0 comments on commit df9d939

Please sign in to comment.