Skip to content

Commit 137ae09

Browse files
committed
fix: Solve reliability issues
1 parent b88f139 commit 137ae09

20 files changed

Lines changed: 48 additions & 48 deletions

File tree

application/CohortManager/Set-up/scripts/get_local_settings.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ process_files() {
3535
# Read the content of the found local.settings.json file and echo it into the target file
3636
cat "$file" >> $OUTPUT_SCRIPT
3737
# Check if this is the last file and add EOF accordingly
38-
if [ $index -lt $file_count ]; then
38+
if [[ $index -lt $file_count ]]; then
3939
echo -e "\nEOF" >> $OUTPUT_SCRIPT
4040
fi
4141
done

application/CohortManager/src/Web/app/api/GetValidationExceptions/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export async function GET(request: Request) {
146146
const isReport = searchParams.get("isReport");
147147
const exceptionCategory = searchParams.get("exceptionCategory");
148148
const reportDate = searchParams.get("reportDate");
149-
const page = Math.max(1, parseInt(searchParams.get("page") || "1", 10));
149+
const page = Math.max(1, Number.parseInt(searchParams.get("page") || "1", 10));
150150

151151
// Handle single exception requests - get fresh data from store
152152
if (exceptionId !== null) {

application/CohortManager/src/Web/app/api/UpdateException/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export async function PUT(request: NextRequest) {
4848
);
4949
}
5050

51-
const exceptionId = parseInt(updateRequest.ExceptionId, 10);
52-
if (isNaN(exceptionId) || exceptionId === 0) {
51+
const exceptionId = Number.parseInt(updateRequest.ExceptionId, 10);
52+
if (Number.isNaN(exceptionId) || exceptionId === 0) {
5353
console.warn("Invalid ExceptionId provided:", updateRequest.ExceptionId);
5454
return NextResponse.json(
5555
{ error: "Invalid ExceptionId provided" },

application/CohortManager/src/Web/app/api/UpdateExceptionServiceNowId/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export async function PUT(request: NextRequest) {
5151
const exceptionId =
5252
typeof rawExceptionId === "number"
5353
? rawExceptionId
54-
: parseInt(rawExceptionId, 10);
54+
: Number.parseInt(rawExceptionId, 10);
5555
if (!Number.isFinite(exceptionId) || exceptionId <= 0) {
5656
console.warn("Invalid ExceptionId provided:", rawExceptionId);
5757
return NextResponse.json(

application/CohortManager/src/Web/app/exceptions/[filter]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default async function Page({
4242
const sortBy = resolvedSearchParams.sortBy === "0" ? 0 : 1;
4343
const currentPage = Math.max(
4444
1,
45-
parseInt(resolvedSearchParams.page || "1", 10)
45+
Number.parseInt(resolvedSearchParams.page || "1", 10)
4646
);
4747

4848
const sortOptions = [

application/CohortManager/src/Web/app/exceptions/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default async function Page({
5252
const sortBy = resolvedSearchParams.sortBy === "0" ? 0 : 1;
5353
const currentPage = Math.max(
5454
1,
55-
parseInt(resolvedSearchParams.page || "1", 10)
55+
Number.parseInt(resolvedSearchParams.page || "1", 10)
5656
);
5757

5858
const sortOptions = [

application/CohortManager/src/Web/app/lib/pagination.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ export function extractPageFromUrl(url: string): number {
116116
try {
117117
const parsed = new URL(url);
118118
const value = parsed.searchParams.get(PAGE_PARAM);
119-
const page = value ? parseInt(value, 10) : 1;
119+
const page = value ? Number.parseInt(value, 10) : 1;
120120
return Number.isNaN(page) ? 1 : Math.max(1, page);
121121
} catch {
122122
const pageRegex = new RegExp(`[?&]${PAGE_PARAM}=(\\d+)`);
123123
const match = pageRegex.exec(url);
124-
const page = match ? parseInt(match[1], 10) : 1;
124+
const page = match ? Number.parseInt(match[1], 10) : 1;
125125
return Number.isNaN(page) ? 1 : Math.max(1, page);
126126
}
127127
}

application/CohortManager/src/Web/app/lib/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const formatCompactDate = (dateString: string): string => {
1818
if (!dateString) return "";
1919

2020
const date = new Date(dateString);
21-
if (isNaN(date.getTime())) return "";
21+
if (Number.isNaN(date.getTime())) return "";
2222

2323
const day = String(date.getDate()).padStart(2, "0");
2424
const month = String(date.getMonth() + 1).padStart(2, "0");
@@ -37,7 +37,7 @@ export function getCurrentDate(): string {
3737

3838
export function formatGenderValue(gender?: number | string | null): string {
3939
if (gender === null || gender === undefined || gender === "") return "";
40-
const genderNum = typeof gender === "string" ? parseInt(gender, 10) : gender;
40+
const genderNum = typeof gender === "string" ? Number.parseInt(gender, 10) : gender;
4141
if (genderNum === 1) return "Male";
4242
if (genderNum === 2) return "Female";
4343
if (genderNum === 9) return "Unspecified";

scripts/azure/GetImageTagsByManifest.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,28 +55,28 @@ while [[ "$#" -gt 0 ]]; do
5555
shift
5656
done
5757

58-
if [ -z "${containerRegistry}" ]; then
58+
if [[ -z "${containerRegistry}" ]]; then
5959
echo "Please provide a container registry argument"
6060
exit 1
6161
fi
6262

6363
# stop processing if no image name is provided
64-
if [ -z "${functionAppName}" ]; then
64+
if [[ -z "${functionAppName}" ]]; then
6565
echo "Please provide an image name as an argument"
6666
exit 1
6767
fi
6868

69-
if [ -z "${subscriptionId}" ]; then
69+
if [[ -z "${subscriptionId}" ]]; then
7070
echo "Please provide a Subscription ID argument"
7171
exit 1
7272
fi
7373

74-
if [ -z "${resourceGroup}" ]; then
74+
if [[ -z "${resourceGroup}" ]]; then
7575
echo "Please provide a resource group argument"
7676
exit 1
7777
fi
7878

79-
if [ verbose == true ]; then
79+
if [[ verbose == true ]]; then
8080
echo "function app name: $functionAppName"
8181
echo "subscription Id: $subscriptionId"
8282
echo "resourceGroup: $resourceGroup"
@@ -88,13 +88,13 @@ fi
8888
digest=$(az acr repository show --name $containerRegistry --image $functionAppName:$tag --query 'digest' --output tsv 2> /dev/null)
8989

9090
# stop processing if the image does not exist
91-
if [ -z "$digest" ]; then
91+
if [[ -z "$digest" ]]; then
9292
echo "Image $image not found in $containerRegistry"
9393
exit 1
9494
fi
9595

9696
# echo the digest
97-
if [ verbose == true ]; then
97+
if [[ verbose == true ]]; then
9898
echo $digest
9999
fi
100100

scripts/deployment/get-docker-names.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ IFS=$', \n'
5454

5555
echo "Adding Docker compose file includes..."
5656
files_to_process=(${COMPOSE_FILES_CSV})
57-
while [ ${#files_to_process[@]} -gt 0 ]; do
57+
while [[ ${#files_to_process[@]} -gt 0 ]]; do
5858
compose_file="${files_to_process[0]}"
5959
files_to_process=("${files_to_process[@]:1}") # Remove the first file from the list
6060
includes=($(yq -r '.include[]' "${compose_file}"))
@@ -121,7 +121,7 @@ for compose_file in ${COMPOSE_FILES_CSV}; do
121121
echo
122122
done
123123

124-
if [ ${#non_matched_changes[@]} -ne 0 ]; then
124+
if [[ ${#non_matched_changes[@]} -ne 0 ]]; then
125125
# Remove duplicates (non-matched items across several compose files)
126126
mapfile -t unique_changes < <(printf "%s\n" "${non_matched_changes[@]}" | sort -u)
127127

0 commit comments

Comments
 (0)