Skip to content

Commit

Permalink
Merge pull request #17 from rciam/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ioigoume authored Oct 10, 2023
2 parents f252d3d + d7517b7 commit 27ea141
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 44 deletions.
Empty file added javascript/config.json
Empty file.
11 changes: 2 additions & 9 deletions javascript/src/components/Communities/communitiesChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ const CommunitiesChart = ({tenenvId}) => {
const [communities, setCommunities] = useState();
const [global_options, setGlobalOptions] = useState();
const queryClient = useQueryClient();
const controller = new AbortController


let params = {
params: {
'interval': selected,
'count_interval': options[selected]["count_interval"],
'tenenv_id': tenenvId,
},
signal: controller.signal
}
}

const communitiesGroupBy = useQuery(
Expand All @@ -51,8 +49,7 @@ const CommunitiesChart = ({tenenvId}) => {
'interval': selected,
'count_interval': options[selected]["count_interval"],
'tenenv_id': tenenvId,
},
signal: controller.signal
}
}

try {
Expand All @@ -61,10 +58,6 @@ const CommunitiesChart = ({tenenvId}) => {
// todo: Here we can handle any authentication or authorization errors
console.log(error)
}

return () => {
controller.abort()
}
}, [selected, tenenvId])


Expand Down
11 changes: 2 additions & 9 deletions javascript/src/components/Communities/communitiesDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const CommunitiesDataTable = ({tenenvId}) => {
const [startDate, setStartDate] = useState(oneYearAgo);
const [dropdownOptionsState, setDropdownOptions] = useState(dropdownOptions);
const [groupBy, setGroupBy] = useState("month")
const controller = new AbortController


const queryClient = useQueryClient();
Expand All @@ -43,8 +42,7 @@ const CommunitiesDataTable = ({tenenvId}) => {
'startDate': !startDate ? oneYearAgo : format(startDate, "yyyy-MM-dd'T'HH:mm:ss'Z'"),
'endDate': !endDate ? today : format(endDate, "yyyy-MM-dd'T'HH:mm:ss'Z'"),
'tenenv_id': tenenvId
},
signal: controller.signal
}
}

const communitiesGroupBy = useQuery(
Expand All @@ -71,8 +69,7 @@ const CommunitiesDataTable = ({tenenvId}) => {
'startDate': !startDate ? oneYearAgo : format(startDate, "yyyy-MM-dd'T'HH:mm:ss'Z'"),
'endDate': !endDate ? today : format(endDate, "yyyy-MM-dd'T'HH:mm:ss'Z'"),
'tenenv_id': tenenvId
},
signal: controller.signal
}
}

try {
Expand All @@ -82,10 +79,6 @@ const CommunitiesDataTable = ({tenenvId}) => {
// todo: Here we can handle any authentication or authorization errors
console.log(error)
}

return () => {
controller.abort()
}
}, [groupBy])


Expand Down
12 changes: 2 additions & 10 deletions javascript/src/components/Users/registeredUsersChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ const RegisteredUsersChart = ({
const [registeredUsers, setRegisteredUsers] = useState([]);
const [global_options, setGlobalOptions] = useState();
const queryClient = useQueryClient();
const controller = new AbortController

let params = {
params: {
'interval': selected,
'count_interval': regUsersOptions[selected]["count_interval"],
'tenenv_id': tenenvId
},
signa: controller.signal
}
}

const registeredUsersGroup = useQuery(
Expand All @@ -50,8 +48,7 @@ const RegisteredUsersChart = ({
'interval': selected,
'count_interval': regUsersOptions[selected]["count_interval"],
'tenenv_id': tenenvId,
},
signal: controller.signal
}
}

try {
Expand All @@ -60,11 +57,6 @@ const RegisteredUsersChart = ({
// todo: Here we can handle any authentication or authorization errors
console.log(error)
}

return () => {
controller.abort()
}

}, [selected, tenenvId])


Expand Down
9 changes: 1 addition & 8 deletions javascript/src/components/Users/registeredUsersDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const RegisteredUsersDataTable = ({
const [minDate, setMinDate] = useState("");
const [groupBy, setGroupBy] = useState("month")
const queryClient = useQueryClient();
const controller = new AbortController();


let params = {
Expand Down Expand Up @@ -73,8 +72,7 @@ const RegisteredUsersDataTable = ({
'endDate': !endDate ? null : format(endDate, "yyyy-MM-dd'T'HH:mm:ss'Z'"),
'tenenv_id': tenenvId,
'groupBy': groupBy
},
signal: controller.signal
}
}

try {
Expand All @@ -88,11 +86,6 @@ const RegisteredUsersDataTable = ({
// todo: Here we can handle any authentication or authorization errors
console.log(error)
}

return () => {
controller.abort()
}

}, [groupBy])

// Construct the data required for the datatable
Expand Down
10 changes: 2 additions & 8 deletions javascript/src/components/Users/registeredUsersMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ const RegisteredUsersMap = ({
endDate,
tenenvId
}) => {
const queryClient = useQueryClient();
const controller = new AbortController
const queryClient = useQueryClient()

let params = {
params: {
'startDate': !startDate ? null : format(startDate, "yyyy-MM-dd'T'HH:mm:ss'Z'"),
'endDate': !endDate ? null : format(endDate, "yyyy-MM-dd'T'HH:mm:ss'Z'"),
'tenenv_id': tenenvId,
},
signal: controller.signal
}
}

const registeredUsersByCountry = useQuery(
Expand All @@ -42,10 +40,6 @@ const RegisteredUsersMap = ({
} catch (error) {
console.log(error)
}

return () => {
controller.abort()
}
}, [startDate, endDate, tenenvId])

if (registeredUsersByCountry.isLoading
Expand Down

0 comments on commit 27ea141

Please sign in to comment.