Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinGe00 committed Sep 26, 2023
1 parent 85a548b commit 0ea200a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
16 changes: 10 additions & 6 deletions coral-service/frontend/src/app/components/Forms/DBQueryForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ export default function DBQueryForm() {
async function onSubmit(event) {
event.preventDefault();

await fetch(process.env.NEXT_PUBLIC_CORAL_SERVICE_API_URL + '/api/catalog-ops/execute', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
await fetch(
process.env.NEXT_PUBLIC_CORAL_SERVICE_API_URL +
'/api/catalog-ops/execute',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: statement,
},
body: statement,
})
)
.then((response) => response.text())
.then((data) => {
setCreationResult(data);
Expand Down
27 changes: 12 additions & 15 deletions coral-service/frontend/src/app/components/Forms/TranslationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
import { useState } from 'react';
import LoadingButton from '@/app/components/Buttons/LoadingButton';
const baseUrl = process.env.NEXT_PUBLIC_CORAL_SERVICE_API_URL;
import {
QuestionMarkCircleIcon
} from '@heroicons/react/24/outline';
import { QuestionMarkCircleIcon } from '@heroicons/react/24/outline';

export default function TranslationForm({
onTranslationFetchComplete,
Expand All @@ -23,7 +21,7 @@ export default function TranslationForm({

const formData = new FormData(event.currentTarget);

await fetch( baseUrl + '/api/translations/translate', {
await fetch(baseUrl + '/api/translations/translate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -127,27 +125,26 @@ export default function TranslationForm({
</div>

<div className='col-span-full'>
<div className="flex justify-start ...">
<div className='flex justify-start ...'>
<label
htmlFor='rewriteType'
className='block text-md font-medium leading-6 text-gray-900 mr-1'
htmlFor='rewriteType'
className='block text-md font-medium leading-6 text-gray-900 mr-1'
>
Rewrite Type
</label>

{/* Floating Tooltip */}
<div className="relative flex flex-col items-center group">
<QuestionMarkCircleIcon className='h-6 w-6'
/>
<div className="absolute bottom-0 flex flex-col items-center hidden mb-6 group-hover:flex">
<span
className="relative z-10 p-2 text-xs leading-none text-white whitespace-no-wrap bg-black shadow-lg w-48">A rewrite type to apply on the input query.</span>
<div className="w-4 h-4 -mt-3 rotate-45 bg-black"></div>
<div className='relative flex flex-col items-center group'>
<QuestionMarkCircleIcon className='h-6 w-6' />
<div className='absolute bottom-0 flex flex-col items-center hidden mb-6 group-hover:flex'>
<span className='relative z-10 p-2 text-xs leading-none text-white whitespace-no-wrap bg-black shadow-lg w-48'>
A rewrite type to apply on the input query.
</span>
<div className='w-4 h-4 -mt-3 rotate-45 bg-black'></div>
</div>
</div>
</div>


<div className='mt-2'>
<select
id='rewriteType'
Expand Down
12 changes: 6 additions & 6 deletions coral-service/frontend/src/app/page.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import NavBar from '@/app/components/NavBar';
import DBQueryForm from '@/app/components/Forms/DBQueryForm';
import Image from "next/image";
import Image from 'next/image';

// Home page also acts as database query page
export default function Home() {
return (
<>
<NavBar />
<Image
width='200'
height='200'
className='mx-auto pt-4'
src='/coral-logo.jpg'
alt='Coral Logo'
width='200'
height='200'
className='mx-auto pt-4'
src='/coral-logo.jpg'
alt='Coral Logo'
/>
<DBQueryForm />
</>
Expand Down
10 changes: 5 additions & 5 deletions coral-service/frontend/src/app/translation/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export default function TranslationPage() {
<NavBar />

<Image
width='200'
height='200'
className='mx-auto pt-4'
src='/coral-logo.jpg'
alt='Coral Logo'
width='200'
height='200'
className='mx-auto pt-4'
src='/coral-logo.jpg'
alt='Coral Logo'
/>

<TranslationForm
Expand Down

0 comments on commit 0ea200a

Please sign in to comment.