Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show error if connection cannot be made to OpenProject #756

Merged
merged 7 commits into from
Jan 30, 2025

Conversation

saw-jan
Copy link
Collaborator

@saw-jan saw-jan commented Jan 22, 2025

Description

Show an error message if the connection to OP cannot be made. This is only valid when oidc method is set and user is an oidc user.

Related Issue or Workpackage

Screenshots (if appropriate):

Old New
Screenshot from 2025-01-02 16-37-07 https://github.com/user-attachments/assets/e139016b-9704-4a4c-8dc0-1bb8557f5805 Screenshot from 2025-01-29 16-30-32

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Updated CHANGELOG.md file

@saw-jan saw-jan added the enhancement New feature or request label Jan 22, 2025
@saw-jan saw-jan self-assigned this Jan 22, 2025
@saw-jan saw-jan force-pushed the feat/handle-user-provision branch 5 times, most recently from a46b279 to a45d669 Compare January 29, 2025 09:28
@saw-jan saw-jan force-pushed the feat/handle-user-provision branch 3 times, most recently from f5bc0bd to 912ecc9 Compare January 30, 2025 04:25
@saw-jan saw-jan marked this pull request as ready for review January 30, 2025 04:46
Copy link
Collaborator

@individual-it individual-it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally looks good, but is it possible to move the test-refactorings in a separate PR?

lib/Service/OpenProjectAPIService.php Outdated Show resolved Hide resolved
src/components/PersonalSettings.vue Outdated Show resolved Hide resolved
tests/lib/Service/OpenProjectAPIServiceTest.php Outdated Show resolved Hide resolved
@saw-jan
Copy link
Collaborator Author

saw-jan commented Jan 30, 2025

generally looks good, but is it possible to move the test-refactorings in a separate PR?

THanks, separated in PR #763. Please, review

@saw-jan saw-jan force-pushed the feat/handle-user-provision branch from 912ecc9 to c3952bd Compare January 30, 2025 06:30
Signed-off-by: Saw-jan <[email protected]>

fix: reorder class imports

Signed-off-by: Saw-jan <[email protected]>

test: add new frontend state
Signed-off-by: Saw-jan <[email protected]>
@saw-jan saw-jan force-pushed the feat/handle-user-provision branch from c3952bd to 2f81a50 Compare January 30, 2025 08:17
@saw-jan saw-jan force-pushed the feat/handle-user-provision branch from 2f81a50 to c3b17f4 Compare January 30, 2025 08:18
Signed-off-by: Saw-jan <[email protected]>
@saw-jan saw-jan force-pushed the feat/handle-user-provision branch from c3b17f4 to 6602e7e Compare January 30, 2025 08:23
@saw-jan saw-jan requested a review from individual-it January 30, 2025 08:24
Copy link

JS Code Coverage

Coverage after merging feat/handle-user-provision into master will be
88.22%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   adminSettings.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   bootstrap.js0%0%0%0%1, 1–7
   dashboard.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   fileActions.js0%0%0%0%1, 1, 10–17, 2–9
   personalSettings.js0%0%0%0%1, 1, 10–19, 2, 20–25, 3–9
   projectTab.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–66, 7–9
   reference.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60, 7–9
   utils.js75.61%33.33%50%77.92%10–14, 17–26, 6–9
src/components
   AdminSettings.vue95.33%92.68%95.56%95.71%1000, 1012, 1012, 1012–1017, 1020–1021, 1025–1026, 1029–1030, 1034–1035, 1045–1050, 1147–1149, 1167–1179, 1194–1197, 1210–1213, 1234–1237, 1350, 1350–1351, 1351–1358, 1368–1369, 1429–1431, 1466–1469, 1505–1507, 1527–1530, 718–719, 822, 951–953, 968, 979–981, 998–999
   ErrorLabel.vue100%100%100%100%
   OAuthConnectButton.vue91.54%75%100%92.98%59–64, 67–71
   PersonalSettings.vue91.85%95.65%90%91.50%128–129, 139–144, 147–156
src/components/admin
   FieldValue.vue100%100%100%100%
   FormHeading.vue100%100%100%100%
   TermsOfServiceUnsigned.vue100%100%100%100%
   TextInput.vue100%100%100%100%
src/components/icons
   ClippyIcon.vue100%100%100%100%
   OpenProjectIcon.vue100%100%100%100%
src/components/settings
   CheckBox.vue100%100%100%100%
   SettingsTitle.vue96.74%85.71%100%97.53%46–48
src/components/tab
   EmptyContent.vue97.42%91.30%100%98.18%102–106
   SearchInput.vue95.27%92.96%94.74%95.73%134–135, 188, 199–204, 263–265, 281–283, 287–292
   WorkPackage.vue86.07%73.17%93.33%87.42%102–111, 124–126, 137–141, 151–153, 171–177, 215, 215–220, 220, 220–231, 76–77
src/constants
   appID.js100%100%100%100%
   messages.js100%100%100%100%
src/filesPlugin
   filesPlugin.js0%0%0%0%1, 1, 10, 100–104, 11–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–79, 8, 80–89, 9, 90–99
   filesPluginLessThan28.js0%0%0%0%1, 1, 10–19, 2, 20–29, 3, 30–39, 4, 40–49, 5, 50–59, 6, 60–69, 7, 70–78, 8–9
src/utils
   workpackageHelper.js89.72%82.14%88.89%92.02%153–154, 18–22, 29, 29, 31, 31, 45–47, 49, 49, 49–51, 94–99
src/views
   CreateWorkPackageModal.vue94.38%86.54%91.67%95.55%353–355, 358, 459–462, 467–472, 477–482, 488–491, 494, 510, 510, 550–554, 564–566, 585–587, 617–619, 641–643, 652–656
   Dashboard.vue77.14%75%63.64%78.50%103–109, 116–117, 121–126, 129–131, 135, 139–140, 145, 148, 151–154, 159–161, 202–208, 214–217, 219–229, 258–266, 279–293, 60, 74, 83, 83
   LinkMultipleFilesModal.vue99.13%97.56%100%99.31%153–155
   ProjectsTab.vue94.28%92.45%93.33%94.58%115–118, 124–126, 146, 157–158, 192–202, 250–252

Copy link

PHP Code Coverage

Coverage after merging feat/handle-user-provision into master will be
61.25%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
server/apps/integration_openproject/lib
   Capabilities.php0%100%0%0%19, 26–35
   ExchangedTokenRequestedEventHelper.php0%100%0%0%25, 32–34
   ServerVersionHelper.php0%100%0%0%17–18, 21, 24
server/apps/integration_openproject/lib/AppInfo
   Application.php7.41%100%25%6%102, 104–107, 109, 111, 113, 117–120, 122–133, 135, 138, 142, 146–148, 75–77, 80–84, 86–91, 93–94, 97
server/apps/integration_openproject/lib/BackgroundJob
   RemoveExpiredDirectUploadTokens.php0%100%0%0%42, 44–46, 55–56
server/apps/integration_openproject/lib/Controller
   ConfigController.php69.96%100%55.56%70.55%136, 177–178, 180, 182–184, 186–189, 192–193, 195, 240, 250, 254–256, 359–363, 488–490, 492–494, 543, 631–634, 636–637, 640, 648–652, 663, 677–680, 688, 692–695, 709–713, 715–716, 718–734, 751–756, 758–759, 761–763, 766, 768–784, 797–804, 806–809, 811–815, 824–829
   DirectDownloadController.php0%100%0%0%37–39, 54–56, 58–65
   DirectUploadController.php70.83%100%100%70%141–143, 186–188, 199, 203–206, 208, 218, 225, 241–243, 245–246, 249–254, 257, 259, 267–269, 275–277, 285–287, 302–304, 323, 328, 334
   FilesController.php72.95%100%83.33%72.41%182–183, 245, 250–253, 255, 257–270, 273–274, 276–277, 281–284, 287, 293
   OpenProjectAPIController.php88.24%100%80.95%88.67%120, 161, 201, 249–251, 254–261, 263–267, 269, 288, 313, 380, 431, 452, 500, 526–528, 531–535, 537, 742–746
server/apps/integration_openproject/lib/Dashboard
   OpenProjectWidget.php0%100%0%0%103, 110, 117, 124–131, 133–137, 141–142, 145–156, 77–82, 89, 96
server/apps/integration_openproject/lib/Exception
   OpenprojectAvatarErrorException.php100%100%100%100%
   OpenprojectErrorException.php100%100%100%100%
   OpenprojectFileNotUploadedException.php100%100%100%100%
   OpenprojectGroupfolderSetupConflictException.php100%100%100%100%
   OpenprojectResponseException.php100%100%100%100%
   OpenprojectUnauthorizedUserException.php0%100%0%0%16
server/apps/integration_openproject/lib/Listener
   BeforeGroupDeletedListener.php0%100%0%0%48, 56–57, 60–63, 65
   BeforeNodeInsideOpenProjectGroupfilderChangedListener.php0%100%0%0%41–43, 47–50, 52, 54, 57–58, 60, 62–65, 67–70, 72–74
   BeforeUserDeletedListener.php0%100%0%0%48, 55–56, 58–61, 63
   LoadAdditionalScriptsListener.php0%100%0%0%32–33, 41–42, 44, 46–47, 49–51, 53
   LoadSidebarScript.php0%100%0%0%100–105, 114–115, 117, 119–120, 122–123, 125, 127–128, 130, 132, 134–141, 145, 148–153, 87–99
   OpenProjectReferenceListener.php0%100%0%0%59–61, 68–69, 71, 73–74, 76–88
   TermsOfServiceEventListener.php0%100%0%0%59–60, 65–66, 68–69, 71–73, 76–80
   UserChangedListener.php0%100%0%0%52, 59–60, 63–68, 71
server/apps/integration_openproject/lib/Migration
   Version2001Date20221213083550.php0%100%0%0%47, 57–65, 67–75, 77–79, 81
   Version2310Date20230116153411.php0%100%0%0%46, 49–52, 54–79, 81–82, 84
   Version2400Date20230504144300.php0%100%0%0%47, 57–60
   Version2640Date20240628114301.php0%100%0%0%52, 64–66, 69–70, 73
server/apps/integration_openproject/lib/Reference
   WorkPackageReferenceProvider.php51.67%100%25%58.33%102, 108–111, 114–116, 119, 123, 157, 165–166, 174, 52, 59, 66, 73–75
server/apps/integration_openproject/lib/Search
   OpenProjectSearchProvider.php0%100%0%0%103–104, 107–111, 113–117, 119–122, 124–127, 131–132, 134–135, 138–147, 149–153, 66–69, 76, 83, 91, 93, 96
   OpenProjectSearchResultEntry.php100%100%100%100%
server/apps/integration_openproject/lib/Service
   DatabaseService.php42.31%100%60%40.43%100–102, 125–129, 131, 80–93, 95–99
   DirectDownloadService.php88.46%100%100%87.50%66–67, 69
   DirectUploadService.php42.86%100%66.67%40%112, 118, 79–82, 84–92
   OauthService.php32.08%100%40%31.25%104–112, 123–130, 79–87, 89–95
   OpenProjectAPIService.php75.93%100%75.81%75.94%1004–1005, 1007, 1009–1010, 1033–1039, 1041–1048, 1050–1057, 1105–1107, 1109–1111, 1114–1118, 1120–1122, 1131–1134, 1137–1139, 1141, 1144–1149, 1153–1154, 1185–1188, 1207–1214, 1230–1231, 1238–1240, 1242–1245, 1249, 1258, 1276,

@saw-jan saw-jan merged commit 0ea6d8d into master Jan 30, 2025
19 checks passed
@saw-jan saw-jan deleted the feat/handle-user-provision branch January 30, 2025 10:09
@saw-jan saw-jan mentioned this pull request Jan 31, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants