generated from Luis/nextjs-python-web-template
fixed cors issues
This commit is contained in:
@@ -65,6 +65,7 @@ export default function AccessPoint() {
|
||||
loading={loadingAttachements}
|
||||
data={APAttachementData?.data}
|
||||
configuration={APAttachmentsTableConfig}
|
||||
tkey="attachment-table"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -73,6 +74,7 @@ export default function AccessPoint() {
|
||||
loading={laodingRepositories}
|
||||
data={APRepositories?.data}
|
||||
configuration={APServiceRepositoryTableConfig}
|
||||
tkey="service-repository-table"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -41,7 +41,7 @@ export default function Client({
|
||||
});
|
||||
}
|
||||
return [];
|
||||
}, [services]);
|
||||
}, [services, entity?.did]);
|
||||
|
||||
const onRefresh = () => {
|
||||
const entityKey =
|
||||
@@ -52,7 +52,7 @@ export default function Client({
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
onRefresh();
|
||||
}, 1000);
|
||||
}, 5000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
@@ -162,7 +162,7 @@ export default function Client({
|
||||
loading={services_loading}
|
||||
data={clients}
|
||||
configuration={ClientTableConfig}
|
||||
key="client-table"
|
||||
tkey="client-table"
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
@@ -171,7 +171,7 @@ export default function Client({
|
||||
loading={services_loading}
|
||||
data={services?.data?.services}
|
||||
configuration={ServiceTableConfig}
|
||||
key="service-table"
|
||||
tkey="service-table"
|
||||
/>
|
||||
</div>
|
||||
<Snackbar
|
||||
|
||||
@@ -43,6 +43,7 @@ export default function DLG() {
|
||||
loading={loadingResolutions}
|
||||
data={resolutionData}
|
||||
configuration={DLGResolutionTableConfig}
|
||||
tkey="resolution_table"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@ export default function Home() {
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
onRefresh();
|
||||
}, 500);
|
||||
}, 5000);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
@@ -45,6 +45,7 @@ export default function Home() {
|
||||
loading={data.loadingEntities}
|
||||
data={data?.allEntities}
|
||||
configuration={HomeTableConfig}
|
||||
tkey="home_table"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { StyledTableCell, StyledTableRow } from "./style";
|
||||
import { ICustomTable, CustomTableConfiguration } from "@/types";
|
||||
import { Checkbox, Skeleton } from "@mui/material";
|
||||
|
||||
const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
|
||||
const CustomTable = ({ configuration, data, loading, tkey }: ICustomTable) => {
|
||||
if (loading)
|
||||
return <Skeleton variant="rectangular" animation="wave" height={200} />;
|
||||
|
||||
@@ -25,7 +25,7 @@ const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
|
||||
render?: (param: any) => void | undefined,
|
||||
) => {
|
||||
let renderedValue = value;
|
||||
console.log(cellKey);
|
||||
|
||||
// cover use case if the data is an array
|
||||
if (Array.isArray(value)) renderedValue = value.join(", ");
|
||||
|
||||
@@ -36,6 +36,7 @@ const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
|
||||
// cover use case if we want to render a component
|
||||
if (render) renderedValue = render(value);
|
||||
|
||||
console.log("renderTableCell key", cellKey);
|
||||
return (
|
||||
<StyledTableCell key={cellKey} align="left">
|
||||
{renderedValue}
|
||||
@@ -59,7 +60,7 @@ const CustomTable = ({ configuration, data, loading, key }: ICustomTable) => {
|
||||
{configuration.map(
|
||||
(column: CustomTableConfiguration, columnIndex: number) => {
|
||||
const cellValue: any = data[column.key];
|
||||
const cellKey = key + ":" + column.key + ":" + rowIndex;
|
||||
const cellKey = tkey + ":" + column.key + ":" + rowIndex;
|
||||
const renderComponent = column?.render;
|
||||
return renderTableCell(
|
||||
cellValue,
|
||||
|
||||
@@ -71,6 +71,7 @@ export const ServiceTableConfig = [
|
||||
))}
|
||||
</>
|
||||
);
|
||||
console.log("render", renderedValue);
|
||||
return renderedValue;
|
||||
},
|
||||
},
|
||||
|
||||
@@ -8,7 +8,7 @@ export interface ICustomTable {
|
||||
configuration: CustomTableConfiguration[];
|
||||
data: any;
|
||||
loading?: boolean;
|
||||
key: string;
|
||||
tkey: string;
|
||||
}
|
||||
|
||||
export interface EntityDetails {
|
||||
|
||||
Reference in New Issue
Block a user