Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.0.3 #1318

Merged
merged 7 commits into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cadt-ui",
"private": true,
"version": "2.0.2",
"version": "2.0.3",
"type": "module",
"main": "build/main.js",
"engineStrict": true,
Expand Down
30 changes: 9 additions & 21 deletions src/renderer/api/cadt/v1/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react';
import initialState from '@/store/slices/app/app.initialstate';

const projectsTag = 'projects';
const organizationsTag = 'organizations';
const unitsTag = 'units';
const auditTag = 'audit';
const issuancesTag = 'issuances';
const stagedProjectsTag = 'stagedProjects';
const stagedUnitsTag = 'stagedUnits';
const offerTag = 'offer';
const importedOfferTag = 'importedTransferTag';
export const projectsTag = 'projects';
export const organizationsTag = 'organizations';
export const unitsTag = 'units';
export const auditTag = 'audit';
export const issuancesTag = 'issuances';
export const stagedProjectsTag = 'stagedProjects';
export const stagedUnitsTag = 'stagedUnits';
export const offerTag = 'offer';
export const importedOfferTag = 'importedTransferTag';

const baseQuery = fetchBaseQuery({
baseUrl: '/',
Expand Down Expand Up @@ -62,15 +62,3 @@ export const cadtApi = createApi({
],
endpoints: () => ({}),
});

export {
projectsTag,
organizationsTag,
unitsTag,
auditTag,
stagedProjectsTag,
stagedUnitsTag,
issuancesTag,
offerTag,
importedOfferTag,
};
2 changes: 1 addition & 1 deletion src/renderer/api/cadt/v1/system/system.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const systemApi = cadtApi.injectEndpoints({
}),
transformResponse: (response: BaseQueryResult<Health>, meta): ServerHealth => {
const isHealthy = response?.message === 'OK';
const readOnly = meta?.response?.headers.get('cw-readonly') === 'true';
const readOnly = meta?.response?.headers.get('cw-read-only') === 'true';
return { isHealthy, readOnly };
},
}),
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/components/blocks/widgets/SyncIndicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { BiRefresh } from 'react-icons/bi';
import { useLocation } from 'react-router-dom';
import { useDispatch } from 'react-redux';
import { FormattedMessage } from 'react-intl';
import { projectsTag, stagedProjectsTag, stagedUnitsTag, unitsTag } from '@/api/cadt/v1';

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

if (location.pathname.includes('projects')) {
dispatch(invalidateProjectApiTag(['projects', 'stagedProjects']));
dispatch(invalidateProjectApiTag([projectsTag, stagedProjectsTag]));
}

if (location.pathname.includes('units')) {
dispatch(invalidateUnitsApiTag(['units', 'stagedUnits']));
dispatch(invalidateUnitsApiTag([unitsTag, stagedUnitsTag]));
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/form/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FormikValues, useFormikContext } from 'formik';
import { Checkbox, Datepicker, Label, Textarea, TextInput } from 'flowbite-react';
import { TagInput } from './TagInput';
import { Select, SelectOption } from '@/components';
import dayjs from 'dayjs';

interface FieldProps {
name: string;
Expand Down Expand Up @@ -71,7 +72,7 @@ const Field: React.FC<FieldProps> = ({
</a>
);
case 'date':
return <p className="dark:text-white"> dayjs(new Date(initialValue)).format('MMMM D, YYYY'); </p>;
return `${dayjs(new Date(initialValue)).format('MMMM D, YYYY')}`;
case 'tag':
return (
<TagInput defaultValue={initialValue} onChange={(tags) => setFieldValue(name, tags)} readonly={readonly} />
Expand Down
Loading