From 9bf7dacf55c19cefd604f1b8fd64e6311d12f58a Mon Sep 17 00:00:00 2001 From: Munawwirul Jamal Date: Thu, 11 Dec 2025 10:11:58 +0700 Subject: [PATCH] feat/role-check: wip --- Dockerfile | 33 +++++++++++++++++++++ app/const/page-permission/client.ts | 16 ++++++++++ app/handlers/encounter-init.handler.ts | 19 ------------ app/pages/(features)/client/patient/add.vue | 4 +-- 4 files changed, 51 insertions(+), 21 deletions(-) create mode 100644 Dockerfile create mode 100644 app/const/page-permission/client.ts diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..d02bc726 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# Build Stage +FROM node:20-alpine AS build-stage + +# Set the working directory inside the container +WORKDIR /app + +# Enable pnpm using corepack +RUN corepack enable + +# Copy pnpm related files and package.json to leverage Docker layer caching +COPY package.json pnpm-lock.yaml ./ + +# Install dependencies using pnpm +# Using --frozen-lockfile ensures consistent installations based on pnpm-lock.yaml +RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store pnpm install --frozen-lockfile + +# Copy the rest of the application files +COPY . . + +# Build the Vue.js application for production +RUN pnpm build + +# Production Stage +FROM nginx:stable-alpine AS production-stage + +# Copy the built Vue.js application from the build stage to Nginx's web root +COPY --from=build-stage /app/dist /usr/share/nginx/html + +# Expose port 80 for Nginx +EXPOSE 80 + +# Command to run Nginx in the foreground +CMD ["nginx", "-g", "daemon off;"] diff --git a/app/const/page-permission/client.ts b/app/const/page-permission/client.ts new file mode 100644 index 00000000..ef32d319 --- /dev/null +++ b/app/const/page-permission/client.ts @@ -0,0 +1,16 @@ +import type { Permission } from "~/models/role"; + +// Should we define the keys first? +// export type Keys = 'key1' | 'key2' | 'key3' | etc + +export const permissions: Record> = { + '/client/patient': { + 'emp|reg': ['C','R','U','D'], + }, + '/client/patient/add': { + 'emp|reg': ['C','R','U','D'], + }, + '/client/patient/{id}': { + 'emp|reg': ['C','R','U','D'], + }, +} diff --git a/app/handlers/encounter-init.handler.ts b/app/handlers/encounter-init.handler.ts index 32b15a1f..7397b190 100644 --- a/app/handlers/encounter-init.handler.ts +++ b/app/handlers/encounter-init.handler.ts @@ -66,12 +66,6 @@ const defaultKeys: Record = { classCode: ['ambulatory', 'emergency', 'inpatient'], unit: 'all', }, - // earlyNurseryAssessment: { - // id: 'early-nursery-assessment', - // title: 'Pengkajian Awal Keperawatan', - // classCode: ['ambulatory', 'emergency', 'inpatient'], - // unit: 'all', - // }, earlyMedicalAssessment: { id: 'early-medical-assessment', title: 'Pengkajian Awal Medis', @@ -85,19 +79,6 @@ const defaultKeys: Record = { unit: 'rehab', afterId: 'early-medical-assessment', }, - // functionAssessment: { - // id: 'function-assessment', - // title: 'Asesmen Fungsi', - // classCode: ['ambulatory'], - // unit: 'rehab', - // afterId: 'rehab-medical-assessment', - // }, - // therapyProtocol: { - // id: 'therapy-protocol', - // classCode: ['ambulatory'], - // title: 'Protokol Terapi', - // unit: 'rehab', - // afterId: 'function-assessment', initialNursesAssessment: { id: 'early-nurse-assessment', title: 'Kajian Awal Keperawatan', diff --git a/app/pages/(features)/client/patient/add.vue b/app/pages/(features)/client/patient/add.vue index ca4615e2..4fb666cb 100644 --- a/app/pages/(features)/client/patient/add.vue +++ b/app/pages/(features)/client/patient/add.vue @@ -1,7 +1,7 @@