diff --git a/README.md b/README.md index 1f05e26..aa5fd95 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/CodeForBaltimore/Healthcare-Rollcall.svg?branch=master)](https://travis-ci.org/CodeForBaltimore/Healthcare-Rollcall) +[![Build Status](https://travis-ci.org/CodeForBaltimore/Healthcare-Rollcall.svg?branch=master)](https://travis-ci.org/CodeForBaltimore/Healthcare-Rollcall) [![Netlify Status](https://api.netlify.com/api/v1/badges/83fb49cb-61e1-4c21-8893-03e17e75d972/deploy-status)](https://app.netlify.com/sites/healthcare-rollcall/deploys) # Healthcare Rollcall @@ -7,20 +7,20 @@ In the event of a disaster, Baltimore City and the Baltimore City Health Departm - [Healthcare Rollcall](#healthcare-rollcall) - - [What is this?](#what-is-this) - - [Documentation](#documentation) + - [What is this?](#what-is-this) + - [Documentation](#documentation) - [Project setup](#project-setup) - - [Docker and docker-compose](#docker-and-docker-compose) - - [Full .env example](#full-env-example) - - [Keeping your API up to date](#keeping-your-api-up-to-date) - - [Compiles and hot-reloads for development](#compiles-and-hot-reloads-for-development) - - [Compiles and minifies for production](#compiles-and-minifies-for-production) - - [Lints and fixes files](#lints-and-fixes-files) - - [Customize configuration](#customize-configuration) + - [Docker and docker-compose](#docker-and-docker-compose) + - [Full .env example](#full-env-example) + - [Keeping your API up to date](#keeping-your-api-up-to-date) + - [Compiles and hot-reloads for development](#compiles-and-hot-reloads-for-development) + - [Compiles and minifies for production](#compiles-and-minifies-for-production) + - [Lints and fixes files](#lints-and-fixes-files) + - [Customize configuration](#customize-configuration) - [Using this product](#using-this-product) - - [Testing](#testing) + - [Testing](#testing) - [Sources and Links](#sources-and-links) - - [Contributors ✨](#contributors-) + - [Contributors ✨](#contributors-) diff --git a/package-lock.json b/package-lock.json index 05d4785..ba6a0e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11728,6 +11728,14 @@ "resolved": "https://registry.npmjs.org/vue-cookies/-/vue-cookies-1.7.0.tgz", "integrity": "sha512-vuEUm6wYMMrFAHFCrkzIUAy8+MgPAbBGmYXnk2M6X6O2KHbMT1wuDD2izacmsSUp6ZM02e23MJRtPRobl88VMg==" }, + "vue-country-region-select": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/vue-country-region-select/-/vue-country-region-select-2.0.14.tgz", + "integrity": "sha512-8iQMnwPbkWVmGcBkX++pCHBrQsS7cvgxcfP3xIZY74she7N2Pi0xIPd2p/Ba6zoxA9F7qiU1ZjxzK8xhi6/aKA==", + "requires": { + "vue": "^2.5.17" + } + }, "vue-eslint-parser": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.0.0.tgz", diff --git a/package.json b/package.json index d3c1ed3..80210e9 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "helmet": "3.23.0", "vue": "^2.6.10", "vue-cookies": "1.7.0", + "vue-country-region-select": "2.0.14", "vue-helmet": "1.1.5", "vue-multiselect": "^2.1.6", "vuejs-jwt": "1.1.0", diff --git a/src/components/quickForm.vue b/src/components/quickForm.vue index e54b12b..60beac2 100644 --- a/src/components/quickForm.vue +++ b/src/components/quickForm.vue @@ -1,6 +1,5 @@ - + @@ -97,6 +97,8 @@ export default { name: "Dashboard", data() { + const showAdmin = + this.$jwt.decode(this.$root.auth_token).type === "admin" ? true : false return { rows: 0, perPage: 25, @@ -107,6 +109,7 @@ export default { }, filterOn: ["name"], statusOptions: [], + showAdmin, entities: null, sortBy: "updated", sortDesc: false, @@ -116,12 +119,12 @@ export default { { key: "status", sortable: true }, { key: "updatedAt", sortable: true } ] - }; + } }, methods: { updateEntities(obj) { - this.entities = obj.results; - this.rows = this.entities.length; + this.entities = obj.results + this.rows = this.entities.length for (let entity of this.entities) { if ( entity.checkIn && @@ -129,18 +132,18 @@ export default { entity.checkIn.checkIns.length > 0 ) { entity.status = - entity.checkIn.checkIns[entity.checkIn.checkIns.length - 1].status; + entity.checkIn.checkIns[entity.checkIn.checkIns.length - 1].status } else { - entity.status = "No Previous Check-in"; + entity.status = "No Previous Check-in" } } }, onFiltered(filteredItems) { - this.rows = filteredItems.length; - this.currentPage = 1; + this.rows = filteredItems.length + this.currentPage = 1 }, filterRow(row, filter) { - let match = !filter.status || row.status === this.filter.status; + let match = !filter.status || row.status === this.filter.status return match && filter.keyword ? this.filterOn.reduce( (match, field) => @@ -148,17 +151,22 @@ export default { row[field].toLowerCase().match(filter.keyword.toLowerCase()), false ) - : match; + : match + }, + addFacility() { + this.$router.push({ + name: "facility-add" + }) } }, mounted() { let options = this.$root.getStatuses().map(status => { - return { value: status, text: status, disabled: false }; - }); - this.statusOptions = [{ value: null, text: "All" }, ...options]; - this.$root.apiGETRequest("/entity", this.updateEntities); + return { value: status, text: status, disabled: false } + }) + this.statusOptions = [{ value: null, text: "All" }, ...options] + this.$root.apiGETRequest("/entity", this.updateEntities) } -}; +} diff --git a/src/templates/FacilityEdit.vue b/src/templates/FacilityEdit.vue new file mode 100644 index 0000000..a9ce2cb --- /dev/null +++ b/src/templates/FacilityEdit.vue @@ -0,0 +1,221 @@ + + + + + \ No newline at end of file