Skip to content

Commit

Permalink
EPMRPP-96296 || Update 'relationships' property to 'stats' to align w…
Browse files Browse the repository at this point in the history
…ith backend changes
  • Loading branch information
maria-hambardzumian committed Oct 15, 2024
1 parent d6c5981 commit 64faa64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export const OrganizationCard = ({ organization }) => {
const { formatMessage } = useIntl();
const { userRole, organizationRole } = useSelector(userRolesSelector);
const hasPermission = userRole === ADMINISTRATOR || organizationRole === MANAGER;
const usersCount = organization.relationships.users.meta.count;
const projectsCount = organization.relationships.projects.meta.count;
const lastLaunch = organization.relationships.launches.meta.last_occurred_at;
const usersCount = organization.stats.users.meta.count;
const projectsCount = organization.stats.projects.meta.count;
const lastLaunch = organization.stats.launches.meta.last_occurred_at;
const { value: relativeTime, unit } = getRelativeUnits(new Date(lastLaunch));
const isOutdated = Date.now() - new Date(lastLaunch).getTime() > THREE_MONTHS;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const ProjectsListTable = ({
const data = useMemo(
() =>
projects.map((project) => {
const lastLaunch = project.relationships.launches.meta.last_occurred_at;
const lastLaunch = project.stats?.launches.meta.last_occurred_at;
return {
id: project.id,
name: {
Expand All @@ -80,8 +80,8 @@ export const ProjectsListTable = ({
</div>
),
},
usersCount: project.relationships.users.meta.count,
launchesCount: project.relationships.launches.meta.count,
usersCount: project.stats.users.meta.count,
launchesCount: project.stats.launches.meta.count,
lastLaunch: {
content: lastLaunch,
component: lastLaunch ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export const ProjectsPageHeaderWrapped = ({
const { formatMessage } = useIntl();
const organization = useSelector(activeOrganizationSelector);
const organizationName = organization?.name;
const projectsCount = organization?.relationships?.projects?.meta.count;
const usersCount = organization?.relationships?.users?.meta.count;
const projectsCount = organization?.stats?.projects?.meta.count;
const usersCount = organization?.stats?.users?.meta.count;
const isNotEmpty = projectsCount > 0;
const projectsLoading = useSelector(loadingSelector);
const [isSearchActive, setIsSearchActive] = useState(false);
Expand Down

0 comments on commit 64faa64

Please sign in to comment.