mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
IMG_URL not needed finally (default to running server with relative URL)
This commit is contained in:
parent
5a5897d25c
commit
a66631c60b
7 changed files with 6 additions and 14 deletions
|
|
@ -1,3 +1,2 @@
|
||||||
VITE_BACKEND_URL=http://localhost:4400
|
VITE_BACKEND_URL=http://localhost:4400
|
||||||
VITE_BACKEND_SOCKET_URL=http://localhost:4400
|
VITE_BACKEND_SOCKET_URL=http://localhost:4400
|
||||||
VITE_IMG_URL=http://localhost:4400
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,2 @@
|
||||||
VITE_BACKEND_URL=http://localhost:4400
|
VITE_BACKEND_URL=http://localhost:4400
|
||||||
VITE_AZURE_BACKEND_URL=http://localhost:4400
|
VITE_AZURE_BACKEND_URL=http://localhost:4400
|
||||||
VITE_IMG_URL=http://localhost:4400
|
|
||||||
|
|
@ -22,7 +22,6 @@ import CloseIcon from "@mui/icons-material/Close";
|
||||||
import { ImageType } from "../../Types/ImageType";
|
import { ImageType } from "../../Types/ImageType";
|
||||||
import ApiService from "../../services/ApiService";
|
import ApiService from "../../services/ApiService";
|
||||||
import { Upload } from "@mui/icons-material";
|
import { Upload } from "@mui/icons-material";
|
||||||
import { ENV_VARIABLES } from '../../constants';
|
|
||||||
import { escapeForGIFT } from "src/utils/giftUtils";
|
import { escapeForGIFT } from "src/utils/giftUtils";
|
||||||
|
|
||||||
interface ImagesProps {
|
interface ImagesProps {
|
||||||
|
|
@ -83,9 +82,9 @@ const ImageGallery: React.FC<ImagesProps> = ({ handleCopy, handleDelete }) => {
|
||||||
|
|
||||||
const defaultHandleCopy = (id: string) => {
|
const defaultHandleCopy = (id: string) => {
|
||||||
if (navigator.clipboard) {
|
if (navigator.clipboard) {
|
||||||
const link = `${ENV_VARIABLES.IMG_URL}/api/image/get/${id}`;
|
const link = `api/image/get/${id}`;
|
||||||
const imgTag = `[markdown]} "texte de l'infobulle") {T}`;
|
const imgTag = `[markdown] } "texte de l'infobulle (ne fonctionne pas sur écran tactile généralement)") `;
|
||||||
setSnackbarMessage("Le lien Markdown de l’image a été copié dans le presse-papiers");
|
setSnackbarMessage("Le lien Markdown de l'image a été copié dans le presse-papiers");
|
||||||
setSnackbarSeverity("success");
|
setSnackbarSeverity("success");
|
||||||
setSnackbarOpen(true);
|
setSnackbarOpen(true);
|
||||||
navigator.clipboard.writeText(imgTag);
|
navigator.clipboard.writeText(imgTag);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
const ENV_VARIABLES = {
|
const ENV_VARIABLES = {
|
||||||
MODE: process.env.MODE || "production",
|
MODE: process.env.MODE || "production",
|
||||||
VITE_BACKEND_URL: process.env.VITE_BACKEND_URL || "",
|
VITE_BACKEND_URL: process.env.VITE_BACKEND_URL || "",
|
||||||
IMG_URL: process.env.MODE == "development" ? process.env.VITE_BACKEND_URL : process.env.VITE_IMG_URL,
|
|
||||||
BACKEND_URL: process.env.SITE_URL != undefined ? `${process.env.SITE_URL}${process.env.USE_PORTS ? `:${process.env.BACKEND_PORT}` : ''}` : process.env.VITE_BACKEND_URL || '',
|
BACKEND_URL: process.env.SITE_URL != undefined ? `${process.env.SITE_URL}${process.env.USE_PORTS ? `:${process.env.BACKEND_PORT}` : ''}` : process.env.VITE_BACKEND_URL || '',
|
||||||
FRONTEND_URL: process.env.SITE_URL != undefined ? `${process.env.SITE_URL}${process.env.USE_PORTS ? `:${process.env.PORT}` : ''}` : ''
|
FRONTEND_URL: process.env.SITE_URL != undefined ? `${process.env.SITE_URL}${process.env.USE_PORTS ? `:${process.env.PORT}` : ''}` : ''
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ import ImageGalleryModal from 'src/components/ImageGallery/ImageGalleryModal/Ima
|
||||||
|
|
||||||
import ApiService from '../../../services/ApiService';
|
import ApiService from '../../../services/ApiService';
|
||||||
import { escapeForGIFT } from '../../../utils/giftUtils';
|
import { escapeForGIFT } from '../../../utils/giftUtils';
|
||||||
import { ENV_VARIABLES } from '../../../constants';
|
|
||||||
|
|
||||||
interface EditQuizParams {
|
interface EditQuizParams {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -170,7 +169,7 @@ const QuizForm: React.FC = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleCopyImage = (id: string) => {
|
const handleCopyImage = (id: string) => {
|
||||||
const escLink = `${ENV_VARIABLES.IMG_URL}/api/image/get/${id}`;
|
const escLink = `api/image/get/${id}`;
|
||||||
setImageLinks(prevLinks => [...prevLinks, escLink]);
|
setImageLinks(prevLinks => [...prevLinks, escLink]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@ services:
|
||||||
context: ./client
|
context: ./client
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: frontend
|
container_name: frontend
|
||||||
environment:
|
|
||||||
VITE_IMG_URL: http://localhost
|
|
||||||
ports:
|
ports:
|
||||||
- "5173:5173"
|
- "5173:5173"
|
||||||
restart: always
|
restart: always
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ services:
|
||||||
- VITE_BACKEND_URL=
|
- VITE_BACKEND_URL=
|
||||||
# Define empty VITE_BACKEND_SOCKET_URL so it will default to window.location.host
|
# Define empty VITE_BACKEND_SOCKET_URL so it will default to window.location.host
|
||||||
- VITE_BACKEND_SOCKET_URL=
|
- VITE_BACKEND_SOCKET_URL=
|
||||||
- VITE_IMG_URL=https://evalsa.etsmtl.ca
|
|
||||||
ports:
|
ports:
|
||||||
- "5173:5173"
|
- "5173:5173"
|
||||||
restart: always
|
restart: always
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue