From 32731fc874a2f6110aa95f4a85d36e733803a119 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Thu, 5 Dec 2024 08:14:32 +0000 Subject: [PATCH 1/6] add CI --- .onedev-buildspec.yml | 102 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 .onedev-buildspec.yml diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml new file mode 100644 index 0000000..18b9ef9 --- /dev/null +++ b/.onedev-buildspec.yml @@ -0,0 +1,102 @@ +version: 37 +jobs: +- name: CI for UAT + steps: + - !CheckoutStep + name: checkout code + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !GenerateChecksumStep + name: generate package checksum + files: package-lock.json yarn.lock + targetFile: checksum + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetupCacheStep + name: set up npm cache + key: node_modules_@file:checksum@ + loadKeys: + - node_modules + paths: + - node_modules + uploadStrategy: UPLOAD_IF_NOT_HIT + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetBuildVersionStep + name: set build version + buildVersion: '@tag@' + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: build & test + runInContainer: true + image: node + interpreter: !DefaultInterpreter + commands: | + npm install + npm run build + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: build docker image + dockerfile: ./docker/Dockerfile + output: !RegistryOutput + tags: hrms-git.chin.in.th/bma-hrms/joolsoft-website:@build_version@ hrms-git.chin.in.th/bma-hrms/joolsoft-website:latest + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !TagCreateTrigger + tags: uat-* + branches: main + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 +- name: CI for PROD + steps: + - !CheckoutStep + name: checkout code + cloneCredential: !DefaultCredential {} + withLfs: false + withSubmodules: false + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !GenerateChecksumStep + name: generate package checksum + files: package-lock.json yarn.lock + targetFile: checksum + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetupCacheStep + name: set up npm cache + key: node_modules_@file:checksum@ + loadKeys: + - node_modules + paths: + - node_modules + uploadStrategy: UPLOAD_IF_NOT_HIT + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !SetBuildVersionStep + name: set build version + buildVersion: '@tag@' + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !CommandStep + name: build & test + runInContainer: true + image: node + interpreter: !DefaultInterpreter + commands: | + npm install + npm run build + useTTY: true + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + - !BuildImageStep + name: build docker image + dockerfile: ./docker/Dockerfile + output: !RegistryOutput + tags: hrms-git.bangkok.go.th/bma-hrms/hrms-user:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-user:latest + condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + triggers: + - !TagCreateTrigger + tags: prod-* + branches: main + retryCondition: never + maxRetries: 3 + retryDelay: 30 + timeout: 14400 From 7dd931f56e6ce0aa3b18509de1eb73f1001612b2 Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Thu, 5 Dec 2024 16:35:29 +0000 Subject: [PATCH 2/6] edit ci --- .onedev-buildspec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index 18b9ef9..aa65f53 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -40,7 +40,7 @@ jobs: name: build docker image dockerfile: ./docker/Dockerfile output: !RegistryOutput - tags: hrms-git.chin.in.th/bma-hrms/joolsoft-website:@build_version@ hrms-git.chin.in.th/bma-hrms/joolsoft-website:latest + tags: hrms-git.chin.in.th/bma-hrms/hrms-user:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-user:latest condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL triggers: - !TagCreateTrigger From 0d57591c4debb02c1213a4031f14e800e54c68cc Mon Sep 17 00:00:00 2001 From: Suchin Sapphasitthatha Date: Sat, 14 Dec 2024 14:20:43 +0700 Subject: [PATCH 3/6] =?UTF-8?q?-=20=E0=B8=A5=E0=B8=9A=E0=B8=8A=E0=B9=88?= =?UTF-8?q?=E0=B8=AD=E0=B8=87=E0=B8=A7=E0=B9=88=E0=B8=B2=E0=B8=87=E0=B9=82?= =?UTF-8?q?=E0=B8=9F=E0=B8=A5=E0=B9=80=E0=B8=94=E0=B8=AD=E0=B8=A3=E0=B9=8C?= =?UTF-8?q?=20docker=20-=20=E0=B9=81=E0=B8=81=E0=B9=89=E0=B9=84=E0=B8=82?= =?UTF-8?q?=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- { docker => docker}/Dockerfile | 2 +- { docker => docker}/entrypoint.sh | 0 { docker => docker}/nginx.conf | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename { docker => docker}/Dockerfile (94%) rename { docker => docker}/entrypoint.sh (100%) rename { docker => docker}/nginx.conf (100%) diff --git a/ docker/Dockerfile b/docker/Dockerfile similarity index 94% rename from docker/Dockerfile rename to docker/Dockerfile index 62b1cee..dce3021 100644 --- a/ docker/Dockerfile +++ b/docker/Dockerfile @@ -1,7 +1,7 @@ # docker buildx build --platform=linux/amd64 -f docker/Dockerfile . -t hrms-git.chin.in.th/bma-hrms/hrms-user:0.1 # Build Stage -FROM node:20-alpine as build-stage +FROM node:20-alpine AS build-stage WORKDIR /app COPY package*.json ./ RUN npm install diff --git a/ docker/entrypoint.sh b/docker/entrypoint.sh similarity index 100% rename from docker/entrypoint.sh rename to docker/entrypoint.sh diff --git a/ docker/nginx.conf b/docker/nginx.conf similarity index 100% rename from docker/nginx.conf rename to docker/nginx.conf From a43279b314975031a3ad12ce2704fa88cfe51ca9 Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Fri, 20 Dec 2024 22:45:41 +0700 Subject: [PATCH 4/6] check cookie redirect sso --- src/router/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index 103e994..04b4901 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -22,8 +22,7 @@ import ModulePortfolio from "@/modules/13_portfolio/router"; import ModuleDevelop from "@/modules/14_IDP/router"; import ModuleProbationReport from "@/modules/15_probationReport/router"; -import { authenticated, tokenParsed } from "@/plugins/auth"; -import { ro } from "date-fns/locale"; +import { authenticated, logout } from "@/plugins/auth"; // TODO: ใช้หรือไม่? const router = createRouter({ @@ -96,7 +95,7 @@ router.beforeEach(async (to, from, next) => { if (to.meta.Auth) { const checkAuthen = await authenticated(); if (!checkAuthen && to.meta.Auth) { - router.push({ name: "loginMain" }); + logout(); } } next(); From 21f1787dd0aa0dd5399a74d1fb21ca23a4342d9c Mon Sep 17 00:00:00 2001 From: waruneeauy Date: Tue, 24 Dec 2024 22:23:39 +0700 Subject: [PATCH 5/6] fixing --- .../components/01_SurveyPage.vue | 1 + .../components/02_ResultPage.vue | 18 +++++++++++++++--- src/modules/15_probationReport/store.ts | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/modules/15_probationReport/components/01_SurveyPage.vue b/src/modules/15_probationReport/components/01_SurveyPage.vue index f6fcaaf..f623bcc 100644 --- a/src/modules/15_probationReport/components/01_SurveyPage.vue +++ b/src/modules/15_probationReport/components/01_SurveyPage.vue @@ -45,6 +45,7 @@ async function getSurveyData() { .then(async (res: any) => { const data = await res.data.result.data; assignId.value = res.data.result.assignId; + store.assignId = res.data.result.assignId; if (data !== null) { answer1.value = data.answer1; answer2.value = data.answer2; diff --git a/src/modules/15_probationReport/components/02_ResultPage.vue b/src/modules/15_probationReport/components/02_ResultPage.vue index f5a4359..553f2c5 100644 --- a/src/modules/15_probationReport/components/02_ResultPage.vue +++ b/src/modules/15_probationReport/components/02_ResultPage.vue @@ -5,12 +5,13 @@ import { useRoute, useRouter } from "vue-router"; import http from "@/plugins/http"; import config from "@/app.config"; import { useQuasar } from "quasar"; +import { useProbationReport } from "@/modules/15_probationReport/store"; const mixin = useCounterMixin(); +const store = useProbationReport(); const { date2Thai, showLoader, hideLoader, messageError } = mixin; const route = useRoute(); -const assignId = ref("baa3d9f6-9d21-4c58-85f2-114abf8de25c"); const status = ref(false); const $q = useQuasar(); @@ -52,7 +53,7 @@ const result_option = reactive([ async function getReportScore() { showLoader(); await http - .get(config.API.summaryReportDetail(assignId.value)) + .get(config.API.summaryReportDetail(store.assignId)) .then((res) => { const data = res.data.result; develop_orientation_score.value = data.develop_orientation_score; @@ -95,8 +96,19 @@ async function getReportScore() { }); } +/** ดึง ข้อมูลแบบสำรวจ */ +async function getAssignId() { + await http.get(config.API.summaryDetail()).then(async (res: any) => { + store.assignId = res.data.result.assignId; + }); +} + /** get ค่า เมื่อโหลดหน้า */ -onMounted(() => { +onMounted(async () => { + if (!store.assignId) { + await getAssignId(); + } + getReportScore(); }); diff --git a/src/modules/15_probationReport/store.ts b/src/modules/15_probationReport/store.ts index 0d20211..8698668 100644 --- a/src/modules/15_probationReport/store.ts +++ b/src/modules/15_probationReport/store.ts @@ -4,5 +4,6 @@ import type { DataOption } from "@/modules/10_registry/interface/index/Main"; export const useProbationReport = defineStore("ProbationReportStore", () => { const tabMain = ref("SURVEY"); - return { tabMain }; + const assignId = ref(""); + return { tabMain, assignId }; }); From 5f7bcff08ac6355458cfcf41f9f1a555eb1232dd Mon Sep 17 00:00:00 2001 From: kittapath Date: Wed, 25 Dec 2024 01:22:31 +0700 Subject: [PATCH 6/6] edit sys SYS_TRANSFER_REQ --- src/modules/02_transfer/views/AddTransfer.vue | 321 ++++++++---------- 1 file changed, 144 insertions(+), 177 deletions(-) diff --git a/src/modules/02_transfer/views/AddTransfer.vue b/src/modules/02_transfer/views/AddTransfer.vue index e72f495..fa53bde 100644 --- a/src/modules/02_transfer/views/AddTransfer.vue +++ b/src/modules/02_transfer/views/AddTransfer.vue @@ -1,64 +1,60 @@