fix: use correct created_at and updated_at (#7305)

This commit is contained in:
Nityananda Gohain 2025-03-13 15:14:06 +05:30 committed by GitHub
parent 9df23bc1ed
commit b46f0c9a7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 17 additions and 17 deletions

View File

@ -22,7 +22,7 @@ function TopContributorsCard({
const viewAllTopContributorsParam = searchParams.get('viewAllTopContributors'); const viewAllTopContributorsParam = searchParams.get('viewAllTopContributors');
const [isViewAllVisible, setIsViewAllVisible] = useState( const [isViewAllVisible, setIsViewAllVisible] = useState(
!!viewAllTopContributorsParam ?? false, !!viewAllTopContributorsParam,
); );
const isDarkMode = useIsDarkMode(); const isDarkMode = useIsDarkMode();

View File

@ -28,7 +28,7 @@ export default function DashboardEmptyState(): JSX.Element {
} }
const userRole: ROLES | null = const userRole: ROLES | null =
selectedDashboard?.created_by === user?.email selectedDashboard?.createdBy === user?.email
? (USER_ROLES.AUTHOR as ROLES) ? (USER_ROLES.AUTHOR as ROLES)
: user.role; : user.role;

View File

@ -113,7 +113,7 @@ function GraphLayout(props: GraphLayoutProps): JSX.Element {
} }
const userRole: ROLES | null = const userRole: ROLES | null =
selectedDashboard?.created_by === user?.email selectedDashboard?.createdBy === user?.email
? (USER_ROLES.AUTHOR as ROLES) ? (USER_ROLES.AUTHOR as ROLES)
: user.role; : user.role;

View File

@ -44,7 +44,7 @@ export function WidgetRowHeader(props: WidgetRowHeaderProps): JSX.Element {
const { user } = useAppContext(); const { user } = useAppContext();
const userRole: ROLES | null = const userRole: ROLES | null =
selectedDashboard?.created_by === user?.email selectedDashboard?.createdBy === user?.email
? (USER_ROLES.AUTHOR as ROLES) ? (USER_ROLES.AUTHOR as ROLES)
: user.role; : user.role;
const [addPanelPermission] = useComponentPermission(permissions, userRole); const [addPanelPermission] = useComponentPermission(permissions, userRole);

View File

@ -8,10 +8,10 @@ describe('executeSearchQueries', () => {
const firstDashboard: Dashboard = { const firstDashboard: Dashboard = {
id: 11111, id: 11111,
uuid: uuid(), uuid: uuid(),
created_at: '', createdAt: '',
updated_at: '', updatedAt: '',
created_by: '', createdBy: '',
updated_by: '', updatedBy: '',
data: { data: {
title: 'first dashboard', title: 'first dashboard',
variables: {}, variables: {},
@ -20,10 +20,10 @@ describe('executeSearchQueries', () => {
const secondDashboard: Dashboard = { const secondDashboard: Dashboard = {
id: 22222, id: 22222,
uuid: uuid(), uuid: uuid(),
created_at: '', createdAt: '',
updated_at: '', updatedAt: '',
created_by: '', createdBy: '',
updated_by: '', updatedBy: '',
data: { data: {
title: 'second dashboard', title: 'second dashboard',
variables: {}, variables: {},
@ -32,10 +32,10 @@ describe('executeSearchQueries', () => {
const thirdDashboard: Dashboard = { const thirdDashboard: Dashboard = {
id: 333333, id: 333333,
uuid: uuid(), uuid: uuid(),
created_at: '', createdAt: '',
updated_at: '', updatedAt: '',
created_by: '', createdBy: '',
updated_by: '', updatedBy: '',
data: { data: {
title: 'third dashboard (with special characters +?\\)', title: 'third dashboard (with special characters +?\\)',
variables: {}, variables: {},

View File

@ -236,7 +236,7 @@ describe('dashboard list page', () => {
expect.objectContaining({ expect.objectContaining({
id: firstDashboardData.uuid, id: firstDashboardData.uuid,
title: firstDashboardData.data.title, title: firstDashboardData.data.title,
createdAt: firstDashboardData.created_at, createdAt: firstDashboardData.createdAt,
}), }),
); );
}); });