diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9fdc41180..05bf94a69 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,14 +22,14 @@ jobs: - name: Create env file run: | touch .env - echo DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }} >> .env - echo DJANGO_DEBUG=${{ secrets.DJANGO_DEBUG }} >> .env - echo EMAIL=${{ secrets.EMAIL }} >> .env - echo EMAIL_PASSWORD=${{ secrets.EMAIL_PASSWORD }} >> .env - echo EMAIL_HOST=${{ secrets.EMAIL_HOST }} >> .env - echo REDIS_HOST=${{ secrets.REDIS_HOST}} >> .env - echo SERVER_DOMAIN_NAME=${{ secrets.SERVER_DOMAIN_NAME }} >> .env - echo CLIENT_DOMAIN_NAME=${{ secrets.CLIENT_DOMAIN_NAME }} >> .env + echo CSHR_DJANGO_SECRET_KEY=${{ secrets.CSHR_DJANGO_SECRET_KEY }} >> .env + echo CSHR_DJANGO_DEBUG=${{ secrets.CSHR_DJANGO_DEBUG }} >> .env + echo CSHR_EMAIL=${{ secrets.CSHR_EMAIL }} >> .env + echo CSHR_EMAIL_PASSWORD=${{ secrets.CSHR_EMAIL_PASSWORD }} >> .env + echo CSHR_EMAIL_HOST=${{ secrets.CSHR_EMAIL_HOST }} >> .env + echo CSHR_REDIS_HOST=${{ secrets.CSHR_REDIS_HOST}} >> .env + echo CSHR_SERVER_DOMAIN_NAME=${{ secrets.CSHR_SERVER_DOMAIN_NAME }} >> .env + echo CSHR_CLIENT_DOMAIN_NAME=${{ secrets.CSHR_CLIENT_DOMAIN_NAME }} >> .env cat .env - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 diff --git a/.gitignore b/.gitignore index d24ee920f..d69a8e42f 100644 --- a/.gitignore +++ b/.gitignore @@ -118,7 +118,7 @@ celerybeat.pid .venv env/ venv/ -ENV/ +CSHR_ENV/ env.bak/ venv.bak/ diff --git a/client/env.d.ts b/client/env.d.ts index 0f899a7d5..6a09fbd5e 100644 --- a/client/env.d.ts +++ b/client/env.d.ts @@ -5,6 +5,6 @@ interface ImportMetaEnv { VITE_TITLE: string VITE_FAVICON: string VITE_LOGO: string - SERVER_DOMAIN_NAME_API: string - SERVER_DOMAIN_NAME_WS: string + CSHR_SERVER_DOMAIN_NAME_API: string + CSHR_SERVER_DOMAIN_NAME_WS: string } diff --git a/client/package.json b/client/package.json index e7de5e545..d84b4ab86 100644 --- a/client/package.json +++ b/client/package.json @@ -57,5 +57,6 @@ "vite-plugin-vuetify": "^2.0.1", "vitest": "^1.0.4", "vue-tsc": "^1.8.25" - } + }, + "packageManager": "pnpm@10.11.0+sha512.6540583f41cc5f628eb3d9773ecee802f4f9ef9923cc45b69890fb47991d4b092964694ec3a4f738a420c918a333062c8b925d312f42e4f0c263eb603551f977" } diff --git a/client/public/config.js b/client/public/config.js index b1a3eb9ea..f38564bc4 100644 --- a/client/public/config.js +++ b/client/public/config.js @@ -1,6 +1,6 @@ window.env = { - // SERVER_DOMAIN_NAME_API: 'https://cshrserver.gent01.qa.grid.tf/api', // Added for testing, this is a staging API - // SERVER_DOMAIN_NAME_WS: 'wss://cshrserver.gent01.qa.grid.tf/ws/notification', // Added for testing, this is a staging API - SERVER_DOMAIN_NAME_API: 'http://127.0.0.1:8000/api', // Added for testing, this is the local server API - SERVER_DOMAIN_NAME_WS: 'ws://127.0.0.1:8000/ws/notification', // Added for testing, this is the local server API + // CSHR_SERVER_DOMAIN_NAME_API: 'https://cshrserver.gent01.qa.grid.tf/api', // Added for testing, this is a staging API + // CSHR_SERVER_DOMAIN_NAME_WS: 'wss://cshrserver.gent01.qa.grid.tf/ws/notification', // Added for testing, this is a staging API + CSHR_SERVER_DOMAIN_NAME_API: 'http://127.0.0.1:8000/api', // Added for testing, this is the local server API + CSHR_SERVER_DOMAIN_NAME_WS: 'ws://127.0.0.1:8000/ws/notification', // Added for testing, this is the local server API }; \ No newline at end of file diff --git a/client/src/clients/api/vacations.ts b/client/src/clients/api/vacations.ts index be8d4cdba..267253df0 100644 --- a/client/src/clients/api/vacations.ts +++ b/client/src/clients/api/vacations.ts @@ -95,6 +95,13 @@ export class VacationsApi extends ApiClientBase { }) } + async delete(id: number) { + ApiClientBase.assertUser() + return this.unwrap(() => this.$http.delete(this.getUrl(`/${id}`)), { + transform: (d) => d.results + }) + } + async requestToCancel(id: number) { return this.unwrap(() => this.$http.put(this.getUrl(`/request-to-cancel/${id}`)), { transform: (d) => d.results diff --git a/client/src/clients/index.ts b/client/src/clients/index.ts index bb5694e85..e5b28db76 100644 --- a/client/src/clients/index.ts +++ b/client/src/clients/index.ts @@ -2,13 +2,13 @@ import axios from 'axios' import { ApiClient } from './api' -console.log(`API connected on: ${window.env.SERVER_DOMAIN_NAME_API}`); -console.log(`WS connected on: ${window.env.SERVER_DOMAIN_NAME_WS}`); +console.log(`API connected on: ${window.env.CSHR_SERVER_DOMAIN_NAME_API}`); +console.log(`WS connected on: ${window.env.CSHR_SERVER_DOMAIN_NAME_WS}`); const accessToken = localStorage.getItem("access_token") export const $api = new ApiClient({ $http: axios.create({ - baseURL: window.env.SERVER_DOMAIN_NAME_API, + baseURL: window.env.CSHR_SERVER_DOMAIN_NAME_API, headers: { Authorization: `Bearer ${accessToken}`, }, diff --git a/client/src/components/CalenderComponent.vue b/client/src/components/CalenderComponent.vue index f49263fc5..5381c2a06 100644 --- a/client/src/components/CalenderComponent.vue +++ b/client/src/components/CalenderComponent.vue @@ -1,39 +1,108 @@ diff --git a/client/src/components/CshrToolbar.vue b/client/src/components/CshrToolbar.vue index c202f1c68..419696037 100644 --- a/client/src/components/CshrToolbar.vue +++ b/client/src/components/CshrToolbar.vue @@ -1,5 +1,13 @@