diff --git a/frontend/src/container/ListOfDashboard/DashboardsList.tsx b/frontend/src/container/ListOfDashboard/DashboardsList.tsx
index 96fdff7116..af07d16444 100644
--- a/frontend/src/container/ListOfDashboard/DashboardsList.tsx
+++ b/frontend/src/container/ListOfDashboard/DashboardsList.tsx
@@ -186,16 +186,14 @@ function DashboardsList(): JSX.Element {
const sortDashboardsByCreatedAt = (dashboards: Dashboard[]): void => {
const sortedDashboards = dashboards.sort(
- (a, b) =>
- new Date(b.created_at).getTime() - new Date(a.created_at).getTime(),
+ (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime(),
);
setDashboards(sortedDashboards);
};
const sortDashboardsByUpdatedAt = (dashboards: Dashboard[]): void => {
const sortedDashboards = dashboards.sort(
- (a, b) =>
- new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime(),
+ (a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime(),
);
setDashboards(sortedDashboards);
};
@@ -260,16 +258,16 @@ function DashboardsList(): JSX.Element {
const data: Data[] =
dashboards?.map((e) => ({
- createdAt: e.created_at,
+ createdAt: e.createdAt,
description: e.data.description || '',
id: e.uuid,
- lastUpdatedTime: e.updated_at,
+ lastUpdatedTime: e.updatedAt,
name: e.data.title,
tags: e.data.tags || [],
key: e.uuid,
- createdBy: e.created_by,
+ createdBy: e.createdBy,
isLocked: !!e.isLocked || false,
- lastUpdatedBy: e.updated_by,
+ lastUpdatedBy: e.updatedBy,
image: e.data.image || Base64Icons[0],
variables: e.data.variables,
widgets: e.data.widgets,
@@ -978,10 +976,10 @@ function DashboardsList(): JSX.Element {
{visibleColumns.createdBy && (
- {dashboards?.[0]?.created_by?.substring(0, 1).toUpperCase()}
+ {dashboards?.[0]?.createdBy?.substring(0, 1).toUpperCase()}
- {dashboards?.[0]?.created_by}
+ {dashboards?.[0]?.createdBy}
)}
@@ -990,16 +988,16 @@ function DashboardsList(): JSX.Element {
{visibleColumns.updatedAt && (
- {onLastUpdated(dashboards?.[0]?.updated_at || '')}
+ {onLastUpdated(dashboards?.[0]?.updatedAt || '')}
)}
{visibleColumns.updatedBy && (
- {dashboards?.[0]?.updated_by?.substring(0, 1).toUpperCase()}
+ {dashboards?.[0]?.updatedBy?.substring(0, 1).toUpperCase()}
- {dashboards?.[0]?.updated_by}
+ {dashboards?.[0]?.updatedBy}
)}
diff --git a/frontend/src/container/NewDashboard/DashboardDescription/index.tsx b/frontend/src/container/NewDashboard/DashboardDescription/index.tsx
index 8e116522be..cf7263d04e 100644
--- a/frontend/src/container/NewDashboard/DashboardDescription/index.tsx
+++ b/frontend/src/container/NewDashboard/DashboardDescription/index.tsx
@@ -140,7 +140,7 @@ function DashboardDescription(props: DashboardDescriptionProps): JSX.Element {
let isAuthor = false;
if (selectedDashboard && user && user.email) {
- isAuthor = selectedDashboard?.created_by === user?.email;
+ isAuthor = selectedDashboard?.createdBy === user?.email;
}
let permissions: ComponentTypes[] = ['add_panel'];
@@ -152,7 +152,7 @@ function DashboardDescription(props: DashboardDescriptionProps): JSX.Element {
const { notifications } = useNotifications();
const userRole: ROLES | null =
- selectedDashboard?.created_by === user?.email
+ selectedDashboard?.createdBy === user?.email
? (USER_ROLES.AUTHOR as ROLES)
: user.role;
@@ -364,14 +364,14 @@ function DashboardDescription(props: DashboardDescriptionProps): JSX.Element {
{(isAuthor || user.role === USER_ROLES.ADMIN) && (
}
- disabled={selectedDashboard?.created_by === 'integration'}
+ disabled={selectedDashboard?.createdBy === 'integration'}
onClick={handleLockDashboardToggle}
data-testid="lock-unlock-dashboard"
>
@@ -443,7 +443,7 @@ function DashboardDescription(props: DashboardDescriptionProps): JSX.Element {
{
return useMutation(update, {
onSuccess: (data) => {
if (data.payload) {
- updatedTimeRef.current = dayjs(data.payload.updated_at);
+ updatedTimeRef.current = dayjs(data.payload.updatedAt);
}
},
});
diff --git a/frontend/src/mocks-server/__mockdata__/dashboards.ts b/frontend/src/mocks-server/__mockdata__/dashboards.ts
index 40d9cb48d9..8987d0d8a2 100644
--- a/frontend/src/mocks-server/__mockdata__/dashboards.ts
+++ b/frontend/src/mocks-server/__mockdata__/dashboards.ts
@@ -5,10 +5,10 @@ export const dashboardSuccessResponse = {
{
id: 1,
uuid: '1',
- created_at: '2022-11-16T13:29:47.064874419Z',
- created_by: null,
- updated_at: '2024-05-21T06:41:30.546630961Z',
- updated_by: 'thor@avengers.io',
+ createdAt: '2022-11-16T13:29:47.064874419Z',
+ createdBy: null,
+ updatedAt: '2024-05-21T06:41:30.546630961Z',
+ updatedBy: 'thor@avengers.io',
isLocked: 0,
data: {
collapsableRowsMigrated: true,
@@ -25,10 +25,10 @@ export const dashboardSuccessResponse = {
{
id: 2,
uuid: '2',
- created_at: '2022-11-16T13:20:47.064874419Z',
- created_by: null,
- updated_at: '2024-05-21T06:42:30.546630961Z',
- updated_by: 'captain-america@avengers.io',
+ createdAt: '2022-11-16T13:20:47.064874419Z',
+ createdBy: null,
+ updatedAt: '2024-05-21T06:42:30.546630961Z',
+ updatedBy: 'captain-america@avengers.io',
isLocked: 0,
data: {
collapsableRowsMigrated: true,
@@ -55,10 +55,10 @@ export const getDashboardById = {
data: {
id: 1,
uuid: '1',
- created_at: '2022-11-16T13:29:47.064874419Z',
- created_by: 'integration',
- updated_at: '2024-05-21T06:41:30.546630961Z',
- updated_by: 'thor@avengers.io',
+ createdAt: '2022-11-16T13:29:47.064874419Z',
+ createdBy: 'integration',
+ updatedAt: '2024-05-21T06:41:30.546630961Z',
+ updatedBy: 'thor@avengers.io',
isLocked: true,
data: {
collapsableRowsMigrated: true,
@@ -80,10 +80,10 @@ export const getNonIntegrationDashboardById = {
data: {
id: 1,
uuid: '1',
- created_at: '2022-11-16T13:29:47.064874419Z',
- created_by: 'thor',
- updated_at: '2024-05-21T06:41:30.546630961Z',
- updated_by: 'thor@avengers.io',
+ createdAt: '2022-11-16T13:29:47.064874419Z',
+ createdBy: 'thor',
+ updatedAt: '2024-05-21T06:41:30.546630961Z',
+ updatedBy: 'thor@avengers.io',
isLocked: true,
data: {
collapsableRowsMigrated: true,