Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ react-ystemandchess/environment.prod.ts
react-ystemandchess/environment.ts
environment.php
.env
environment.*
environment.*.local
environment.secret.*
create_envs.sh
create_env.sh
create_dev_envs.sh
Expand Down
2 changes: 1 addition & 1 deletion react-ystemandchess/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import "./App.css";
import React, { useEffect } from "react";
import { BrowserRouter as Router } from "react-router-dom";
import { environment } from "./core/environments/environment";
import { environment } from "./environments/environment";
import { useCookies } from "react-cookie";
import { SetPermissionLevel } from "./globals";
import NavBar from "./components/navbar/NavBar";
Expand Down
3 changes: 1 addition & 2 deletions react-ystemandchess/src/core/services/badgesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
* - getUserBadges: Fetches badges earned by a specific user
*/

import { environment } from "../environments/environment";

import { environment } from "../../environments/environment";
/**
* Fetches the complete catalog of all available badges
*
Expand Down
13 changes: 13 additions & 0 deletions react-ystemandchess/src/environments/environment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const environment = {
production: false,
agora: {
appId: '6b7772f2a76f406192d8167460181be0',
},
urls: {
middlewareURL: 'http://localhost:8000',
chessClientURL: 'http://localhost',
stockFishURL: 'http://localhost:8080/stockfishserver/',
chessServer: 'http://localhost:3001/',
},
productionType: 'development', // development/production
};
12 changes: 12 additions & 0 deletions react-ystemandchess/src/environments/environment.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const environment = {
production: false,
agora: {
appId: '6c368b93b82a4b3e9fb8e57da830f2a4',
},
urls: {
middlewareURL: 'http://localhost/middleware/',
chessClientURL: 'http://localhost/chessclient/',
stockFishURL: 'http://localhost/stockfishserver/',
chessServer: 'http://localhost/chessserver/',
},
};
2 changes: 1 addition & 1 deletion react-ystemandchess/src/features/auth/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
// import { Link } from 'react-router-dom';
import './Login.scss';
import { useState } from 'react';
import { environment } from "../../../core/environments/environment";
import { environment } from "../../../environments/environment";
import { useCookies } from 'react-cookie';

const Login = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Uses Nodemailer with Gmail to deliver reset links.
*/

import { environment } from "../../../../core/environments/environment";
import { environment } from "../../../../environments/environment";
const nodemailer = require('nodemailer');

// Configure email transporter with Gmail credentials
Expand Down
2 changes: 1 addition & 1 deletion react-ystemandchess/src/features/auth/signup/SignUp.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect, useRef } from 'react';
import './SignUp.scss';
import { environment } from '../../../core/environments/environment';
import { environment } from '../../../environments/environment';

// Define the interface for the props of the StudentTemplate component
interface StudentTemplateProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import profileStyles from "./ProfileStyle.module.scss";
import pageStyles from "./LessonsStyle.module.scss";
import { useNavigate } from "react-router";
import { useState, useEffect, useRef, useCallback, useMemo } from 'react';
import { environment } from "../../../core/environments/environment";
import { environment } from "../../../environments/environment";
import { getAllScenarios } from "../lessons-main/Scenarios";
import { useCookies } from "react-cookie";
import ScenarioTemplate from "./ScenarioTemplate/ScenarioTemplate.jsx"; // Importing the ScenarioTemplate component
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useCallback } from "react";
import { environment } from "../../../../../core/environments/environment";
import { environment } from "../../../../../environments/environment";

export function useLessonManager(piece: string, cookies: any, initialLessonNum?: number) {
const [lessonNum, setLessonNum] = useState<number>(initialLessonNum ?? 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { environment } from "../../../../../core/environments/environment";
import { environment } from "../../../../../environments/environment";
import { useEffect, useRef } from "react";
import io from "socket.io-client";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { renderHook, act } from "@testing-library/react";
import { useTimeTracking } from "./useTimeTracking";
import { SetPermissionLevel } from "../../../../../globals";
import { environment } from "../../../../../core/environments/environment";
import { environment } from "../../../../../environments/environment";

// mock SetPermissionLevel
jest.mock("../../../../../globals", () => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from "react";
import { environment } from "../../../../../core/environments/environment";
import { environment } from "../../../../../environments/environment";
import { SetPermissionLevel } from "../../../../../globals";

export function useTimeTracking(piece: string, cookies: any) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "./NewMentorProfile.scss";
import Images from "../../../assets/images/imageImporter";
import { SetPermissionLevel } from '../../../globals';
import { useCookies } from 'react-cookie';
import { environment } from "../../../core/environments/environment";
import { environment } from "../../../environments/environment";
import { useNavigate } from "react-router";
import StatsChart from "../../student/student-profile/StatsChart";
import Lessons from "../../lessons/lessons-main/Lessons";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "./NewMentorProfile.scss";
import Images from "../../../../assets/images/imageImporter";
import { SetPermissionLevel } from '../../../../globals';
import { useCookies } from 'react-cookie';
import { environment } from "../../../../core/environments/environment";
import { environment } from "../../../../environments/environment";
import { useNavigate } from "react-router";
import StatsChart from "../../../student/student-profile/StatsChart";
import Lessons from "../../../lessons/lessons-main/Lessons";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import profileStyles from "./Puzzles-profile.module.scss";
import { Chess } from "chess.js";
import { themesName, themesDescription } from "../../../core/services/themesService";
import Swal from 'sweetalert2';
import { environment } from "../../../core/environments/environment";
import { environment } from "../../../environments/environment";
import { v4 as uuidv4 } from "uuid";
import { SetPermissionLevel } from "../../../globals";
import { useCookies } from 'react-cookie';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {useState} from "react";
import "./Student.scss";
import {environment} from "../../../core/environments/environment";
import {environment} from "../../../environments/environment";

const Student = () => {
const chessSrc = environment.urls.chessClientURL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { ReactComponent as TopicBag } from "../../../../assets/images/Activities
import { ReactComponent as ShortBottomVine} from "../../../../assets/images/ActivitiesAssets/short_bottom_vine.svg";
import { ReactComponent as BottomVine} from "../../../../assets/images/ActivitiesAssets/bottom_vine.svg";
import { ReactComponent as Stemmy} from "../../../../assets/images/ActivitiesAssets/stemmy.svg";
import { environment } from "../../../../core/environments/environment";
import { environment } from "../../../../environments/environment";
import { useCookies } from "react-cookie";
import { parseActivities } from "../../../../core/utils/activityNames";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "./NewStudentProfile.scss";
import Images from "../../../assets/images/imageImporter";
import { SetPermissionLevel } from '../../../globals';
import { useCookies } from 'react-cookie';
import { environment } from "../../../core/environments/environment";
import { environment } from "../../../environments/environment";
import { useNavigate } from "react-router";
import { useLocation } from "react-router";
import StatsChart from "./StatsChart";
Expand Down
2 changes: 1 addition & 1 deletion react-ystemandchess/src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* components, particularly for authentication and permission management.
*/

import { environment } from "./core/environments/environment";
import { environment } from "./environments/environment";

/**
* Global variable to store user information after authentication
Expand Down