diff --git a/mocks/fst.postman_collection.json b/mocks/fst.postman_collection.json
index c44c50e..a534d40 100644
--- a/mocks/fst.postman_collection.json
+++ b/mocks/fst.postman_collection.json
@@ -190,7 +190,107 @@
"_postman_previewlanguage": null,
"header": null,
"cookie": [],
- "body": "{\r\n \"openContracts\": [\r\n {\r\n \"id\" : \"DZ22\",\r\n \"name\" : \"Name1\",\r\n \"status\" : \"open\",\r\n \"appointment\" : \"2020-01-01T12:00:00Z\",\r\n \"notes\" : \"From Feb 2023 To March 2023\"\r\n },\r\n {\r\n \"id\" : \"PC22\",\r\n \"name\" : \"Name2\",\r\n \"status\" : \"open\",\r\n \"appointment\" : \"2020-01-12T12:00:00Z\",\r\n \"notes\" : \"From Feb 2023 To March 2023\"\r\n }\r\n ]\r\n}"
+ "body": "{\r\n \"openContracts\": [\r\n {\r\n \"id\" : \"DZ22\",\r\n \"name\" : \"Name1\",\r\n \"status\" : \"open\",\r\n \"appointment\" : \"2020-01-01T12:00:00Z\",\r\n \"notes\" : \"From Feb 2023 To March 2023\",\r\n \"registered\" : true\r\n },\r\n {\r\n \"id\" : \"PC22\",\r\n \"name\" : \"Name2\",\r\n \"status\" : \"open\",\r\n \"appointment\" : \"2020-01-12T12:00:00Z\",\r\n \"notes\" : \"From Feb 2023 To March 2023\",\r\n \"registered\" : false\r\n }\r\n ]\r\n}"
+ }
+ ]
+ },
+ {
+ "name": "Apply for contract",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"id\" : \"DZ2022\",\r\n \"role\" : \"leiter\"\r\n}"
+ },
+ "url": {
+ "raw": "{{url}}/contract/apply",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "contract",
+ "apply"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "Apply for contract",
+ "originalRequest": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"id\" : \"DZ2022\",\r\n \"role\" : \"leiter\" \r\n}"
+ },
+ "url": {
+ "raw": "{{url}}/contract/apply",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "contract",
+ "apply"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": null,
+ "header": null,
+ "cookie": [],
+ "body": ""
+ }
+ ]
+ },
+ {
+ "name": "New Request",
+ "request": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"id\" : \"DZ2022\"\r\n}"
+ },
+ "url": {
+ "raw": "{{url}}/contract/misapply",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "contract",
+ "misapply"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "New Request",
+ "originalRequest": {
+ "method": "POST",
+ "header": [],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"id\" : \"DZ2022\"\r\n}"
+ },
+ "url": {
+ "raw": "{{url}}/contract/misapply",
+ "host": [
+ "{{url}}"
+ ],
+ "path": [
+ "contract",
+ "misapply"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": null,
+ "header": null,
+ "cookie": [],
+ "body": null
}
]
}
diff --git a/src/App.vue b/src/App.vue
index 13ee9ea..e5c1cec 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -3,5 +3,24 @@ import { RouterView } from 'vue-router'
+
+
+
diff --git a/src/components/modals/DeregisterModal.vue b/src/components/modals/DeregisterModal.vue
new file mode 100644
index 0000000..43ae2ff
--- /dev/null
+++ b/src/components/modals/DeregisterModal.vue
@@ -0,0 +1,80 @@
+
+
+
+
diff --git a/src/components/modals/RegisterModal.vue b/src/components/modals/RegisterModal.vue
new file mode 100644
index 0000000..5686131
--- /dev/null
+++ b/src/components/modals/RegisterModal.vue
@@ -0,0 +1,70 @@
+
+
+
+
diff --git a/src/components/tabs/ContractTab.vue b/src/components/tabs/ContractTab.vue
index a1e38dd..647ec99 100644
--- a/src/components/tabs/ContractTab.vue
+++ b/src/components/tabs/ContractTab.vue
@@ -95,7 +95,7 @@
Beispiele: |
- -
+
-
Link {{ index + 1 }}
{
+ //TODO: send also auth token with request
+ return resp.data
+ })
+ .catch(error => {
+ console.error(error)
+ router.push('/error?message=' + error.message + '&code=' + error.code)
+ })
+}
+
+export async function misapply(contractID) {
+ return HttpClient.post('/contract/misapply', {
+ id: contractID
+ })
+ .then(resp => {
+ //TODO: send also auth token with request
+ return resp.data
+ })
+ .catch(error => {
+ console.error(error)
+ router.push('/error?message=' + error.message + '&code=' + error.code)
+ })
+}
diff --git a/src/store/contracts.module.js b/src/store/contracts.module.js
index 7cd117e..f3c7e94 100644
--- a/src/store/contracts.module.js
+++ b/src/store/contracts.module.js
@@ -4,7 +4,8 @@ export default {
state: () => ({
contracts: [],
currentContract: null,
- openContracts: []
+ openContracts: [],
+ selectedContract: null
}),
mutations: {
initContracts(state, data) {
@@ -15,6 +16,9 @@ export default {
},
setCurrentContract(state, data) {
state.currentContract = data
+ },
+ setSelectedContract(state, contractID) {
+ state.selectedContract = contractID
}
},
actions: {
diff --git a/src/store/index.js b/src/store/index.js
index 0453cfc..3764ec6 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -1,6 +1,6 @@
import { createStore } from 'vuex'
import contracts from './contracts.module'
-import moduleB from './moduleB.module'
+import modal from './modal.module'
import keycloak from './keycloak.module'
import createPersistedState from 'vuex-persistedstate'
@@ -8,7 +8,7 @@ export default createStore({
modules: {
keycloak: keycloak,
contracts: contracts,
- b: moduleB
+ modal: modal
},
plugins: [createPersistedState()]
})
diff --git a/src/store/modal.module.js b/src/store/modal.module.js
new file mode 100644
index 0000000..b90646d
--- /dev/null
+++ b/src/store/modal.module.js
@@ -0,0 +1,22 @@
+export default {
+ state: () => ({
+ modal: ''
+ }),
+ mutations: {
+ setModal(state, modalName) {
+ state.modal = modalName
+ },
+ resetModal(state) {
+ state.modal = ''
+ }
+ },
+ actions: {
+ openModal({ commit }, modalName) {
+ commit('setModal', modalName)
+ },
+ closeModal({ commit }) {
+ commit('resetModal')
+ }
+ },
+ getters: {}
+}
diff --git a/src/store/moduleB.module.js b/src/store/moduleB.module.js
deleted file mode 100644
index 6abb9ee..0000000
--- a/src/store/moduleB.module.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default {
- state: () => ({}),
- mutations: {},
- actions: {},
- getters: {}
-}
diff --git a/src/views/OpenContractsView.vue b/src/views/OpenContractsView.vue
index 05780b5..394c157 100644
--- a/src/views/OpenContractsView.vue
+++ b/src/views/OpenContractsView.vue
@@ -2,71 +2,81 @@
import Navbar from '../components/Navbar.vue'
-
-
-
-
- Offene Aufträge
-
-
-
-
-
-
-
-
- | Id |
- Name |
- Status |
- Planed Date |
- Notes |
- Aktion |
-
-
-
-
- | {{ contract.id }} |
- {{ contract.name }} |
-
-
- {{
- contract.status
- }}
- |
-
- {{ new Date(contract.appointment).toDateString() }}
- |
- {{ contract.notes }} |
-
-
+
+
+
+
+
+ Offene Aufträge
+
+
+
+
+
+
+
+
+ | Id |
+ Name |
+ Status |
+ Planed Date |
+ Notes |
+ Aktion |
+
+
+
+
+ | {{ contract.id }} |
+ {{ contract.name }} |
+
+
+ {{
+ contract.status
+ }}
+ |
+
+ {{ new Date(contract.appointment).toDateString() }}
+ |
+ {{ contract.notes }} |
+
+
+
+
-
-
-
- |
-
-
-
+
+ |
+
+
+
+
@@ -74,11 +84,6 @@ import Navbar from '../components/Navbar.vue'
import { mapActions } from 'vuex'
export default {
- data() {
- return {
- dialog: null
- }
- },
computed: {
openContracts() {
return this.$store.state.contracts.openContracts
@@ -88,9 +93,10 @@ export default {
this.fetchOpenContracts()
},
methods: {
- ...mapActions(['fetchOpenContracts']),
- openDialog(name) {
- this.dialog = name
+ ...mapActions(['fetchOpenContracts', 'openModal']),
+ selectContract(ID) {
+ console.log(ID)
+ this.$store.commit('setSelectedContract', ID)
}
}
}
|