Skip to content

Commit 8c8501b

Browse files
Merge pull request #1318 from Chia-Network/develop
Release 2.0.3
2 parents 024fdbf + 389ce42 commit 8c8501b

File tree

5 files changed

+16
-26
lines changed

5 files changed

+16
-26
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cadt-ui",
33
"private": true,
4-
"version": "2.0.2",
4+
"version": "2.0.3",
55
"type": "module",
66
"main": "build/main.js",
77
"engineStrict": true,

src/renderer/api/cadt/v1/index.ts

+9-21
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
22
import initialState from '@/store/slices/app/app.initialstate';
33

4-
const projectsTag = 'projects';
5-
const organizationsTag = 'organizations';
6-
const unitsTag = 'units';
7-
const auditTag = 'audit';
8-
const issuancesTag = 'issuances';
9-
const stagedProjectsTag = 'stagedProjects';
10-
const stagedUnitsTag = 'stagedUnits';
11-
const offerTag = 'offer';
12-
const importedOfferTag = 'importedTransferTag';
4+
export const projectsTag = 'projects';
5+
export const organizationsTag = 'organizations';
6+
export const unitsTag = 'units';
7+
export const auditTag = 'audit';
8+
export const issuancesTag = 'issuances';
9+
export const stagedProjectsTag = 'stagedProjects';
10+
export const stagedUnitsTag = 'stagedUnits';
11+
export const offerTag = 'offer';
12+
export const importedOfferTag = 'importedTransferTag';
1313

1414
const baseQuery = fetchBaseQuery({
1515
baseUrl: '/',
@@ -62,15 +62,3 @@ export const cadtApi = createApi({
6262
],
6363
endpoints: () => ({}),
6464
});
65-
66-
export {
67-
projectsTag,
68-
organizationsTag,
69-
unitsTag,
70-
auditTag,
71-
stagedProjectsTag,
72-
stagedUnitsTag,
73-
issuancesTag,
74-
offerTag,
75-
importedOfferTag,
76-
};

src/renderer/api/cadt/v1/system/system.api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const systemApi = cadtApi.injectEndpoints({
3232
}),
3333
transformResponse: (response: BaseQueryResult<Health>, meta): ServerHealth => {
3434
const isHealthy = response?.message === 'OK';
35-
const readOnly = meta?.response?.headers.get('cw-readonly') === 'true';
35+
const readOnly = meta?.response?.headers.get('cw-read-only') === 'true';
3636
return { isHealthy, readOnly };
3737
},
3838
}),

src/renderer/components/blocks/widgets/SyncIndicator.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { BiRefresh } from 'react-icons/bi';
1010
import { useLocation } from 'react-router-dom';
1111
import { useDispatch } from 'react-redux';
1212
import { FormattedMessage } from 'react-intl';
13+
import { projectsTag, stagedProjectsTag, stagedUnitsTag, unitsTag } from '@/api/cadt/v1';
1314

1415
interface SyncIndicatorProps {
1516
detailed: boolean;
@@ -68,11 +69,11 @@ const SyncIndicator: React.FC<SyncIndicatorProps> = ({ detailed, orgUid }) => {
6869
setShowRefreshBadge(true);
6970

7071
if (location.pathname.includes('projects')) {
71-
dispatch(invalidateProjectApiTag(['projects', 'stagedProjects']));
72+
dispatch(invalidateProjectApiTag([projectsTag, stagedProjectsTag]));
7273
}
7374

7475
if (location.pathname.includes('units')) {
75-
dispatch(invalidateUnitsApiTag(['units', 'stagedUnits']));
76+
dispatch(invalidateUnitsApiTag([unitsTag, stagedUnitsTag]));
7677
}
7778
}
7879

src/renderer/components/form/Field.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { FormikValues, useFormikContext } from 'formik';
44
import { Checkbox, Datepicker, Label, Textarea, TextInput } from 'flowbite-react';
55
import { TagInput } from './TagInput';
66
import { Select, SelectOption } from '@/components';
7+
import dayjs from 'dayjs';
78

89
interface FieldProps {
910
name: string;
@@ -71,7 +72,7 @@ const Field: React.FC<FieldProps> = ({
7172
</a>
7273
);
7374
case 'date':
74-
return <p className="dark:text-white"> dayjs(new Date(initialValue)).format('MMMM D, YYYY'); </p>;
75+
return `${dayjs(new Date(initialValue)).format('MMMM D, YYYY')}`;
7576
case 'tag':
7677
return (
7778
<TagInput defaultValue={initialValue} onChange={(tags) => setFieldValue(name, tags)} readonly={readonly} />

0 commit comments

Comments
 (0)