fix: add query parameters to options

This commit is contained in:
Danieldare 2022-01-27 10:03:46 +01:00
parent aab77b8ebb
commit 5cfc81a9d3
3 changed files with 15 additions and 0 deletions

View File

@ -146,6 +146,11 @@ const NoEntityFoundWrapper = styled.div`
export const getDatasourceInfo = (datasource: any): string => {
const info = [];
const headers = get(datasource, "datasourceConfiguration.headers", []);
const queryParamters = get(
datasource,
"datasourceConfiguration.queryParameters",
[],
);
const authType = get(
datasource,
"datasourceConfiguration.authentication.authenticationType",
@ -153,6 +158,12 @@ export const getDatasourceInfo = (datasource: any): string => {
).toUpperCase();
if (headers.length)
info.push(`${headers.length} HEADER${headers.length > 1 ? "S" : ""}`);
if (queryParamters.length)
info.push(
`${queryParamters.length} QUERY PARAMETER${
queryParamters.length > 1 ? "S" : ""
}`,
);
if (authType.length) info.push(authType);
return info.join(" | ");
};

View File

@ -252,6 +252,7 @@ class DatasourceRestAPIEditor extends React.Component<Props> {
pageId: this.props.pageId,
appId: this.props.applicationId,
});
this.props.updateDatasource(normalizedValues, onSuccess);
};

View File

@ -36,6 +36,9 @@ export const datasourceToFormValues = (
isValid: datasource.isValid,
url: datasource.datasourceConfiguration.url,
headers: cleanupProperties(datasource.datasourceConfiguration.headers),
queryParameters: cleanupProperties(
datasource.datasourceConfiguration.queryParameters,
),
isSendSessionEnabled: isSendSessionEnabled,
sessionSignatureKey: sessionSignatureKey,
authType: authType,