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

[OP#46179 & OP#46178]Implement project folders and app password (UI and API) #375

Merged
merged 7 commits into from
Jun 7, 2023

Conversation

SagarGi
Copy link
Collaborator

@SagarGi SagarGi commented Mar 28, 2023

Description

This PR implements:

  • Group folders setup form (UI and API)
  • App password form (UI and API)
  • Adds UI unit tests
  • Adds API tests
  • Adjust /setup endpoint to setup whole integration

Related WorkPackage:
https://community.openproject.org/projects/nextcloud-integration/work_packages/46179/activity?query_id=3787
https://community.openproject.org/projects/nextcloud-integration/work_packages/46178/activity?query_id=3787

@SagarGi SagarGi force-pushed the password_branch branch 2 times, most recently from 5cd0b08 to d657df1 Compare April 4, 2023 08:48
@SagarGi SagarGi self-assigned this Apr 4, 2023
@SagarGi SagarGi force-pushed the password_branch branch 4 times, most recently from 3ddcdba to 551a62a Compare April 6, 2023 11:15
@SagarGi SagarGi force-pushed the password_branch branch 2 times, most recently from b769221 to 03f8e2c Compare April 24, 2023 11:11
@SagarGi
Copy link
Collaborator Author

SagarGi commented May 2, 2023

@julien-nc A strange error has been encountered when we switch from master to this branch. And also in the master branch as well.
Steps to reproduce:

  1. After setting up the integration switch to this branch
  2. run build
  3. then through UI try to set up the integration without group folder enabled.
  4. the error is shown group folder app is not enabled
  5. then enable the group folder app and retry again.
  6. then __group folder locked error is shown.

After the error is shown when we refresh then it crashes the whole App. Again upon refresh then we can set it up again.
It only appears single time. The next time we delete all the group folders related things and set it up again the error is not shown. It only appears again when we reset the whole nextcloud set up. And also appears in master branch with API endpoint /setup => POST.

We speculated call stack for the error as:

$openProjectFolder = $userFolder->get(Application::OPEN_PROJECT_ENTITIES_NAME);

https://github.com/nextcloud/server/blob/e8112eda76cb26aa64b22ecd231ce66c19906e32/lib/private/Files/Node/Root.php#L205

https://github.com/nextcloud/server/blob/e8112eda76cb26aa64b22ecd231ce66c19906e32/lib/private/Files/View.php#L1352

or

$openProjectFolder = $userFolder->get(Application::OPEN_PROJECT_ENTITIES_NAME);

https://github.com/nextcloud/server/blob/e8112eda76cb26aa64b22ecd231ce66c19906e32/lib/private/Files/Node/Root.php#L207
https://github.com/nextcloud/server/blob/e8112eda76cb26aa64b22ecd231ce66c19906e32/lib/private/Files/Node/Folder.php#L120
https://github.com/nextcloud/server/blob/e8112eda76cb26aa64b22ecd231ce66c19906e32/lib/private/Files/View.php#L350

https://github.com/nextcloud/server/blob/e8112eda76cb26aa64b22ecd231ce66c19906e32/lib/private/Files/View.php#L1123

https://github.com/nextcloud/server/blob/e8112eda76cb26aa64b22ecd231ce66c19906e32/lib/private/Files/View.php#L2030

https://github.com/nextcloud/server/blob/e8112eda76cb26aa64b22ecd231ce66c19906e32/lib/private/Files/View.php#L1923

Either way we do not know the exact cause why this error is appearing.

@SagarGi SagarGi force-pushed the password_branch branch 2 times, most recently from 7e7e0ae to ac581b2 Compare May 4, 2023 07:08
src/components/AdminSettings.vue Outdated Show resolved Hide resolved
src/components/AdminSettings.vue Show resolved Hide resolved
lib/Controller/ConfigController.php Outdated Show resolved Hide resolved
lib/Controller/ConfigController.php Outdated Show resolved Hide resolved
lib/Controller/ConfigController.php Outdated Show resolved Hide resolved
lib/Controller/ConfigController.php Outdated Show resolved Hide resolved
lib/Service/OpenProjectAPIService.php Outdated Show resolved Hide resolved
lib/Service/OpenProjectAPIService.php Outdated Show resolved Hide resolved
lib/Service/OpenProjectAPIService.php Outdated Show resolved Hide resolved
lib/Settings/Admin.php Outdated Show resolved Hide resolved
@individual-it
Copy link
Collaborator

image
the text does not fit

@SagarGi SagarGi force-pushed the password_branch branch from a503249 to ec95109 Compare May 8, 2023 11:17
@SagarGi SagarGi requested review from SwikritiT and individual-it May 8, 2023 11:18
@SwikritiT
Copy link
Contributor

SwikritiT commented May 9, 2023

The group folder error can also be reproduced as such

  1. Fresh setup the NC
  2. Switch to this branch
  3. fill the op host, op oauth creds and NC oauth creds
  4. Refresh the page
  5. Enable the groupfolders app
  6. Try to setup the groupfolder

@SagarGi SagarGi force-pushed the password_branch branch 9 times, most recently from f2dda2c to 8a1a524 Compare June 1, 2023 07:50
@SagarGi SagarGi force-pushed the password_branch branch from 8a1a524 to 4256664 Compare June 6, 2023 09:55
.github/workflows/ci.yml Outdated Show resolved Hide resolved
SagarGi added 7 commits June 6, 2023 16:21
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
@SagarGi SagarGi force-pushed the password_branch branch from 4256664 to 46fa226 Compare June 6, 2023 10:37
@SagarGi
Copy link
Collaborator Author

SagarGi commented Jun 6, 2023

I will be updating all the changes from the figma may be in next PR so i have skipped the changes for now. @SwikritiT

Copy link
Contributor

@SwikritiT SwikritiT left a comment

Choose a reason for hiding this comment

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

Let's make another PR for other refactoring

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

JS Code Coverage

Coverage after merging password_branch into master will be
94.61%
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
   utils.js63.64%33.33%50%66%10–14, 17–26, 6–9
src/components
   AdminSettings.vue99.27%95.35%84.62%99.91%1, 1, 1, 1, 1
   OAuthConnectButton.vue99.07%87.50%100%100%1
   PersonalSettings.vue98.90%93.33%85.71%100%1
src/components/admin
   FieldValue.vue97.12%83.33%100%98.89%1, 23, 23
   FormHeading.vue98.05%81.82%100%99.29%1, 29, 29
   ProjectFolderError.vue92%50%100%95.45%1, 1, 12, 12
   TextInput.vue99.25%95%88.89%100%1
src/components/icons
   ClippyIcon.vue93.18%50%50%97.50%1, 1
src/components/settings
   CheckBox.vue92.45%80%66.67%97.62%1, 1
   SettingsTitle.vue94.74%50%100%97.14%1, 1
src/components/tab
   EmptyContent.vue98.06%84.62%100%99.29%1, 29, 29
   SearchInput.vue99.57%88.89%100%100%1
   WorkPackage.vue98.36%40%100%99.33%1, 1, 1, 43, 43
src/utils
   workpackageHelper.js97.32%94.74%100%97.75%17–19
src/views
   Dashboard.vue98.04%62.50%60%99.66%1, 1, 1, 1
   ProjectsTab.vue99.74%93.75%100%100%23

@github-actions
Copy link

github-actions bot commented Jun 6, 2023

PHP Code Coverage

Coverage after merging password_branch into master will be
59.24%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
server/apps/integration_openproject/lib/AppInfo
   Application.php12.50%100%25%10.71%103–108, 119, 123, 65–66, 69, 73, 76, 82, 84–86, 88–90, 94–97, 99
server/apps/integration_openproject/lib/BackgroundJob
   RemoveExpiredDirectUploadTokens.php0%100%0%0%42, 44–46, 55–56
server/apps/integration_openproject/lib/Controller
   ConfigController.php66.67%100%50%67.65%133, 150–151, 153, 155–157, 159–160, 165–166, 168, 218, 279, 368–369, 372–373, 502–505, 507–508, 511, 519, 530, 544–546, 561–565, 567–568, 570–573, 575–577, 595–602, 604–605, 607, 609, 612–614, 616–618, 632, 641–644, 646–649, 659–664
   DirectDownloadController.php0%100%0%0%36–38, 53–55, 57, 60–61
   DirectUploadController.php71.43%100%100%70.43%131–132, 177, 190, 194–197, 199, 209, 216, 232–234, 236–237, 240–242, 248, 250, 255–256, 263–264, 267–268, 271–272, 288–289, 309, 314, 320
   FilesController.php78.86%100%100%77.59%168, 220–221, 272, 278–282, 286–288, 290, 292, 303–305, 308–309, 311–312, 316–319, 322
   OpenProjectAPIController.php83.82%100%73.33%84.66%136, 171, 188–189, 193, 197, 199–204, 206, 215–216, 219, 221, 223–226, 228–229, 234, 253, 278, 535, 537, 95
server/apps/integration_openproject/lib/Dashboard
   OpenProjectWidget.php0%100%0%0%101–102, 104–108, 116, 123–124, 126, 128–129, 131–132, 134, 137–138, 140–141, 143, 69–73, 80, 87, 94
server/apps/integration_openproject/lib/Exception
   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%45, 53–54, 57–60
   BeforeNodeInsideOpenProjectGroupfilderChangedListener.php0%100%0%0%37–39, 43–48, 50–55, 57, 59, 63
   BeforeUserDeletedListener.php0%100%0%0%45, 52–53, 55–58
   LoadSidebarScript.php0%100%0%0%101, 103–105, 107, 109, 111–112, 114–115, 117, 119, 72–78, 80–81, 83–84, 86–87, 93–94, 96–97, 99
   UserChangedListener.php0%100%0%0%49, 56–57, 60–64
server/apps/integration_openproject/lib/Migration
   Version2001Date20221213083550.php0%100%0%0%47, 57, 60, 63, 67, 70, 73, 77–79, 81
   Version2310Date20230116153411.php0%100%0%0%46, 49–52, 54–56, 60, 64, 68, 72, 76, 81–82, 84
   Version2400Date20230504144300.php0%100%0%0%47, 57, 60
server/apps/integration_openproject/lib/Search
   OpenProjectSearchProvider.php0%100%0%0%102, 109–110, 113–118, 120–121, 123–125, 128–129, 131–132, 136–141, 147–148, 150, 159–163, 171–179, 195–202, 211–216, 71–75, 82, 89, 97, 99
   OpenProjectSearchResultEntry.php100%100%100%100%
server/apps/integration_openproject/lib/Service
   DatabaseService.php43.90%100%60%41.67%125–128, 131, 80–87, 89–93, 95–97
   DirectDownloadService.php88%100%100%86.96%65–66, 68
   DirectUploadService.php54.55%100%66.67%52.63%112, 118, 79–82, 84, 89, 91
   OauthService.php0%100%0%0%37–38, 47–53, 55, 64–67, 78–85, 95–99
   OpenProjectAPIService.php75.92%100%75%76.01%1003, 1007, 1017, 1019, 1022, 1024, 1123–1125, 1135, 180–184, 356–357, 359, 373–374, 383, 387, 408, 496–497, 504, 507–510, 512, 518, 522–524, 544, 554–557, 561–562, 564, 567–569, 574–576, 579–581, 583, 586–587, 590, 756, 827, 857–858, 860, 862–863, 886, 890, 894–895, 898–901, 903–904, 906–907, 909–910, 958–960, 962–964, 967, 984, 986, 989, 992, 998
server/apps/integration_openproject/lib/Settings
   Admin.php0%100%0%0%38–41, 48–50, 53–57, 59–60, 65–67, 69, 72, 74–75, 77, 81, 85
   

@SwikritiT
Copy link
Contributor

I'll be merging this

@SwikritiT SwikritiT merged commit 4c2ca07 into master Jun 7, 2023
@delete-merged-branch delete-merged-branch bot deleted the password_branch branch June 7, 2023 05:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants