diff --git a/.env b/.env index 04278f6..cada49a 100644 --- a/.env +++ b/.env @@ -8,24 +8,23 @@ NEXTAUTH_SECRET=ed8a9681efc414df89dfd03cd188ed58 NODE_ENV=development # mysql. ONLY THIS ENV is respected when generating/applying migrations in prisma -DATABASE=mysql://cart:cartpw@localhost:3306/cart -# DATABASE=mysql://cart:cartpw@192.168.0.10:3306/cart_dev -NEXT_PUBLIC_PUBLIC_URL=https://localhost:3003 +# DATABASE=mysql://cart:cartpw@localhost:3306/cart +DATABASE=mysql://db:db@192.168.0.10:3306/cart +# NEXT_PUBLIC_PUBLIC_URL=https://localhost:3003 ADMIN_PASSWORD=123456 # // owner: dobromir.popov@gmail.com | Специално Свидетелстване София -# // https://console.cloud.google.com/apis/credentials/oauthclient/926212607479-d3m8hm8f8esp3rf1639prskn445sa01v.apps.googleusercontent.com?project=grand-forge-108716 +# // https://console.cloud.google.com/apis/credentials/oauthclient/926212607479-d3m8hm8f8esp3rf1639prskn445sa01v.apps.googleusercontent.com?project=grand-forge-108716 # callback https://sofia.mwitnessing.com/api/auth/callback/google GOOGLE_ID=926212607479-d3m8hm8f8esp3rf1639prskn445sa01v.apps.googleusercontent.com GOOGLE_SECRET=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 - # //https://sofia.mwitnessing.com/api/auth/callback/microsoft # https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app # owner: dobromirpopovgateway.onmicrosoft.com dobromir.popov@gateway.one (personal) Doby Popov P One # callback https://sofia.mwhitnessing.com/api/auth/callback/azure-ad - -AZURE_AD_CLIENT_ID=9e13bedd-1f9d-4c23-910e-a806aba308b6 # Application (client) ID + +AZURE_AD_CLIENT_ID=9e13bedd-1f9d-4c23-910e-a806aba308b6 # Application (client) ID AZURE_AD_CLIENT_SECRET=5ic8Q~GQmW-IUhuxzVGx3BE-i30GXDSpjfMHcb~z #client secret value AZURE_AD_TENANT_ID=f69d1a93-bfba-498a-9b60-e87c1bc26276 @@ -55,8 +54,6 @@ FACEBOOK_SECRET= GITHUB_ID= GITHUB_SECRET= - - TWITTER_ID= TWITTER_SECRET= diff --git a/.env.development b/.env.development index 39f5519..9395558 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -NODE_TLS_REJECT_UNAUTHORIZED=0 +NODE_TLS_REJECT_UNAUTHORIZED=0 # NODE_EXTRA_CA_CERTS=C:\\Users\\popov\\AppData\\Local\\mkcert ENV_ENV=.env.development PROTOCOL=https @@ -8,7 +8,6 @@ NEXT_PUBLIC_PUBLIC_URL=https://localhost:3003 # DATABASE=mysql://cart:cartpw@192.168.0.10:3306/cart_dev DATABASE=mysql://cart:cartpw@localhost:3306/cart - EMAIL_SENDER='"ССОМ [ТЕСТ] " ' # MAILTRAP_HOST_BULK=bulk.smtp.mailtrap.io # MAILTRAP_HOST=sandbox.smtp.mailtrap.io diff --git a/.gitignore b/.gitignore index 4339447..12de6ff 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ public/content/output/shifts 2024.1.json !public/content/uploads/* .aider* /shift_generate_log_*.txt +.env diff --git a/_deploy/deoloy.azure.staging.yml b/_deploy/deoloy.azure.staging.yml index 2fad3a5..d33b4ce 100644 --- a/_deploy/deoloy.azure.staging.yml +++ b/_deploy/deoloy.azure.staging.yml @@ -16,7 +16,18 @@ services: - GIT_USERNAME=deploy - GIT_PASSWORD=L3Kr2R438u4F7 - ADMIN_PASSWORD=kolichkisofia2024 - command: sh -c " cd /app && npm install && npx next build && npm run start-env; tail -f /dev/null" + command: > + sh -c " + cd /app && + rm -rf node_modules package-lock.json && + npm install --no-package-lock && + npm uninstall @prisma/client prisma && + npm install @prisma/client@5.22.0 prisma@5.22.0 --save-exact && + npx next build && + npx prisma migrate deploy && + npx prisma generate && + npm run start-env; + tail -f /dev/null" tty: true stdin_open: true restart: always diff --git a/_deploy/entrypoint.sh b/_deploy/entrypoint.sh index 81d1d76..be9f2b6 100644 --- a/_deploy/entrypoint.sh +++ b/_deploy/entrypoint.sh @@ -3,7 +3,7 @@ if [ "$UPDATE_CODE_FROM_GIT" = "true" ]; then # Install necessary packages apk add git nano rsync - echo "Updating code from git.d-popov.com...(as '$GIT_USERNAME')" > /app/logs/deploy.txt + echo "Updating code from git.d-popov.com...(as '$GIT_USERNAME'). Branch: ${GIT_BRANCH:main}" > /app/logs/deploy.txt # Create a temporary directory for the new clone rm -rf /tmp/clone diff --git a/_deploy/sample.docker-compose.yml b/_deploy/sample.docker-compose.yml index 32347a9..3c89e7d 100644 --- a/_deploy/sample.docker-compose.yml +++ b/_deploy/sample.docker-compose.yml @@ -31,7 +31,7 @@ services: ports: - 8083:8080 - # THE APP + # THE APP nextjs-app: image: sachinvashist/nextjs-docker ports: @@ -61,5 +61,3 @@ services: stdin_open: true # depends_on: # - mariadb - - \ No newline at end of file diff --git a/_doc/notes.mb b/_doc/notes.mb index e6ed6a4..a5455d0 100644 --- a/_doc/notes.mb +++ b/_doc/notes.mb @@ -148,6 +148,12 @@ npx prisma migrate resolve --applied 20240201214719_assignment_add_repeat_freque npx prisma migrate dev --schema "mysql://cart:cart2023@192.168.0.10:3306/cart_dev" # -- does not work +# reset to version: +npm uninstall @prisma/client prisma +npm install @prisma/client@5.22.0 prisma@5.22.0 +# check current: +npm why prisma + ## ---------------------- import database --------------------------------- ## gunzip < /prisma/backups/jwpwsofia-20240430-bak.gz | mysql -u mysql_username -p database_name diff --git a/components/location/LocationForm.js b/components/location/LocationForm.js index be36371..df06282 100644 --- a/components/location/LocationForm.js +++ b/components/location/LocationForm.js @@ -9,6 +9,7 @@ import FileUploadWithPreview from 'components/FileUploadWithPreview '; import ProtectedRoute, { serverSideAuth } from "../../components/protectedRoute"; import { UserRole } from "@prisma/client"; +import { Input } from '@mui/base'; const common = require('src/helpers/common'); @@ -37,8 +38,9 @@ export default function LocationForm() { useEffect(() => { const fetchUploadedImages = async () => { try { - const response = await axiosInstance.get('/uploaded-images'); - setUploadedImages(response.data.imageUrls); + // ToDo: we don't have this endpoint yet and we don't use the uploaded images collection + // const response = await axiosInstance.get('/uploaded-images'); + // setUploadedImages(response.data.imageUrls); } catch (error) { console.error('Error fetching uploaded images:', error); } @@ -67,6 +69,7 @@ export default function LocationForm() { address: "", isActive: true, }); + const [isRawHtml, setIsRawHtml] = useState(false); // const [isEdit, setIsEdit] = useState(false); @@ -178,6 +181,13 @@ export default function LocationForm() { + {/* is on main menu */} +
+
+ + +
+
{/* backupLocation */}
@@ -238,12 +248,50 @@ export default function LocationForm() { - + + + +
+ + {isRawHtml && <> + +