diff --git a/pmp-reactjs-ui/Dockerfile b/pmp-reactjs-ui/Dockerfile new file mode 100644 index 000000000..834a0499f --- /dev/null +++ b/pmp-reactjs-ui/Dockerfile @@ -0,0 +1,74 @@ +# base image +FROM nginx + +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + +ENV base_path=/usr/share/nginx/html + +ENV i18n_path=${base_path}/assets/i18n + +ENV entity_spec_path=${base_path}/assets/entity-spec + +# can be passed during Docker build as build time environment for github branch to pickup configuration from. +ARG container_user=mosip + +# can be passed during Docker build as build time environment for github branch to pickup configuration from. +ARG container_user_group=mosip + +# can be passed during Docker build as build time environment for github branch to pickup configuration from. +ARG container_user_uid=1001 + +# can be passed during Docker build as build time environment for github branch to pickup configuration from. +ARG container_user_gid=1001 + +# install packages and create user +RUN apt-get -y update \ +&& apt-get install -y unzip wget \ +&& groupadd -g ${container_user_gid} ${container_user_group} \ +&& useradd -u ${container_user_uid} -g ${container_user_group} -s /bin/sh -m ${container_user} \ +&& mkdir -p /var/run/nginx /var/tmp/nginx \ +&& chown -R ${container_user}:${container_user} /usr/share/nginx /var/run/nginx /var/tmp/nginx + +# set working directory for the user +WORKDIR /home/${container_user} + +ADD ./nginx.conf /etc/nginx/nginx.conf + +ADD default.conf /etc/nginx/conf.d/ + +ADD dist ${base_path} + +# can be passed during Docker build as build time environment for artifactory URL +ARG artifactory_url +# environment variable to pass artifactory url, at docker runtime +ENV artifactory_url_env=${artifactory_url} + +# install the needed packages including wget and a unzip library +#RUN apt-get update -y && apt-get install -y wget && apt-get install -y unzip + +# change permissions of file inside working dir +RUN chown -R ${container_user}:${container_user} ${base_path}/assets/i18n +RUN chown -R ${container_user}:${container_user} ${base_path}/assets/entity-spec + +# select container user for all tasks +USER ${container_user_uid}:${container_user_gid} + +EXPOSE 8080 + +#get the pmp i18n bundle zip from artifactory +CMD wget -q --show-progress "${artifactory_url_env}"/artifactory/libs-release-local/i18n/pmp-i18n-bundle.zip -O "${i18n_path}"/pmp-i18n-bundle.zip ; \ + wget -q --show-progress "${artifactory_url_env}"/artifactory/libs-release-local/i18n/pmp-entity-spec-bundle.zip -O "${entity_spec_path}"/pmp-entity-spec-bundle.zip ; \ + cd ${entity_spec_path} ; \ + unzip -o pmp-entity-spec-bundle.zip ; \ + cd ${i18n_path} ; \ + unzip -o pmp-i18n-bundle.zip ; \ + nginx ; \ + sleep infinity + diff --git a/pmp-reactjs-ui/default.conf b/pmp-reactjs-ui/default.conf new file mode 100644 index 000000000..55cdc1dac --- /dev/null +++ b/pmp-reactjs-ui/default.conf @@ -0,0 +1,14 @@ +server { + listen 8080; + server_name localhost; + add_header X-Frame-Options DENY; + + #charset koi8-r; + #access_log /var/log/nginx/host.access.log main; + + index index.html index.htm; + location /pmp-reactjs-ui { + alias /usr/share/nginx/html; + } + +} diff --git a/pmp-reactjs-ui/src/auth/AppRoutes.js b/pmp-reactjs-ui/src/auth/AppRoutes.js index 330af2193..454b52fd9 100644 --- a/pmp-reactjs-ui/src/auth/AppRoutes.js +++ b/pmp-reactjs-ui/src/auth/AppRoutes.js @@ -2,8 +2,8 @@ import { createHashRouter, RouterProvider, Navigate, redirect } from 'react-rout import GuardedRoute from './GuardedRoute.js'; import MainLayout from '../pages/MainLayout.js'; -import NewPage from '../pages/NewPage.js'; import Dashboard from '../pages/Dashboard.js'; +import PartnerCertificate from '../pages/PartnerCertificate.js'; function AppRoutes() { const router = createHashRouter([ diff --git a/pmp-reactjs-ui/src/pages/SideNav.js b/pmp-reactjs-ui/src/pages/SideNav.js index a27f27f11..cca252453 100644 --- a/pmp-reactjs-ui/src/pages/SideNav.js +++ b/pmp-reactjs-ui/src/pages/SideNav.js @@ -7,7 +7,7 @@ import { ManageSBIInformation } from '../sideNaveOptions/ManageSBIInformation'; import { ManagePartnerProfile } from '../sideNaveOptions/ManagePartnerProfile'; function SideNav() { - const [open, setOpen] = useState(true); + const [open, setOpen] = useState(false); const [activeIcon, setActiveIcon] = useState(false); const Options = [