Changeset 8dffe02 for reactapp/src


Ignore:
Timestamp:
01/22/23 16:51:43 (2 years ago)
Author:
unknown <mlviktor23@…>
Branches:
main
Parents:
9bf1f8d
Message:

prefinal reproducible

Location:
reactapp/src
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • reactapp/src/Components/OpinionTree.js

    r9bf1f8d r8dffe02  
    4646
    4747  useEffect(() => {
    48     const url = `http://192.168.1.254:8080/secure/currentUser`;
     48    const url = `http://192.168.1.108:8080/secure/currentUser`;
    4949
    5050    const fetchUser = async () => {
     
    7272      ) {
    7373        const response = await axios(
    74           `http://192.168.1.254:8080/secure/upvoteOpinion/${post.postId}`,
     74          `http://192.168.1.108:8080/secure/upvoteOpinion/${post.postId}`,
    7575          {
    7676            method: "get",
     
    9595      ) {
    9696        const response = await axios(
    97           `http://192.168.1.254:8080/secure/downvoteOpinion/${post.postId}`,
     97          `http://192.168.1.108:8080/secure/downvoteOpinion/${post.postId}`,
    9898          {
    9999            method: "get",
     
    150150    if (!replyContent.length < 1) {
    151151      const response = await axios(
    152         `http://192.168.1.254:8080/secure/professor/${professor.professorId}/replyToOpinion/${postId}`,
     152        `http://192.168.1.108:8080/secure/professor/${professor.professorId}/replyToOpinion/${postId}`,
    153153        {
    154154          method: "post",
     
    171171    if (!reportContent.length < 1) {
    172172      const response = await axios(
    173           `http://192.168.1.254:8080/secure/reportOpinion/${postId}`,
     173          `http://192.168.1.108:8080/secure/reportOpinion/${postId}`,
    174174          {
    175175            method: "post",
  • reactapp/src/Components/Search.js

    r9bf1f8d r8dffe02  
    1818    const fetchData = async () => {
    1919      try {
    20         Promise.all([fetch(`http://192.168.1.254:8080/public/professors/nameContains/${transliterate(query)}`),
    21           fetch(`http://192.168.1.254:8080/public/subjects/nameContains/${transliterate(query)}`)])
     20        Promise.all([fetch(`http://192.168.1.108:8080/public/professors/nameContains/${transliterate(query)}`),
     21          fetch(`http://192.168.1.108:8080/public/subjects/nameContains/${transliterate(query)}`)])
    2222            .then(([resProfessors, resSubjects]) => Promise.all([resProfessors.json(), resSubjects.json()]))
    2323            .then(([dataProfessors, dataSubjects]) => {
  • reactapp/src/Components/Styled/Search.style.js

    r9bf1f8d r8dffe02  
    33
    44export const SearchBox = styled.input`
    5   width: 450px;
     5  width: 350px;
    66  box-sizing: border-box;
    77  border: 2px solid #ccc;
     
    2323  padding: 12px 16px;
    2424  z-index: 1;
    25   width: 450px;
     25  width: 350px;
    2626  padding: 0;
    2727`;
  • reactapp/src/Components/SubjectsAccordion.js

    r9bf1f8d r8dffe02  
    2323      setOpacity(1);
    2424      try {
    25         Promise.all([fetch(`http://192.168.1.254:8080/public/subjects?studyProgrammeId=${props.title.studyProgrammeId}`),
    26           fetch(`http://192.168.1.254:8080/public/study_programme/${props.title.studyProgrammeId}/threadCountForEachSubject`)])
     25        Promise.all([fetch(`http://192.168.1.108:8080/public/subjects?studyProgrammeId=${props.title.studyProgrammeId}`),
     26          fetch(`http://192.168.1.108:8080/public/study_programme/${props.title.studyProgrammeId}/threadCountForEachSubject`)])
    2727            .then(([resSubjects, counts]) => Promise.all([resSubjects.json(), counts.json()]))
    2828            .then(([dataSubjects, dataCounts]) => {
  • reactapp/src/Components/UserHeader.js

    r9bf1f8d r8dffe02  
    1111
    1212  useEffect(() => {
    13     const url = `http://192.168.1.254:8080/secure/currentUser`;
     13    const url = `http://192.168.1.108:8080/secure/currentUser`;
    1414
    1515    const fetchUser = async () => {
  • reactapp/src/Pages/Faculty.js

    r9bf1f8d r8dffe02  
    3434    const fetchProfessors = async () => {
    3535      try {
    36         const response = await fetch(`http://192.168.1.254:8080/public/professors?facultyId=${params.facultyId}`);
     36        const response = await fetch(`http://192.168.1.108:8080/public/professors?facultyId=${params.facultyId}`);
    3737        let cyclicGraph = await response.json();
    3838        let jsogStructure = JSOG.encode(cyclicGraph);
     
    4747    const fetchStudyProgrammes = async () => {
    4848      try {
    49         const response2 = await fetch(`http://192.168.1.254:8080/public/study_programmes?facultyId=${params.facultyId}`);
     49        const response2 = await fetch(`http://192.168.1.108:8080/public/study_programmes?facultyId=${params.facultyId}`);
    5050        let cyclicGraph2 = await response2.json();
    5151        let jsogStructure2 = JSOG.encode(cyclicGraph2);
     
    6060    const fetchProfessorOpinionCount = async () => {
    6161      try {
    62         const response3 = await fetch(`http://192.168.1.254:8080/public/faculty/${params.facultyId}/opinionCountForEachProfessor`);
     62        const response3 = await fetch(`http://192.168.1.108:8080/public/faculty/${params.facultyId}/opinionCountForEachProfessor`);
    6363        let cyclicGraph3 = await response3.json();
    6464        let jsogStructure3 = JSOG.encode(cyclicGraph3);
  • reactapp/src/Pages/Home.js

    r9bf1f8d r8dffe02  
    1414
    1515    useEffect(() => {
    16         Promise.all([fetch(`http://192.168.1.254:8080/public/latest10opinions`),
    17             fetch(`http://192.168.1.254:8080/public/latest10threads`)])
     16        Promise.all([fetch(`http://192.168.1.108:8080/public/latest10opinions`),
     17            fetch(`http://192.168.1.108:8080/public/latest10threads`)])
    1818            .then(([resOpinions, resThreads]) => Promise.all([resOpinions.json(), resThreads.json()]))
    1919            .then(([dataOpinions, dataThreads]) => {
  • reactapp/src/Pages/Professor.js

    r9bf1f8d r8dffe02  
    4242
    4343  useEffect(() => {
    44      Promise.all([fetch(`http://192.168.1.254:8080/public/professor/${params.professorId}`),
    45      fetch(`http://192.168.1.254:8080/public/professor/${params.professorId}/relatedOpinions`)])
     44     Promise.all([fetch(`http://192.168.1.108:8080/public/professor/${params.professorId}`),
     45     fetch(`http://192.168.1.108:8080/public/professor/${params.professorId}/relatedOpinions`)])
    4646        .then(([resProfessor, resRelatedOpinions]) => Promise.all([resProfessor.json(), resRelatedOpinions.json()]))
    4747        .then(([dataProfessor, dataRelatedOpinions]) => {
     
    8080    if (!postContent.length < 1) {
    8181      const response = await axios(
    82         `http://192.168.1.254:8080/secure/professor/${params.professorId}/addOpinion`,
     82        `http://192.168.1.108:8080/secure/professor/${params.professorId}/addOpinion`,
    8383        {
    8484          method: "post",
  • reactapp/src/Pages/PublicUserProfile.js

    r9bf1f8d r8dffe02  
    1313    useEffect(() => {
    1414            const fetchPublicProfile = async () => {
    15                 const resp = await fetch(`http://192.168.1.254:8080/public/user/${params.userId}`)
     15                const resp = await fetch(`http://192.168.1.108:8080/public/user/${params.userId}`)
    1616                let cyclicGraph = await resp.json();
    1717                let jsogStructure = JSOG.encode(cyclicGraph);
  • reactapp/src/Pages/Subject.js

    r9bf1f8d r8dffe02  
    5050
    5151  useEffect(() => {
    52     Promise.all([fetch(`http://192.168.1.254:8080/public/subject/${params.subjectId}`),
    53                         fetch(`http://192.168.1.254:8080/public/subject/${params.subjectId}/threads`)])
     52    Promise.all([fetch(`http://192.168.1.108:8080/public/subject/${params.subjectId}`),
     53                        fetch(`http://192.168.1.108:8080/public/subject/${params.subjectId}/threads`)])
    5454        .then(([resSubject, resThreads]) => Promise.all([resSubject.json(), resThreads.json()]))
    5555        .then(([dataSubject, dataThreads]) => {
     
    8888    if (!topicTitle.length < 1 && !topicContent.length < 1) {
    8989      const response = await axios(
    90         `http://192.168.1.254:8080/secure/subject/${params.subjectId}/addThread`,
     90        `http://192.168.1.108:8080/secure/subject/${params.subjectId}/addThread`,
    9191        {
    9292          method: "post",
     
    214214            <EntityUl key={topic.postId}>
    215215              <EntityLi bgcolor="cornsilk">
    216                 <a href={"/topic/" + topic.postId}>{topic.title.length >= 99 ? topic.title.slice(0,98) + "..." : topic.title}</a>
     216                <a href={"/topic/" + topic.postId}>{topic.title.length >= 65 ? topic.title.slice(0,65) + "..." : topic.title}</a>
    217217                <EntityParam right="30px">
    218218                  <span style={{ fontWeight: "normal" }}>
  • reactapp/src/Pages/Topic.js

    r9bf1f8d r8dffe02  
    5555
    5656  useEffect(() => {
    57     const url1 = `http://192.168.1.254:8080/public/thread/${params.topicId}`;
    58     const url2 = `http://192.168.1.254:8080/secure/currentUser`;
     57    const url1 = `http://192.168.1.108:8080/public/thread/${params.topicId}`;
     58    const url2 = `http://192.168.1.108:8080/secure/currentUser`;
    5959
    6060    const fetchTopic = async () => {
     
    121121    if (!replyContent.length < 1) {
    122122      const response = await axios(
    123         `http://192.168.1.254:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`,
     123        `http://192.168.1.108:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${postId}`,
    124124        {
    125125          method: "post",
     
    142142    if (!reportContent.length < 1) {
    143143      const response = await axios(
    144           `http://192.168.1.254:8080/secure/reportThread/${postId}`,
     144          `http://192.168.1.108:8080/secure/reportThread/${postId}`,
    145145          {
    146146            method: "post",
     
    171171    if (!postContent.length < 1) {
    172172      const response = await axios(
    173         `http://192.168.1.254:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`,
     173        `http://192.168.1.108:8080/secure/subject/${thread.targetSubject.subjectId}/replyToThread/${params.topicId}`,
    174174        {
    175175          method: "post",
     
    204204      ) {
    205205        const response = await axios(
    206           `http://192.168.1.254:8080/secure/upvoteThread/${post.postId}`,
     206          `http://192.168.1.108:8080/secure/upvoteThread/${post.postId}`,
    207207          {
    208208            method: "get",
     
    227227      ) {
    228228        const response = await axios(
    229           `http://192.168.1.254:8080/secure/downvoteThread/${post.postId}`,
     229          `http://192.168.1.108:8080/secure/downvoteThread/${post.postId}`,
    230230          {
    231231            method: "get",
  • reactapp/src/Pages/University.js

    r9bf1f8d r8dffe02  
    2828
    2929  useEffect(() => {
    30         Promise.all([fetch(`http://192.168.1.254:8080/public/faculties?universityId=${params.universityId}`),
    31         fetch(`http://192.168.1.254:8080/public/university/${params.universityId}/sectionAndPostCount`)])
     30        Promise.all([fetch(`http://192.168.1.108:8080/public/faculties?universityId=${params.universityId}`),
     31        fetch(`http://192.168.1.108:8080/public/university/${params.universityId}/sectionAndPostCount`)])
    3232            .then(([resFaculties, counts]) => Promise.all([resFaculties.json(), counts.json()]))
    3333            .then(([dataFaculties, dataCounts]) => {
  • reactapp/src/Pages/UserDashboard.js

    r9bf1f8d r8dffe02  
    9595    if (newOpinionTargetProfessorId!=="") {
    9696        try {
    97           Promise.all([fetch(`http://192.168.1.254:8080/public/professor/${newOpinionTargetProfessorId}`),
    98             fetch(`http://192.168.1.254:8080/public/professor/${newOpinionTargetProfessorId}/relatedOpinions`)])
     97          Promise.all([fetch(`http://192.168.1.108:8080/public/professor/${newOpinionTargetProfessorId}`),
     98            fetch(`http://192.168.1.108:8080/public/professor/${newOpinionTargetProfessorId}/relatedOpinions`)])
    9999              .then(([resNewOpinionTargetProfessor, resNewProfessorRelatedOpinions]) => Promise.all([resNewOpinionTargetProfessor.json(), resNewProfessorRelatedOpinions.json()]))
    100100              .then(([dataNewOpinionTargetProfessor, dataNewProfessorRelatedOpinions]) => {
     
    130130    if (newTargetSubjectId!=="") {
    131131      try {
    132         Promise.all([fetch(`http://192.168.1.254:8080/public/subject/${newTargetSubjectId}`),
    133         fetch(`http://192.168.1.254:8080/public/subject/${newTargetSubjectId}/threads`)])
     132        Promise.all([fetch(`http://192.168.1.108:8080/public/subject/${newTargetSubjectId}`),
     133        fetch(`http://192.168.1.108:8080/public/subject/${newTargetSubjectId}/threads`)])
    134134            .then(([resNewTargetSubject, resNewTargetSubjectThreads]) => Promise.all([resNewTargetSubject.json(), resNewTargetSubjectThreads.json()]))
    135135            .then(([dataNewTargetSubject, dataNewTargetSubjectThreads]) => {
     
    158158      try {
    159159        if(!loadedUser) {
    160           Promise.all([axios.get(`http://192.168.1.254:8080/secure/currentUser`, {withCredentials:true}),
    161             axios.get(`http://192.168.1.254:8080/secure/currentUser/posts`, {withCredentials:true})])
     160          Promise.all([axios.get(`http://192.168.1.108:8080/secure/currentUser`, {withCredentials:true}),
     161            axios.get(`http://192.168.1.108:8080/secure/currentUser/posts`, {withCredentials:true})])
    162162              .then(([resUser, resAuthoredPosts]) => Promise.all([resUser.data, resAuthoredPosts.data]))
    163163              .then(([dataUser, dataAuthoredPosts]) => {
     
    183183    const fetchPostReports = async () => {
    184184      try {
    185         const response = await axios.get(`http://192.168.1.254:8080/secure/getAllPostReports`, {withCredentials: true});
     185        const response = await axios.get(`http://192.168.1.108:8080/secure/getAllPostReports`, {withCredentials: true});
    186186        var cyclicGraph = await response.data;
    187187        var jsogStructure = JSOG.encode(cyclicGraph);
     
    202202    try {
    203203      if(reportForModal.post !== null && reportForModal.post.targetProfessor !== undefined) {
    204         await axios(`http://192.168.1.254:8080/secure/updateOpinion/${reportForModal.post.postId}`,
     204        await axios(`http://192.168.1.108:8080/secure/updateOpinion/${reportForModal.post.postId}`,
    205205            {
    206206              method: "put",
     
    212212              withCredentials: true,
    213213            })
    214         await axios(`http://192.168.1.254:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{
     214        await axios(`http://192.168.1.108:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{
    215215          method: "get",
    216216          withCredentials: true
    217217        })
    218218      } else if(reportForModal.post !== null && reportForModal.post.targetProfessor === undefined) {
    219         await axios(`http://192.168.1.254:8080/secure/updateThread/${reportForModal.post.postId}`,
     219        await axios(`http://192.168.1.108:8080/secure/updateThread/${reportForModal.post.postId}`,
    220220            {
    221221              method: "put",
     
    229229            })
    230230      }
    231       await axios(`http://192.168.1.254:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{
     231      await axios(`http://192.168.1.108:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{
    232232          method: "get",
    233233          withCredentials: true
     
    243243    try {
    244244      if(reportForModal.post !== null && reportForModal.post.targetProfessor !== undefined) {
    245         var response = await axios(`http://192.168.1.254:8080/secure/updateOpinion/${reportForModal.post.postId}`,
     245        var response = await axios(`http://192.168.1.108:8080/secure/updateOpinion/${reportForModal.post.postId}`,
    246246            {
    247247              method: "put",
     
    253253              withCredentials: true,
    254254            })
    255         await axios(`http://192.168.1.254:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{
     255        await axios(`http://192.168.1.108:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{
    256256          method: "get",
    257257          withCredentials: true
    258258        })
    259259      } else if(reportForModal.post !== null && reportForModal.post.targetProfessor === undefined) {
    260         var response = await axios(`http://192.168.1.254:8080/secure/updateThread/${reportForModal.post.postId}`,
     260        var response = await axios(`http://192.168.1.108:8080/secure/updateThread/${reportForModal.post.postId}`,
    261261            {
    262262              method: "put",
     
    270270            })
    271271      }
    272       await axios(`http://192.168.1.254:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{
     272      await axios(`http://192.168.1.108:8080/secure/markReportResolved/${reportForModal.postReportId}/${markResolved ? `resolve` : `open`}`,{
    273273        method: "get",
    274274        withCredentials: true
     
    285285    try {
    286286      if(reportForModal.post !== null && reportForModal.post.targetProfessor !== undefined) {
    287         await axios(`http://192.168.1.254:8080/secure/deleteOpinion/${reportForModal.post.postId}`,
     287        await axios(`http://192.168.1.108:8080/secure/deleteOpinion/${reportForModal.post.postId}`,
    288288            {
    289289              method: "delete",
     
    292292        window.location.reload();
    293293      } else if(reportForModal.post !== null && reportForModal.post.targetProfessor === undefined) {
    294         await axios(`http://192.168.1.254:8080/secure/deleteThread/${reportForModal.post.postId}`,
     294        await axios(`http://192.168.1.108:8080/secure/deleteThread/${reportForModal.post.postId}`,
    295295            {
    296296              method: "delete",
  • reactapp/src/api/axios.js

    r9bf1f8d r8dffe02  
    22
    33export default axios.create({
    4   baseURL: "http://192.168.1.254:8080",
     4  baseURL: "http://192.168.1.108:8080",
    55});
Note: See TracChangeset for help on using the changeset viewer.