Skip to content
Open
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
23 changes: 23 additions & 0 deletions airtest/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.DS_Store
node_modules
/dist


# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
24 changes: 24 additions & 0 deletions airtest/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# airtest

## Project setup
```
yarn install
```

### Compiles and hot-reloads for development
```
yarn serve
```

### Compiles and minifies for production
```
yarn build
```

### Lints and fixes files
```
yarn lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
5 changes: 5 additions & 0 deletions airtest/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
53 changes: 53 additions & 0 deletions airtest/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "airtest",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"moment": "^2.29.1",
"moment-timezone": "^0.5.33",
"uuid": "^8.3.2",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuetify": "^2.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"sass": "~1.32.0",
"sass-loader": "^10.0.0",
"vue-cli-plugin-vuetify": "~2.4.1",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.7.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
Binary file added airtest/public/favicon.ico
Binary file not shown.
19 changes: 19 additions & 0 deletions airtest/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>
7 changes: 7 additions & 0 deletions airtest/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<template>
<v-app>
<v-main>
<router-view/>
</v-main>
</v-app>
</template>
1 change: 1 addition & 0 deletions airtest/src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions airtest/src/components/Dialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<template>
<v-dialog
v-model="showDialog"
width="500"
persistent
@click:outside="$emit('close-dialog')"
>
<v-card>
<v-card-title>
{{ showThankYou ? 'Appointment confirmed' : 'Please confirm your appointment time:'}}
</v-card-title>

<v-card-text>
<template v-if="showThankYou">
<p>Thank you for confirming your appointment time.</p>
<router-link to="/">Back to links</router-link>
</template>
<template v-else>
<br>
<h3>Date: <span class="text--primary">{{ selectedDate }}</span></h3>
<br>
<h3>Time: <span class="text--primary">{{ selectedTime }}</span></h3>
</template>
</v-card-text>

<v-divider></v-divider>

<v-card-actions v-if="!showThankYou">
<v-spacer></v-spacer>
<v-btn
color="red darken-1"
text
:disabled="loading"
@click="$emit('close-dialog')"
>
Cancel
</v-btn>
<v-btn
color="primary darken-1"
text
:loading="loading"
:disabled="loading"
@click="$emit('confirm-appointment')"
>
Confirm
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>

<script>
export default {
props: {
showDialog: Boolean,
selectedDate: String,
selectedTime: String,
showThankYou: Boolean,
loading: Boolean,
}
}
</script>
6 changes: 6 additions & 0 deletions airtest/src/components/Loader.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<template>
<v-progress-circular
indeterminate
color="primary"
></v-progress-circular>
</template>
12 changes: 12 additions & 0 deletions airtest/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'
import router from './router'

Vue.config.productionTip = false

new Vue({
vuetify,
router,
render: h => h(App)
}).$mount('#app')
7 changes: 7 additions & 0 deletions airtest/src/plugins/vuetify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Vue from 'vue';
import Vuetify from 'vuetify/lib/framework';

Vue.use(Vuetify);

export default new Vuetify({
});
27 changes: 27 additions & 0 deletions airtest/src/router/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Appointment from '../views/Appointment.vue'

Vue.use(VueRouter)

const routes = [
{
path: '/appointments',
name: 'Appointment',
component: Appointment
},
{
path: '/',
name: 'Home',
// route level code-splitting
// this generates a separate chunk (home.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue')
}
]

const router = new VueRouter({
routes
})

export default router
11 changes: 11 additions & 0 deletions airtest/src/services/appointment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import axios from 'axios'

const baseUrl = 'https://8byyi37vof.execute-api.ap-southeast-1.amazonaws.com/appointments'

export const getAppointments = async (date) => axios.get(`${baseUrl}/${date}`)

export const createAppointment = async (data) => axios.post(baseUrl, data, {
headers: {
"Access-Control-Allow-Origin": "*"
}
})
Loading