diff --git a/api/index.js b/api/index.js index 69713af..9abb8b1 100644 --- a/api/index.js +++ b/api/index.js @@ -7,38 +7,33 @@ app.use(express.json()) const port = 3000 -var application; -var applicationMessages = []; -var applicationStatus; +let applicationData = { + app: null, + messages: [], + status: null, +}; app.post('/application', (req, res) => { - data = req.body - application = data.App; - applicationStatus = "Pending"; - console.log(data); - res.send('Application received') + const data = req.body; + applicationData.app = data.App; + applicationData.status = "Pending"; + console.log(applicationData); + res.send('Application received'); }); app.get('/application/me', (req, res) => { - if (application) { - let data = { - "app": application, - "messages": applicationMessages, - "Status": applicationStatus, - } - res.send(data); - } - else { + if (applicationData.app) { + res.send(applicationData); + } else { res.status(204).send(); } }); app.post('/application/message', (req, res) => { - data = req.body - applicationMessages.push(data); - res.status(200); -}) - + const data = req.body; + applicationData.messages.push(data); + res.status(200).send(); +}); app.listen(port, () => { console.log(`Example app listening on port ${port}`) diff --git a/ui/package-lock.json b/ui/package-lock.json index 10dbc67..d42d180 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "dependencies": { "@tailwindcss/vite": "^4.1.11", + "@tanstack/vue-table": "^8.21.3", "@vee-validate/zod": "^4.15.1", "@vueuse/core": "^13.7.0", "class-variance-authority": "^0.7.1", @@ -1621,6 +1622,19 @@ "vite": "^5.2.0 || ^6 || ^7" } }, + "node_modules/@tanstack/table-core": { + "version": "8.21.3", + "resolved": "https://registry.npmjs.org/@tanstack/table-core/-/table-core-8.21.3.tgz", + "integrity": "sha512-ldZXEhOBb8Is7xLs01fR3YEc3DERiz5silj8tnGkFZytt1abEvl/GhUmCE0PMLaMPTa3Jk4HbKmRlHmu+gCftg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + } + }, "node_modules/@tanstack/virtual-core": { "version": "3.13.12", "resolved": "https://registry.npmjs.org/@tanstack/virtual-core/-/virtual-core-3.13.12.tgz", @@ -1631,6 +1645,25 @@ "url": "https://github.com/sponsors/tannerlinsley" } }, + "node_modules/@tanstack/vue-table": { + "version": "8.21.3", + "resolved": "https://registry.npmjs.org/@tanstack/vue-table/-/vue-table-8.21.3.tgz", + "integrity": "sha512-rusRyd77c5tDPloPskctMyPLFEQUeBzxdQ+2Eow4F7gDPlPOB1UnnhzfpdvqZ8ZyX2rRNGmqNnQWm87OI2OQPw==", + "license": "MIT", + "dependencies": { + "@tanstack/table-core": "8.21.3" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/tannerlinsley" + }, + "peerDependencies": { + "vue": ">=3.2" + } + }, "node_modules/@tanstack/vue-virtual": { "version": "3.13.12", "resolved": "https://registry.npmjs.org/@tanstack/vue-virtual/-/vue-virtual-3.13.12.tgz", diff --git a/ui/package.json b/ui/package.json index e4d378d..4424d70 100644 --- a/ui/package.json +++ b/ui/package.json @@ -13,6 +13,7 @@ }, "dependencies": { "@tailwindcss/vite": "^4.1.11", + "@tanstack/vue-table": "^8.21.3", "@vee-validate/zod": "^4.15.1", "@vueuse/core": "^13.7.0", "class-variance-authority": "^0.7.1", diff --git a/ui/src/App.vue b/ui/src/App.vue index 71ac5fb..178e2e0 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -4,6 +4,7 @@ import Separator from './components/ui/separator/Separator.vue'; import Button from './components/ui/button/Button.vue'; import Application from './pages/Application.vue'; import AutoForm from './components/form/AutoForm.vue'; +import ManageApplications from './pages/ManageApplications.vue'; diff --git a/ui/src/components/ui/table/Table.vue b/ui/src/components/ui/table/Table.vue new file mode 100644 index 0000000..71bd0a9 --- /dev/null +++ b/ui/src/components/ui/table/Table.vue @@ -0,0 +1,18 @@ + + + diff --git a/ui/src/components/ui/table/TableBody.vue b/ui/src/components/ui/table/TableBody.vue new file mode 100644 index 0000000..3cfac53 --- /dev/null +++ b/ui/src/components/ui/table/TableBody.vue @@ -0,0 +1,16 @@ + + + diff --git a/ui/src/components/ui/table/TableCaption.vue b/ui/src/components/ui/table/TableCaption.vue new file mode 100644 index 0000000..2a4488e --- /dev/null +++ b/ui/src/components/ui/table/TableCaption.vue @@ -0,0 +1,16 @@ + + + diff --git a/ui/src/components/ui/table/TableCell.vue b/ui/src/components/ui/table/TableCell.vue new file mode 100644 index 0000000..aa0faef --- /dev/null +++ b/ui/src/components/ui/table/TableCell.vue @@ -0,0 +1,21 @@ + + + diff --git a/ui/src/components/ui/table/TableEmpty.vue b/ui/src/components/ui/table/TableEmpty.vue new file mode 100644 index 0000000..0a94d54 --- /dev/null +++ b/ui/src/components/ui/table/TableEmpty.vue @@ -0,0 +1,31 @@ + + + diff --git a/ui/src/components/ui/table/TableFooter.vue b/ui/src/components/ui/table/TableFooter.vue new file mode 100644 index 0000000..89c5ac1 --- /dev/null +++ b/ui/src/components/ui/table/TableFooter.vue @@ -0,0 +1,18 @@ + + + diff --git a/ui/src/components/ui/table/TableHead.vue b/ui/src/components/ui/table/TableHead.vue new file mode 100644 index 0000000..1e8dad9 --- /dev/null +++ b/ui/src/components/ui/table/TableHead.vue @@ -0,0 +1,21 @@ + + + diff --git a/ui/src/components/ui/table/TableHeader.vue b/ui/src/components/ui/table/TableHeader.vue new file mode 100644 index 0000000..616e4dc --- /dev/null +++ b/ui/src/components/ui/table/TableHeader.vue @@ -0,0 +1,13 @@ + + + diff --git a/ui/src/components/ui/table/TableRow.vue b/ui/src/components/ui/table/TableRow.vue new file mode 100644 index 0000000..85f521c --- /dev/null +++ b/ui/src/components/ui/table/TableRow.vue @@ -0,0 +1,21 @@ + + + diff --git a/ui/src/components/ui/table/index.js b/ui/src/components/ui/table/index.js new file mode 100644 index 0000000..0afab4c --- /dev/null +++ b/ui/src/components/ui/table/index.js @@ -0,0 +1,9 @@ +export { default as Table } from "./Table.vue"; +export { default as TableBody } from "./TableBody.vue"; +export { default as TableCaption } from "./TableCaption.vue"; +export { default as TableCell } from "./TableCell.vue"; +export { default as TableEmpty } from "./TableEmpty.vue"; +export { default as TableFooter } from "./TableFooter.vue"; +export { default as TableHead } from "./TableHead.vue"; +export { default as TableHeader } from "./TableHeader.vue"; +export { default as TableRow } from "./TableRow.vue"; diff --git a/ui/src/components/ui/table/utils.js b/ui/src/components/ui/table/utils.js new file mode 100644 index 0000000..ee61875 --- /dev/null +++ b/ui/src/components/ui/table/utils.js @@ -0,0 +1,7 @@ +import { isFunction } from "@tanstack/vue-table"; + +export function valueUpdater(updaterOrValue, ref) { + ref.value = isFunction(updaterOrValue) + ? updaterOrValue(ref.value) + : updaterOrValue; +} diff --git a/ui/src/pages/ManageApplications.vue b/ui/src/pages/ManageApplications.vue new file mode 100644 index 0000000..4616f92 --- /dev/null +++ b/ui/src/pages/ManageApplications.vue @@ -0,0 +1,41 @@ + + \ No newline at end of file