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

[WP#53002]Fix/wrong template and refactor validation for workpackage created from NC #580

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

SagarGi
Copy link
Collaborator

@SagarGi SagarGi commented Feb 23, 2024

Description

This PR refactors the form validation for creating workpackage from nextcloud.

  • Fixes the wrong template shown which does not match according to the selected project types. Previously it might been have been occurred because the all the values passed in the form might have not been reset properly.
  • Also makes the form validation functionality same as that of openproject as it was missing in the form validation which includes do not show type and status when those are not available when selecting or switching between projects
  • Also not to change the description template once they have been edited by the workpackage creator.

Related Issue or Workpackage

Screenshots (if appropriate):

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

@SagarGi SagarGi self-assigned this Feb 23, 2024
@SagarGi SagarGi force-pushed the fix/wrong_template_for_workpackage branch 4 times, most recently from 78cd0f8 to 175a777 Compare March 5, 2024 10:17
@SagarGi SagarGi marked this pull request as ready for review March 5, 2024 11:11
@SagarGi SagarGi requested a review from nabim777 March 5, 2024 11:12
@SagarGi SagarGi changed the title [WP#53002]Fix/wrong template for workpackage [WP#53002]Fix/wrong template and refactor validation for workpackage created from NC Mar 5, 2024
@SagarGi SagarGi requested a review from individual-it March 5, 2024 11:13
@SagarGi SagarGi requested a review from individual-it March 6, 2024 03:46
@SagarGi SagarGi force-pushed the fix/wrong_template_for_workpackage branch from c05416e to c68013d Compare March 7, 2024 10:55
src/views/CreateWorkPackageModal.vue Outdated Show resolved Hide resolved
src/views/CreateWorkPackageModal.vue Outdated Show resolved Hide resolved
tests/jest/views/CreateWorkpackageModal.spec.js Outdated Show resolved Hide resolved
tests/jest/views/CreateWorkpackageModal.spec.js Outdated Show resolved Hide resolved
tests/jest/views/CreateWorkpackageModal.spec.js Outdated Show resolved Hide resolved
tests/jest/views/CreateWorkpackageModal.spec.js Outdated Show resolved Hide resolved
@SagarGi SagarGi force-pushed the fix/wrong_template_for_workpackage branch 2 times, most recently from 8f7fb87 to 28a5668 Compare March 12, 2024 07:04
@SagarGi SagarGi requested a review from individual-it March 12, 2024 07:08
@SagarGi SagarGi force-pushed the fix/wrong_template_for_workpackage branch 3 times, most recently from cfa47df to 97fee53 Compare March 13, 2024 09:20
@SagarGi
Copy link
Collaborator Author

SagarGi commented Mar 14, 2024

@nabim777 can you do a QA for this PR playing around with the form before we merge once.

@SagarGi SagarGi force-pushed the fix/wrong_template_for_workpackage branch from 97fee53 to b03caba Compare March 15, 2024 03:57
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
@SagarGi SagarGi force-pushed the fix/wrong_template_for_workpackage branch from b03caba to 1ad438b Compare March 15, 2024 05:04
Copy link

JS Code Coverage

Coverage after merging fix/wrong_template_for_workpackage into master will be
86.93%
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.js69.70%33.33%50%72.13%10–14, 17–26, 6–9
src/components
   AdminSettings.vue99.30%95.60%85.19%99.91%1, 1, 1, 1, 1
   OAuthConnectButton.vue99.21%87.50%100%100%1
   PersonalSettings.vue98.87%93.33%85.71%100%1
src/components/admin
   FieldValue.vue97.12%83.33%100%98.89%1, 23, 23
   FormHeading.vue97.66%75%100%99.36%1, 1, 34, 34
   ProjectFolderError.vue96.83%80%100%98.21%1, 1
   TermsOfServiceUnsigned.vue99.19%90%100%100%1
   TextInput.vue99.25%95%88.89%100%1
src/components/icons
   ClippyIcon.vue93.18%50%50%97.50%1, 1
   OpenProjectIcon.vue93.02%50%50%97.44%1, 1
src/components/settings
   CheckBox.vue92.45%80%66.67%97.62%1, 1
   SettingsTitle.vue91.11%50%100%94.87%1, 1, 10, 10
src/components/tab
   EmptyContent.vue96.09%72.73%100%99.35%1, 1, 1, 1, 1, 34, 34
   SearchInput.vue98.28%80%55.56%100%1, 1, 1
   WorkPackage.vue98.43%40%100%99.36%1, 1, 1, 43, 43
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.js88.24%90.24%77.78%88.30%155–157, 178–179, 18, 180–187, 19–20, 49, 49–51, 94–99
src/views
   CreateWorkPackageModal.vue98.20%88.24%40%99.86%1, 1, 1, 1, 1
   Dashboard.vue98.97%71.43%100%99.65%1, 1, 1
   LinkMultipleFilesModal.vue99.67%94.12%100%100%1
   ProjectsTab.vue99.74%93.75%100%100%23
   WorkPackagePickerElement.vue0%0%0%0%1, 1, 10, 100–109, 11, 110–119, 12, 120–129, 13, 130–139, 14, 140–149, 15, 150–151, 16–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
   WorkPackageReferenceWidget.vue0%0%0%0%1, 1, 10, 100–109, 11, 110–119, 12, 120–129, 13, 130–134, 14–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

Copy link

PHP Code Coverage

Coverage after merging fix/wrong_template_for_workpackage into master will be
59.45%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
server/apps/integration_openproject/lib
   Capabilities.php0%100%0%0%19, 26–29
server/apps/integration_openproject/lib/AppInfo
   Application.php10.53%100%25%8.82%103, 105–108, 110, 112, 114, 118–121, 123, 127–132, 143, 147, 74–76, 79, 83, 85, 88, 92, 94, 98
server/apps/integration_openproject/lib/BackgroundJob
   RemoveExpiredDirectUploadTokens.php0%100%0%0%42, 44–46, 55–56
server/apps/integration_openproject/lib/Controller
   ConfigController.php63.57%100%53.33%64.15%135, 152–153, 155, 157–159, 161–162, 167–168, 170, 212, 221, 282, 371–372, 375–376, 382–384, 424, 512–515, 517–518, 521, 529, 540, 554–556, 571–575, 577–578, 580–583, 585–587, 589–591, 593–595, 613–618, 620–621, 623–625, 628, 630–633, 635–637, 639–641, 643–645, 659, 668–671, 673–676, 686–691
   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.php73.86%100%83.33%73.17%181–182, 244, 250, 252–254, 256, 258, 269–271, 274–275, 277–278, 282–285, 288, 294
   OpenProjectAPIController.php83.87%100%80%84.17%139, 180, 204, 230–233, 236, 238, 240–243, 245–246, 251, 263, 272, 290, 299, 367, 369, 419, 421, 441, 443, 490, 492, 518–521, 524–528, 530, 735, 737, 96
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%48, 56–57, 60–63
   BeforeNodeInsideOpenProjectGroupfilderChangedListener.php0%100%0%0%41–43, 47–52, 54, 57–58, 60–65, 67, 69, 73
   BeforeUserDeletedListener.php0%100%0%0%48, 55–56, 58–61
   LoadAdditionalScriptsListener.php0%100%0%0%17–18, 21–25
   LoadSidebarScript.php0%100%0%0%100, 102, 104, 106–108, 110, 112, 114–115, 117–118, 120, 122, 75–81, 83–84, 86–87, 89–90, 96–97, 99
   OpenProjectReferenceListener.php0%100%0%0%53–54, 58–59, 62–63, 65, 67
   TermsOfServiceEventListener.php0%100%0%0%59–60, 64–66, 68–69, 71–73, 76–78
   UserChangedListener.php0%100%0%0%52, 59–60, 63–68
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/Reference
   WorkPackageReferenceProvider.php44%100%18.18%51.28%102, 108–111, 114–116, 119, 123, 157, 165–166, 174, 52, 59, 66, 73–74
server/apps/integration_openproject/lib/Search
   OpenProjectSearchProvider.php0%100%0%0%103–104, 107–114, 116–118, 121–122, 124–125, 129–134, 140–141, 143, 66–69, 76, 83, 91, 93, 96
   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%108–115, 45–47, 56–66, 68, 70–72, 75–78, 89, 91–94, 96–97
   OpenProjectAPIService.php75.30%100%75%75.33%1001–1003, 1005–1007, 1010, 1028, 1030,

@nabim777
Copy link
Collaborator

@nabim777 can you do a QA for this PR playing around with the form before we merge once.

It works fine for me and also this PR fixes the bug https://community.openproject.org/projects/nextcloud-integration/work_packages/53003/activity

@SagarGi SagarGi merged commit a37d31b into master Mar 19, 2024
21 checks passed
@delete-merged-branch delete-merged-branch bot deleted the fix/wrong_template_for_workpackage branch March 19, 2024 03:20
SagarGi added a commit that referenced this pull request Mar 19, 2024
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
SagarGi added a commit that referenced this pull request Mar 19, 2024
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
SagarGi added a commit that referenced this pull request Mar 19, 2024
Signed-off-by: sagargurung1001@gmail.com <sagargurung1001@gmail.com>
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