diff --git a/package.json b/package.json index 97a4e4e..69c4e48 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "@quasar/extras": "^1.13.5", "@types/katex": "^0.14.0", "@types/uuid": "^8.3.4", + "@types/validator": "^13.7.2", "@vuetify/vite-plugin": "1.0.0-alpha.10", "chart.js": "^3.7.1", "dependency-graph": "^0.11.0", @@ -28,6 +29,7 @@ "mathjs": "^10.4.3", "quasar": "^2.6.6", "uuid": "^8.3.2", + "validator": "^13.7.0", "vue": "^3.2.25", "vue-chart-3": "^3.1.8", "vue-router": "^4.0.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ca6e784..8827482 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,7 @@ specifiers: '@quasar/vite-plugin': ^1.0.9 '@types/katex': ^0.14.0 '@types/uuid': ^8.3.4 + '@types/validator': ^13.7.2 '@typescript-eslint/eslint-plugin': ^5.18.0 '@typescript-eslint/parser': ^5.18.0 '@vitejs/plugin-vue': ^2.3.1 @@ -22,6 +23,7 @@ specifiers: sass: 1.32.0 typescript: ^4.5.4 uuid: ^8.3.2 + validator: ^13.7.0 vite: ^2.9.0 vue: ^3.2.25 vue-chart-3: ^3.1.8 @@ -34,6 +36,7 @@ dependencies: '@quasar/extras': 1.13.5 '@types/katex': 0.14.0 '@types/uuid': 8.3.4 + '@types/validator': 13.7.2 '@vuetify/vite-plugin': 1.0.0-alpha.10_vite@2.9.1+vuetify@3.0.0-beta.0 chart.js: 3.7.1 dependency-graph: 0.11.0 @@ -42,6 +45,7 @@ dependencies: mathjs: 10.4.3 quasar: 2.6.6 uuid: 8.3.2 + validator: 13.7.0 vue: 3.2.31 vue-chart-3: 3.1.8_chart.js@3.7.1+vue@3.2.31 vue-router: 4.0.14_vue@3.2.31 @@ -393,6 +397,10 @@ packages: resolution: {integrity: sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==} dev: false + /@types/validator/13.7.2: + resolution: {integrity: sha512-KFcchQ3h0OPQgFirBRPZr5F/sVjxZsOrQHedj3zi8AH3Zv/hOLx2OLR4hxR5HcfoU+33n69ZuOfzthKVdMoTiw==} + dev: false + /@types/vfile-message/2.0.0: resolution: {integrity: sha512-GpTIuDpb9u4zIO165fUy9+fXcULdD8HFRNli04GehoMVbeNq7D6OBnqSmg3lxZnC+UvgUhEWKxdKiwYUkGltIw==} deprecated: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed. @@ -3761,6 +3769,11 @@ packages: spdx-expression-parse: 3.0.1 dev: true + /validator/13.7.0: + resolution: {integrity: sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw==} + engines: {node: '>= 0.10'} + dev: false + /vfile-message/1.1.1: resolution: {integrity: sha512-1WmsopSGhWt5laNir+633LszXvZ+Z/lxveBf6yhGsqnQIhlhzooZae7zV6YVM1Sdkw68dtAW3ow0pOdPANugvA==} dependencies: diff --git a/src/App.vue b/src/App.vue index 07e4a36..c61b401 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,14 +1,54 @@ @@ -18,15 +58,14 @@ import { ref } from "vue"; - - Title + Title - + - + @@ -37,12 +76,17 @@ import { ref } from "vue"; diff --git a/src/components/Login.vue b/src/components/Login.vue new file mode 100644 index 0000000..564cb69 --- /dev/null +++ b/src/components/Login.vue @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + {{ error }} + + + + + + + + {{ isRegistration ? 'Have an account?' : 'Not reigistered?' }} + {{ isRegistration ? 'Login' : 'Created an Account' }} + + + + + diff --git a/src/main.ts b/src/main.ts index 21ec924..7f03814 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,8 +20,8 @@ import '@quasar/extras/material-icons/material-icons.css' import '@quasar/extras/fontawesome-v6/fontawesome-v6.css' // A few examples for animations from Animate.css: -// import @quasar/extras/animate/fadeIn.css -// import @quasar/extras/animate/fadeOut.css +import '@quasar/extras/animate/fadeInUp.css' +import '@quasar/extras/animate/fadeOutUp.css' // Import Quasar css import 'quasar/src/css/index.sass' @@ -32,7 +32,6 @@ import 'quasar/src/css/index.sass' -------------------------------------------------- */ import { DraggablePlugin } from '@braks/revue-draggable' -import { createAuth0 } from '@auth0/auth0-vue' import 'katex/dist/katex.min.css' import 'katex/dist/contrib/auto-render.min' @@ -50,14 +49,6 @@ app.use(Quasar, { plugins: {}, // import Quasar plugins and add here }) -app.use( - createAuth0({ - domain: 'dev-ge84r-eu.us.auth0.com', - client_id: 'zHjZGg1uPws0DkQg5bRdKcDX8m6AuTZl', // eslint-disable-line camelcase - redirect_uri: window.location.origin, // eslint-disable-line camelcase - }), -) - app.use(router) app.use(DraggablePlugin) diff --git a/src/pages/Editor.vue b/src/pages/Editor.vue index d76ae09..cc82442 100644 --- a/src/pages/Editor.vue +++ b/src/pages/Editor.vue @@ -1,16 +1,19 @@ @@ -223,13 +253,13 @@ const removeRichTextBox = (id: number) => { - - Title + Title - + + @@ -244,14 +274,12 @@ const removeRichTextBox = (id: number) => { row-key="name" hide-no-data hide-bottom - :pagination="{rowsPerPage: 10000}" + :pagination="{ rowsPerPage: 10000 }" style="height: 100%; border-radius: 0" > - - {{ props.row.name }} - + {{ props.row.name }} @@ -260,7 +288,7 @@ const removeRichTextBox = (id: number) => { - + { hide-no-data hide-bottom hide-header - :pagination="{rowsPerPage: 10000}" + :pagination="{ rowsPerPage: 10000 }" style="height: 100%; border-top: 1px solid lightgrey; border-radius: 0" > @@ -295,7 +323,7 @@ const removeRichTextBox = (id: number) => { :grid="[stepX, stepY]" :position="{ x: statement.x, y: statement.y }" :default-position="{ x: statement.x, y: statement.y }" - @stop="(e: {event: MouseEvent, data: {x: number, y: number}}) => stmOnControlledDragStop(statement)(e)" + @stop="(e: { event: MouseEvent, data: { x: number, y: number } }) => stmOnControlledDragStop(statement)(e)" > { - + - + - + - + @@ -354,16 +371,16 @@ const removeRichTextBox = (id: number) => { @click="() => openNewVariableDeclModal()" /> openNewExpressionModal()" + color="secondary" + icon="code" + title="Add an expression" + @click="() => openNewExpressionModal()" /> openNewFunctionModal()" + color="secondary" + icon="functions" + title="Add a new function" + @click="() => openNewFunctionModal()" /> { - + diff --git a/src/pages/Home.vue b/src/pages/Home.vue new file mode 100644 index 0000000..a2b297b --- /dev/null +++ b/src/pages/Home.vue @@ -0,0 +1,46 @@ + + + + + {{ msg }} + + Start + + + + + + + + + + diff --git a/src/pages/Login.vue b/src/pages/Login.vue deleted file mode 100644 index 2486976..0000000 --- a/src/pages/Login.vue +++ /dev/null @@ -1,33 +0,0 @@ - - - - {{ msg }} - - Log in - - - - diff --git a/src/pages/Scratch.vue b/src/pages/Scratch.vue index 6e54ad8..ba6d7c0 100644 --- a/src/pages/Scratch.vue +++ b/src/pages/Scratch.vue @@ -1,40 +1,43 @@ @@ -43,7 +46,7 @@ - + diff --git a/src/router.ts b/src/router.ts index aaf3d4f..079434c 100644 --- a/src/router.ts +++ b/src/router.ts @@ -1,5 +1,5 @@ import { createRouter, createWebHistory } from 'vue-router' -import Home from './pages/Login.vue' +import Home from './pages/Home.vue' const routes = [ { diff --git a/src/support/auth.ts b/src/support/auth.ts new file mode 100644 index 0000000..fe0b5e2 --- /dev/null +++ b/src/support/auth.ts @@ -0,0 +1,10 @@ +let isLoggedIn = false +export const checkLoggedIn = () => { + return isLoggedIn +} +export const loggedIn = () => { + isLoggedIn = true +} +export const loggedOut = () => { + isLoggedIn = false +}
+ {{ error }} +
+ {{ isRegistration ? 'Have an account?' : 'Not reigistered?' }} + {{ isRegistration ? 'Login' : 'Created an Account' }} +