fix(migrations): correct progress_mode type casting in SQL migration
- Updated the SQL migration to ensure proper type casting for progress_mode when updating progress values based on project_id.
This commit is contained in:
@@ -145,7 +145,7 @@ BEGIN
|
|||||||
SET progress_value = NULL,
|
SET progress_value = NULL,
|
||||||
progress_mode = NULL
|
progress_mode = NULL
|
||||||
WHERE project_id = _project_id
|
WHERE project_id = _project_id
|
||||||
AND progress_mode = _old_mode;
|
AND progress_mode::text::progress_mode_type = _old_mode;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
RETURN NEW;
|
RETURN NEW;
|
||||||
|
|||||||
@@ -1,21 +1,17 @@
|
|||||||
import { Button, Card, Col, Modal, Row, Tooltip, Typography } from 'antd';
|
import { Card, Col, Row, Tooltip, Typography } from 'antd';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import './current-bill.css';
|
import './current-bill.css';
|
||||||
import { InfoCircleTwoTone } from '@ant-design/icons';
|
import { InfoCircleTwoTone } from '@ant-design/icons';
|
||||||
import ChargesTable from './billing-tables/charges-table';
|
import ChargesTable from './billing-tables/charges-table';
|
||||||
import InvoicesTable from './billing-tables/invoices-table';
|
import InvoicesTable from './billing-tables/invoices-table';
|
||||||
import UpgradePlansLKR from './drawers/upgrade-plans-lkr/upgrade-plans-lkr';
|
|
||||||
import UpgradePlans from './drawers/upgrade-plans/upgrade-plans';
|
|
||||||
import { useAppSelector } from '@/hooks/useAppSelector';
|
import { useAppSelector } from '@/hooks/useAppSelector';
|
||||||
import { useAppDispatch } from '@/hooks/useAppDispatch';
|
import { useAppDispatch } from '@/hooks/useAppDispatch';
|
||||||
import { useMediaQuery } from 'react-responsive';
|
import { useMediaQuery } from 'react-responsive';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import {
|
|
||||||
toggleDrawer,
|
|
||||||
toggleUpgradeModal,
|
|
||||||
} from '@/features/admin-center/billing/billing.slice';
|
|
||||||
import { fetchBillingInfo, fetchFreePlanSettings } from '@/features/admin-center/admin-center.slice';
|
import { fetchBillingInfo, fetchFreePlanSettings } from '@/features/admin-center/admin-center.slice';
|
||||||
import RedeemCodeDrawer from './drawers/redeem-code-drawer/redeem-code-drawer';
|
|
||||||
import CurrentPlanDetails from './current-plan-details/current-plan-details';
|
import CurrentPlanDetails from './current-plan-details/current-plan-details';
|
||||||
import AccountStorage from './account-storage/account-storage';
|
import AccountStorage from './account-storage/account-storage';
|
||||||
import { useAuthService } from '@/hooks/useAuth';
|
import { useAuthService } from '@/hooks/useAuth';
|
||||||
@@ -25,9 +21,7 @@ const CurrentBill: React.FC = () => {
|
|||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { t } = useTranslation('admin-center/current-bill');
|
const { t } = useTranslation('admin-center/current-bill');
|
||||||
const themeMode = useAppSelector(state => state.themeReducer.mode);
|
const themeMode = useAppSelector(state => state.themeReducer.mode);
|
||||||
const { isUpgradeModalOpen } = useAppSelector(state => state.adminCenterReducer);
|
|
||||||
const isTablet = useMediaQuery({ query: '(min-width: 1025px)' });
|
const isTablet = useMediaQuery({ query: '(min-width: 1025px)' });
|
||||||
const browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
||||||
const currentSession = useAuthService().getCurrentSession();
|
const currentSession = useAuthService().getCurrentSession();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -46,42 +40,7 @@ const CurrentBill: React.FC = () => {
|
|||||||
const renderMobileView = () => (
|
const renderMobileView = () => (
|
||||||
<div>
|
<div>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Card
|
<CurrentPlanDetails />
|
||||||
style={{ height: '100%' }}
|
|
||||||
title={<span style={titleStyle}>{t('currentPlanDetails')}</span>}
|
|
||||||
extra={
|
|
||||||
<div style={{ marginTop: '8px', marginRight: '8px' }}>
|
|
||||||
<Button type="primary" onClick={() => dispatch(toggleUpgradeModal())}>
|
|
||||||
{t('upgradePlan')}
|
|
||||||
</Button>
|
|
||||||
<Modal
|
|
||||||
open={isUpgradeModalOpen}
|
|
||||||
onCancel={() => dispatch(toggleUpgradeModal())}
|
|
||||||
width={1000}
|
|
||||||
centered
|
|
||||||
okButtonProps={{ hidden: true }}
|
|
||||||
cancelButtonProps={{ hidden: true }}
|
|
||||||
>
|
|
||||||
{browserTimeZone === 'Asia/Colombo' ? <UpgradePlansLKR /> : <UpgradePlans />}
|
|
||||||
</Modal>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<div style={{ display: 'flex', flexDirection: 'column', width: '50%', padding: '0 12px' }}>
|
|
||||||
<div style={{ marginBottom: '14px' }}>
|
|
||||||
<Typography.Text style={{ fontWeight: 700 }}>{t('cardBodyText01')}</Typography.Text>
|
|
||||||
<Typography.Text>{t('cardBodyText02')}</Typography.Text>
|
|
||||||
</div>
|
|
||||||
<Button
|
|
||||||
type="link"
|
|
||||||
style={{ margin: 0, padding: 0, width: '90px' }}
|
|
||||||
onClick={() => dispatch(toggleDrawer())}
|
|
||||||
>
|
|
||||||
{t('redeemCode')}
|
|
||||||
</Button>
|
|
||||||
<RedeemCodeDrawer />
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
</Col>
|
</Col>
|
||||||
|
|
||||||
<Col span={24} style={{ marginTop: '1.5rem' }}>
|
<Col span={24} style={{ marginTop: '1.5rem' }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user