From 0997ef73177cb05bdd544da0a4b93d58c1c85642 Mon Sep 17 00:00:00 2001 From: Roel van der Wegen Date: Mon, 25 Sep 2023 16:11:22 +0100 Subject: [PATCH 1/8] Wording --- src/data/Extensions.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/Extensions.json b/src/data/Extensions.json index cb15aa1043e8..3c1a1e7f1cd8 100644 --- a/src/data/Extensions.json +++ b/src/data/Extensions.json @@ -4,7 +4,7 @@ "type": "CIPP-API", "cat": "API", "forceSyncButton": false, - "helpText": "This integration allows you to use to enable API access outside of CIPP usage. Requires Global Administrator permissions inside your tenant for activation of the API. These credentials will only be shown once.", + "helpText": "This integration allows you to enable CIPP-API access outside of CIPP. Requires Global Administrator permissions inside your tenant for activation of the API. The API credentials will only be shown once.", "SettingOptions": [ { "type": "checkbox", From ff7450360418717a490987cb794e47cf94cded1b Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Tue, 26 Sep 2023 02:00:16 +0200 Subject: [PATCH 2/8] fixed issue with mass deletes webhooks --- src/views/tenant/administration/ListAlertsQueue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tenant/administration/ListAlertsQueue.js b/src/views/tenant/administration/ListAlertsQueue.js index d1da4bb53479..720e55a2fcc3 100644 --- a/src/views/tenant/administration/ListAlertsQueue.js +++ b/src/views/tenant/administration/ListAlertsQueue.js @@ -286,7 +286,7 @@ const ListAlertsQueue = () => { label: 'Delete webhook', color: 'info', modal: true, - modalUrl: `/api/RemoveWebhookAlert?CIPPID=!CIPPID&tenantfilter=!tenantName`, + modalUrl: `/api/RemoveWebhookAlert?CIPPID=!RowKey&tenantfilter=!PartitionKey`, modalMessage: 'Are you sure you want to delete this webhook alert?', }, ], From dc29bfcdac246b10f3583349bfe6b4132c82d4f1 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Mon, 25 Sep 2023 22:10:43 -0400 Subject: [PATCH 3/8] Prevent table re-render on queued results --- src/components/tables/CippDatatable.js | 31 ++++++++------------------ 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/src/components/tables/CippDatatable.js b/src/components/tables/CippDatatable.js index d41dc8e342ed..3c75376985f5 100644 --- a/src/components/tables/CippDatatable.js +++ b/src/components/tables/CippDatatable.js @@ -15,28 +15,15 @@ export default function CippDatatable({ path, params, ...rest }) { } = useListDatatableQuery({ path, params: { refreshGuid, $filter: graphFilter, ...params } }) return ( <> - {data[0]?.Queued ? ( - <> - {data[0]?.QueueMessage} - - - ) : ( - - )} + {data[0]?.Queued && {data[0]?.QueueMessage}} + ) } From e40eea1b8f054ae3142089d70c5346143c005420 Mon Sep 17 00:00:00 2001 From: John Duprey Date: Mon, 25 Sep 2023 23:55:05 -0400 Subject: [PATCH 4/8] CippTable tweaks - Add defaultFilterText - Set initial graph filter from CippDatatable to default filter text - Add isModal - disable search param update --- src/components/tables/CippDatatable.js | 7 +++++++ src/components/tables/CippTable.js | 12 ++++++++---- src/components/utilities/SharedModal.js | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/components/tables/CippDatatable.js b/src/components/tables/CippDatatable.js index 3c75376985f5..335af6f33541 100644 --- a/src/components/tables/CippDatatable.js +++ b/src/components/tables/CippDatatable.js @@ -13,6 +13,12 @@ export default function CippDatatable({ path, params, ...rest }) { isFetching, error, } = useListDatatableQuery({ path, params: { refreshGuid, $filter: graphFilter, ...params } }) + + var defaultFilterText = '' + if (params?.Parameters?.$filter) { + defaultFilterText = 'Graph: ' + params?.Parameters?.$filter + console.log(defaultFilterText) + } return ( <> {data[0]?.Queued && {data[0]?.QueueMessage}} @@ -21,6 +27,7 @@ export default function CippDatatable({ path, params, ...rest }) { data={data[0]?.Queued ? [] : data} isFetching={isFetching} error={error} + defaultFilterText={defaultFilterText} refreshFunction={setRefreshGuid} graphFilterFunction={setGraphFilter} /> diff --git a/src/components/tables/CippTable.js b/src/components/tables/CippTable.js index fc09031e33be..288685f43f1a 100644 --- a/src/components/tables/CippTable.js +++ b/src/components/tables/CippTable.js @@ -111,6 +111,8 @@ export default function CippTable({ graphFilterFunction = null, columns = [], dynamicColumns = true, + defaultFilterText = '', + isModal = false, filterlist, tableProps: { keyField = 'id', @@ -137,7 +139,7 @@ export default function CippTable({ const inputRef = useRef('') const [loopRunning, setLoopRunning] = React.useState(false) const [massResults, setMassResults] = React.useState([]) - const [filterText, setFilterText] = React.useState('') + const [filterText, setFilterText] = React.useState(defaultFilterText) const [filterviaURL, setFilterviaURL] = React.useState(false) const [updatedColumns, setUpdatedColumns] = React.useState(columns) const [selectedRows, setSelectedRows] = React.useState(false) @@ -147,7 +149,7 @@ export default function CippTable({ const [modalContent, setModalContent] = useState(null) //get the search params called "tableFilter" and set the filter to that. const [searchParams, setSearchParams] = useSearchParams() - if (searchParams.get('tableFilter') && !filterviaURL) { + if (searchParams.get('tableFilter') && !filterviaURL && !isModal) { setFilterText(searchParams.get('tableFilter')) setFilterviaURL(true) } @@ -219,8 +221,10 @@ export default function CippTable({ }, [filterText]) const filterData = (data, filterText) => { - const debouncedSetSearchParams = debounce(debounceSetSearchParams, 1000) - debouncedSetSearchParams() + if (!isModal) { + const debouncedSetSearchParams = debounce(debounceSetSearchParams, 1000) + debouncedSetSearchParams() + } if (filterText.startsWith('Graph:')) { var query = filterText.slice(6).trim() debounceSetGraphFilter(query) diff --git a/src/components/utilities/SharedModal.js b/src/components/utilities/SharedModal.js index 47fb57f2f547..4975c0cc17f6 100644 --- a/src/components/utilities/SharedModal.js +++ b/src/components/utilities/SharedModal.js @@ -13,7 +13,7 @@ import { CippTable } from 'src/components/tables' function mapBodyComponent({ componentType, data, componentProps }) { switch (componentType) { case 'table': - return + return case 'list': return
{Array.isArray(data) && data.map((el, idx) =>
{el}
)}
case 'text': From 3d053b13a84d131a0b612dc565230dd7502467af Mon Sep 17 00:00:00 2001 From: John Duprey Date: Mon, 25 Sep 2023 23:56:20 -0400 Subject: [PATCH 5/8] Update CippDatatable.js --- src/components/tables/CippDatatable.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/tables/CippDatatable.js b/src/components/tables/CippDatatable.js index 335af6f33541..e36befb3dea3 100644 --- a/src/components/tables/CippDatatable.js +++ b/src/components/tables/CippDatatable.js @@ -17,7 +17,6 @@ export default function CippDatatable({ path, params, ...rest }) { var defaultFilterText = '' if (params?.Parameters?.$filter) { defaultFilterText = 'Graph: ' + params?.Parameters?.$filter - console.log(defaultFilterText) } return ( <> From ab8bb402f0230b00e28438df1f8dc920244c286d Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Tue, 26 Sep 2023 13:07:51 +0200 Subject: [PATCH 6/8] hotfix --- public/version_latest.txt | 2 +- version_latest.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 version_latest.txt diff --git a/public/version_latest.txt b/public/version_latest.txt index 81911389142b..ecedc98d1d5a 100644 --- a/public/version_latest.txt +++ b/public/version_latest.txt @@ -1 +1 @@ -4.3.0 \ No newline at end of file +4.3.1 \ No newline at end of file diff --git a/version_latest.txt b/version_latest.txt new file mode 100644 index 000000000000..ecedc98d1d5a --- /dev/null +++ b/version_latest.txt @@ -0,0 +1 @@ +4.3.1 \ No newline at end of file From a28bc053a994bf1986c46ce6d7e52add2d332da1 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Tue, 26 Sep 2023 18:16:59 +0200 Subject: [PATCH 7/8] fixes data not available bug --- src/views/cipp/CIPPSettings.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/cipp/CIPPSettings.js b/src/views/cipp/CIPPSettings.js index 00deb2d85098..7ba3cb285ad7 100644 --- a/src/views/cipp/CIPPSettings.js +++ b/src/views/cipp/CIPPSettings.js @@ -1577,8 +1577,8 @@ const ExtensionsTab = () => { } const MappingsTab = () => { - const [listHaloBackend, listBackendHaloResult] = useLazyGenericGetRequestQuery() - const [setHaloExtensionconfig, extensionHaloConfigResult] = useLazyGenericPostRequestQuery() + const [listHaloBackend, listBackendHaloResult = []] = useLazyGenericGetRequestQuery() + const [setHaloExtensionconfig, extensionHaloConfigResult = []] = useLazyGenericPostRequestQuery() const onHaloSubmit = (values) => { setHaloExtensionconfig({ @@ -1608,7 +1608,7 @@ const MappingsTab = () => { Use the table below to map your client to the correct PSA client {listBackendHaloResult.isSuccess && - listBackendHaloResult.data.Tenants.map((tenant) => ( + listBackendHaloResult.data.Tenants?.map((tenant) => ( Date: Tue, 26 Sep 2023 18:24:02 +0200 Subject: [PATCH 8/8] add refresh to groups --- src/views/identity/administration/EditGroup.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/identity/administration/EditGroup.js b/src/views/identity/administration/EditGroup.js index 9ea8160b396a..1c9e2d44d187 100644 --- a/src/views/identity/administration/EditGroup.js +++ b/src/views/identity/administration/EditGroup.js @@ -32,9 +32,8 @@ const EditGroup = () => { let query = useQuery() const groupId = query.get('groupId') const tenantDomain = query.get('tenantDomain') - const [queryError, setQueryError] = useState(false) - + const [refreshToken, setRefresh] = useState('') const { data: group = {}, isFetching, @@ -47,14 +46,14 @@ const EditGroup = () => { isFetching: membersisFetching, error: membersError, isSuccess: membersIsSuccess, - } = useListGroupMembersQuery({ tenantDomain, groupId }) + } = useListGroupMembersQuery({ tenantDomain, groupId, refreshToken }) const { data: owners = [], isFetching: ownersisFetching, error: ownersError, isSuccess: ownersIsSuccess, - } = useListGroupOwnersQuery({ tenantDomain, groupId }) + } = useListGroupOwnersQuery({ tenantDomain, groupId, refreshToken }) const { data: users = [], isFetching: usersIsFetching, @@ -66,6 +65,7 @@ const EditGroup = () => { isFetching: contactsIsFetching, error: contactsError, } = useListContactsQuery({ tenantDomain }) + const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() const [roleInfo, setroleInfo] = React.useState([]) useEffect(() => { @@ -86,7 +86,7 @@ const EditGroup = () => { }) setroleInfo(ownerWithRole.concat(memberwithRole)) } - }, [owners, members, ownersIsSuccess, membersIsSuccess]) + }, [owners, members, ownersIsSuccess, membersIsSuccess, postResults]) useEffect(() => { if (!groupId || !tenantDomain) { @@ -97,7 +97,6 @@ const EditGroup = () => { setQueryError(true) } }, [groupId, tenantDomain, dispatch]) - const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() const onSubmit = (values) => { const shippedValues = { tenantID: tenantDomain, @@ -114,7 +113,9 @@ const EditGroup = () => { mail: group[0].mail, } //window.alert(JSON.stringify(shippedValues)) - genericPostRequest({ path: '/api/EditGroup', values: shippedValues }) + genericPostRequest({ path: '/api/EditGroup', values: shippedValues }).then((res) => { + setRefresh(postResults.requestId) + }) } const tableColumns = [ {