diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/edit.test.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/edit.test.js index ae3d329eba03c86fe5635cf9f030d667af8d87af..aa7054841426700d228235f45c875cd0187d487e 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/edit.test.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Project/edit.test.js @@ -40,9 +40,9 @@ const setMockSpy = (() => { periodCategoriesSpy.mockImplementation(() => { return Promise.resolve([{ url: "Single Cycle", value: 'Single Cycle' }, { url: "Long Term", value: 'Long Term' }]) }); allCycleSpy = jest.spyOn(CycleService, 'getAllCycles'); allCycleSpy.mockImplementation(() => { - return Promise.resolve([{ url: "http://localhost:3000/api/cycle/Cycle-0/", name: 'Cycle-0' }, - { url: "http://localhost:3000/api/cycle/Cycle-1/", name: 'Cycle-1' }, - { url: "http://192.168.99.100:8008/api/cycle/Cycle%200/", name: 'Cycle 0' }]); + return Promise.resolve([{ url: "https://localhost:3000/api/cycle/Cycle-0/", name: 'Cycle-0' }, + { url: "https://localhost:3000/api/cycle/Cycle-1/", name: 'Cycle-1' }, + { url: "https://192.168.99.100:8008/api/cycle/Cycle%200/", name: 'Cycle 0' }]); }); projectDetailsSpy = jest.spyOn(ProjectService, 'getProjectDetails'); projectDetailsSpy.mockImplementation((id) => { diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/WeekView.js b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/WeekView.js index ca4e793ec28914ac06918aef36c5a64af9920cc0..a1dc2add34decfd0ccb7dadd42d31fe9b9ccf5cb 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/WeekView.js +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/WeekView.js @@ -327,6 +327,7 @@ export default function WeekView(props) { useEffect(() => { // Check if the forceUpdate prop has changed and trigger a re-render console.log(" Foring refrfeh") + if (props.grouping!==undefined) updateGrouping(props.grouping); }, [props.grouping]); diff --git a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/__snapshots__/WeekView.test.js.snap b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/__snapshots__/WeekView.test.js.snap index 37ddc5523c0836573e683219638ffe48d376c9ab..1a18210c5226df8a95440ef6632f58f9c5c4a75e 100644 --- a/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/__snapshots__/WeekView.test.js.snap +++ b/SAS/TMSS/frontend/tmss_webapp/src/routes/Timeline/__snapshots__/WeekView.test.js.snap @@ -49,7 +49,7 @@ exports[`WeekView Render Contents WeekView renders correctly with data: DuringLo Group By </span> <div - class="p-dropdown p-component p-inputwrapper w-full md:w-14rem" + class="p-dropdown p-component p-inputwrapper p-inputwrapper-filled w-full md:w-14rem" data-pc-name="dropdown" data-pc-section="root" > @@ -76,15 +76,17 @@ exports[`WeekView Render Contents WeekView renders correctly with data: DuringLo <option data-pc-section="option" selected="" - value="" - /> + value="group" + > + No Grouping + </option> </select> </div> <span - class="p-dropdown-label p-inputtext p-dropdown-label-empty" + class="p-dropdown-label p-inputtext" data-pc-section="input" > - empty + No Grouping </span> <div aria-expanded="false" @@ -1736,37 +1738,60 @@ exports[`WeekView Render Contents WeekView renders correctly with data: DuringLo </div> <div class="rct-outer" - style="height: 0px;" + style="height: 40px;" > <div class="rct-sidebar" - style="width: 150px; height: 0px;" + style="width: 150px; height: 40px;" > <div style="width: 150px;" - /> + > + <div + class="rct-sidebar-row rct-sidebar-row-even" + style="height: 40px; line-height: 40px;" + > + <div + class="group-renderer" + > + <span + class="week" + > + 49 + </span> + <a + href="/constraint/view/2023-12-03" + target="_new" + > + Dec 03 - Sun + </a> + </div> + </div> + </div> </div> <div class="rct-scroll" - style="width: -150px; height: 20px; cursor: default; position: relative;" + style="width: -150px; height: 60px; cursor: default; position: relative;" > <div style="position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px;" > - <div - style="position: absolute; top: 0px; bottom: 0px; width: 2px; pointer-events: none; left: -146.71003136610378px; z-index: 998;" - /> <div class="rct-vertical-lines" > <div class="rct-vl " - style="pointer-events: none; top: 0px; left: 50400.58334008495px; width: -54750.6336878899px; height: 0px;" + style="pointer-events: none; top: 0px; left: 50400.58334008495px; width: -54750.6336878899px; height: 40px;" /> </div> <div class="rct-horizontal-lines" - /> + > + <div + class="rct-hl-even " + style="width: -150px; height: 40px;" + /> + </div> <div class="rct-items" /> @@ -1869,7 +1894,7 @@ exports[`WeekView Render Contents WeekView renders correctly with data: Loaded 1 Group By </span> <div - class="p-dropdown p-component p-inputwrapper w-full md:w-14rem" + class="p-dropdown p-component p-inputwrapper p-inputwrapper-filled w-full md:w-14rem" data-pc-name="dropdown" data-pc-section="root" > @@ -1896,15 +1921,17 @@ exports[`WeekView Render Contents WeekView renders correctly with data: Loaded 1 <option data-pc-section="option" selected="" - value="" - /> + value="group" + > + No Grouping + </option> </select> </div> <span - class="p-dropdown-label p-inputtext p-dropdown-label-empty" + class="p-dropdown-label p-inputtext" data-pc-section="input" > - empty + No Grouping </span> <div aria-expanded="false" @@ -3556,37 +3583,60 @@ exports[`WeekView Render Contents WeekView renders correctly with data: Loaded 1 </div> <div class="rct-outer" - style="height: 0px;" + style="height: 40px;" > <div class="rct-sidebar" - style="width: 150px; height: 0px;" + style="width: 150px; height: 40px;" > <div style="width: 150px;" - /> + > + <div + class="rct-sidebar-row rct-sidebar-row-even" + style="height: 40px; line-height: 40px;" + > + <div + class="group-renderer" + > + <span + class="week" + > + 49 + </span> + <a + href="/constraint/view/2023-12-03" + target="_new" + > + Dec 03 - Sun + </a> + </div> + </div> + </div> </div> <div class="rct-scroll" - style="width: -150px; height: 20px; cursor: default; position: relative;" + style="width: -150px; height: 60px; cursor: default; position: relative;" > <div style="position: absolute; left: 0px; right: 0px; top: 0px; bottom: 0px;" > - <div - style="position: absolute; top: 0px; bottom: 0px; width: 2px; pointer-events: none; left: -146.71003136610378px; z-index: 998;" - /> <div class="rct-vertical-lines" > <div class="rct-vl " - style="pointer-events: none; top: 0px; left: 50400.58334008495px; width: -54750.6336878899px; height: 0px;" + style="pointer-events: none; top: 0px; left: 50400.58334008495px; width: -54750.6336878899px; height: 40px;" /> </div> <div class="rct-horizontal-lines" - /> + > + <div + class="rct-hl-even " + style="width: -150px; height: 40px;" + /> + </div> <div class="rct-items" />