diff --git a/NodeApp/eslint.config.mjs b/NodeApp/eslint.config.mjs index ca4042203d54482e9b783dc1c2e32a82e47fdbb6..dd4f225c775376611a624f1ae149e5227a213b0d 100644 --- a/NodeApp/eslint.config.mjs +++ b/NodeApp/eslint.config.mjs @@ -21,5 +21,6 @@ export default tseslint.config({ '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/require-await': 'off', '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/no-floating-promises': 'off', } }); \ No newline at end of file diff --git a/NodeApp/src/managers/DojoBackendManager.ts b/NodeApp/src/managers/DojoBackendManager.ts index c16b7388e4fede536e61f97fe0e2ba57e410e02b..a3fd87ee0f19d1db497c58c261e9c1a665cf80b9 100644 --- a/NodeApp/src/managers/DojoBackendManager.ts +++ b/NodeApp/src/managers/DojoBackendManager.ts @@ -15,6 +15,8 @@ import GitlabPipelineStatus from '../shared/types/Gitlab/GitlabPipelineStatus.j class DojoBackendManager { private handleApiError(error: unknown, spinner: ora.Ora, verbose: boolean, defaultErrorMessage?: string, otherErrorHandler?: (error: AxiosError, spinner: ora.Ora, verbose: boolean) => void) { + const unknownErrorMessage: string = 'unknown error'; + if ( verbose ) { if ( error instanceof AxiosError ) { switch ( error.response?.data?.code ) { @@ -37,19 +39,19 @@ class DojoBackendManager { spinner.fail(`Assignment creation error: The assignment name already exists. Please choose another name.`); break; case DojoStatusCode.ASSIGNMENT_CREATION_GITLAB_ERROR: - spinner.fail(`Assignment creation error: An unknown error occurred while creating the assignment on GitLab (internal error message: ${ error.response?.data?.description ?? 'unknown error' }). Please try again later or contact an administrator.`); + spinner.fail(`Assignment creation error: An unknown error occurred while creating the assignment on GitLab (internal error message: ${ error.response?.data?.description ?? unknownErrorMessage }). Please try again later or contact an administrator.`); break; case DojoStatusCode.ASSIGNMENT_CREATION_INTERNAL_ERROR: - spinner.fail(`Assignment creation error: An unknown error occurred while creating the assignment (internal error message: ${ error.response?.data?.description ?? 'unknown error' }). Please try again later or contact an administrator.`); + spinner.fail(`Assignment creation error: An unknown error occurred while creating the assignment (internal error message: ${ error.response?.data?.description ?? unknownErrorMessage }). Please try again later or contact an administrator.`); break; case DojoStatusCode.MAX_EXERCISE_PER_ASSIGNMENT_REACHED: spinner.fail(`The following users have reached the maximum number of exercise of this assignment : ${ ((error.response.data as DojoBackendResponse<Array<Gitlab.UserSchema>>).data).map(user => user.name).join(', ') }.`); break; case DojoStatusCode.EXERCISE_CREATION_INTERNAL_ERROR: - spinner.fail(`Exercise creation error: An unknown error occurred while creating the exercise (internal error message: ${ error.response?.data?.description ?? 'unknown error' }). Please try again later or contact an administrator.`); + spinner.fail(`Exercise creation error: An unknown error occurred while creating the exercise (internal error message: ${ error.response?.data?.description ?? unknownErrorMessage }). Please try again later or contact an administrator.`); break; case DojoStatusCode.EXERCISE_CREATION_GITLAB_ERROR: - spinner.fail(`Exercise creation error: An unknown error occurred while creating the exercise on GitLab (internal error message: ${ error.response?.data?.description ?? 'unknown error' }). Please try again later or contact an administrator.`); + spinner.fail(`Exercise creation error: An unknown error occurred while creating the exercise on GitLab (internal error message: ${ error.response?.data?.description ?? unknownErrorMessage }). Please try again later or contact an administrator.`); break; case DojoStatusCode.GITLAB_TEMPLATE_NOT_FOUND: spinner.fail(`Template not found or access denied. Please check the template ID or url. Also, please check that the template have public/internal visibility or that your and Dojo account (${ ClientsSharedConfig.gitlab.dojoAccount.username }) have at least reporter role to the template (if private).`); diff --git a/NodeApp/src/managers/SessionManager.ts b/NodeApp/src/managers/SessionManager.ts index 2b4a3da164b0419c08adac66ae5fe61a8b587f44..7dd62ccf351bf0cf66acc08f17f907c7a6adfcfb 100644 --- a/NodeApp/src/managers/SessionManager.ts +++ b/NodeApp/src/managers/SessionManager.ts @@ -156,7 +156,7 @@ class SessionManager { text : `Waiting for user to authorize the application in his web browser. If the browser does not open automatically, please go to : ${ Config.login.gitlab.url.code }`, indent: 4 }).start(); - void open(Config.login.gitlab.url.code).then(); + open(Config.login.gitlab.url.code).then(); }); loginServer.events.on('error', (error: string) => { currentSpinner.fail(`Login server error: ${ error }`); diff --git a/NodeApp/src/shared b/NodeApp/src/shared index 771f8cd079b39ec4050c5ece024dc4d70f342529..c2afa861bf6306ddec79ffd465a4c7b0edcd3453 160000 --- a/NodeApp/src/shared +++ b/NodeApp/src/shared @@ -1 +1 @@ -Subproject commit 771f8cd079b39ec4050c5ece024dc4d70f342529 +Subproject commit c2afa861bf6306ddec79ffd465a4c7b0edcd3453 diff --git a/NodeApp/src/sharedByClients b/NodeApp/src/sharedByClients index 8514d5ef589a8aa34e4d2260c618781d81368c22..4256114048734c2708436cc8505abecdf62fe6df 160000 --- a/NodeApp/src/sharedByClients +++ b/NodeApp/src/sharedByClients @@ -1 +1 @@ -Subproject commit 8514d5ef589a8aa34e4d2260c618781d81368c22 +Subproject commit 4256114048734c2708436cc8505abecdf62fe6df