-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(teammanagementlastactivity): implemented route call in TeamInfoCard
- Loading branch information
Showing
7 changed files
with
141 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { defineStore } from "pinia"; | ||
|
||
interface State { | ||
language: string | null; | ||
} | ||
|
||
export const useLanguageStore = defineStore("languageStore", { | ||
state: () => ({ | ||
//the current language used by the website | ||
language: localStorage.getItem("language"), | ||
}), | ||
|
||
getters: { | ||
getLanguage: (state: State) => state.language, | ||
}, | ||
|
||
actions: { | ||
// allows to set the current language option | ||
async setLanguage(newLanguage: string) { | ||
this.language = newLanguage; | ||
localStorage.setItem("language", newLanguage); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { defineStore } from "pinia"; | ||
import { statisticsService } from "@/services/statistics.service"; | ||
|
||
export type teamActivity = { | ||
teamId: String; | ||
lastActivityDate: Date; | ||
}; | ||
|
||
interface State { | ||
teamsLatestActivity: teamActivity[]; | ||
} | ||
|
||
export const useStatisticsStore = defineStore("statisticsStore", { | ||
state: () => ({ | ||
//list of latest activities for a group of teams associated to a customer | ||
teamsLatestActivity: [] as teamActivity[], | ||
}), | ||
|
||
getters: { | ||
getTeamsLatestActivity: (state: State) => state.teamsLatestActivity, | ||
}, | ||
|
||
actions: { | ||
// API call to get the latest activites for a group of teams associated to a customer | ||
async setTeamsLatestActivityByCustomerId(customerId?: number, teamId?: number) { | ||
this.teamsLatestActivity = await statisticsService.getLatestTeamActivityByCustomerId( | ||
customerId, | ||
teamId, | ||
); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters