Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadim Ritter committed Jun 4, 2024
1 parent b30137a commit e521571
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 58 deletions.
3 changes: 2 additions & 1 deletion client/src/components/views/StartPage.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<template>
<v-row>
<v-col>

<v-data-table
item-value="item.name"
class="rounded-lg elevation-4"
Expand Down Expand Up @@ -68,7 +69,7 @@
</template>

</v-data-table>

</v-col>
</v-row>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
</v-btn>

<!--pause / play-->
<!-- @click="pausePlay()" -->
<v-btn
@click="isPlaying ? pause() : play()"
size="small"
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/views/search/SearchForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
const timePeriodField = ref<number>(1);
const timePeriodRadio = ref<boolean>(true);
const timePeriodSelect = ref<number>(4);
const timePeriodSelect = ref<number>(2);
const timeSelectionRadio = ref<boolean>(false);
const timeSelectionPicker = ref(null);
Expand Down
6 changes: 0 additions & 6 deletions client/src/components/views/search/SearchPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
</v-row>
<!----------------------------------->

<!-- <v-expansion-panels v-model="sessionPanels" variant="popout" multiple> -->
<v-expansion-panels v-model="sessionPanels" multiple>
<v-expansion-panel
v-for="day in sessionsDays"
Expand All @@ -83,11 +82,6 @@
<SearchSessionTable
:day="day"
:search-parameters="searchParameters!">
<!-- :metaData="{
screenProctoringMetadataWindowTitle: metadataSearchWindowTitle!,
screenProctoringMetadataUserAction: metadataSearchAction!,
screenProctoringMetadataURL: metadataSearchUrl!,
}" -->
</SearchSessionTable>
</v-expansion-panel-text>

Expand Down
1 change: 0 additions & 1 deletion client/src/components/views/search/SearchSessionTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
const props = defineProps<{
day: string;
searchParameters: OptionalParSearchSessions
// metaData: MetaData
}>();
//items
Expand Down
46 changes: 1 addition & 45 deletions client/src/utils/groupingUtils.ts
Original file line number Diff line number Diff line change
@@ -1,48 +1,5 @@
import * as timeUtils from "@/utils/timeUtils";

//=============grouping==================
export function groupSessionsByDay(sessionSearchResults: SearchSessions): SessionsGrouped{
const sessionsGrouped: SessionsGrouped = {
numberOfPages: sessionSearchResults.numberOfPages,
pageNumber: sessionSearchResults.pageNumber,
pageSize: sessionSearchResults.pageSize,
sort: sessionSearchResults.sort,
content: [
{
day: "",
sessions: []
}
]
};

const uniqueDaysSet: Set<string> = new Set(
sessionSearchResults.content.map(
session => timeUtils.formatTimestampToDate(session.startTime)
)
);
const uniqueDays: string[] = [...uniqueDaysSet];

const dayToIndexMap: {[day: string]: number} = {};

for(var i = 0; i < uniqueDays.length; i++){
sessionsGrouped.content[i] = {
day: uniqueDays[i],
sessions: []
}
dayToIndexMap[uniqueDays[i]] = i;
}

for(var i = 0; i < sessionSearchResults.content.length; i++){
const day = timeUtils.formatTimestampToDate(sessionSearchResults.content[i].startTime);
const index = dayToIndexMap[day];
if (index !== undefined) {
sessionsGrouped.content[index].sessions.push(sessionSearchResults.content[i]);
}
}

return sessionsGrouped;
}

//todo: improve this function
export function groupScreenshotsByMetadata(screenshotGroupList: ScreenshotGroup[], isSearchView: boolean): ScreenshotsGrouped[] | null{

Expand Down Expand Up @@ -100,5 +57,4 @@ export function groupScreenshotsByMetadata(screenshotGroupList: ScreenshotGroup[


return groups;
}
//==============================
}
2 changes: 0 additions & 2 deletions client/src/utils/table/tableUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export function calcDefaultItemsPerPage(itemList: any): number {

let maxLength: number = 0;
if(typeof itemList == "number"){
// console.log("it got here default items per page")
maxLength = itemList;
}else{
maxLength = itemList.length;
Expand Down Expand Up @@ -76,7 +75,6 @@ export function handleTabKeyEvent(event: any, action: string, key: number, optio
}
}


export function sortTable(key: number, headerRefs: any){
if(headerRefs.value != null){
headerRefs.value[key].click();
Expand Down
1 change: 0 additions & 1 deletion server/src/controllers/search.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as apiService from "../services/api.service";
import * as searchService from '../services/search.service';

export async function searchSessionsDay(req: Request, res: Response){

try{
const sessions: object = await searchService.searchSessionsDay(req.headers.authorization, req.query.optionalParamters);

Expand Down

0 comments on commit e521571

Please sign in to comment.