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

Improvements for app provider #6003

Merged

Conversation

diocas
Copy link
Contributor

@diocas diocas commented Nov 9, 2021

This PR fixes 2 bugs for the app-provider extension and adds error messages to the UI.

Description

Related Issue

Motivation and Context

How Has This Been Tested?

  • Manually

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)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

@update-docs
Copy link

update-docs bot commented Nov 9, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

Copy link
Contributor

@pascalwengerter pascalwengerter left a comment

Choose a reason for hiding this comment

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

Changes look pretty good (just ran them locally against the oCIS-wopi example. To go forward with this, you'll have to run yarn test:unit packages/web-app-external/ -u to update & commit the snapshot tests (and we'll need to investigate why the CI died for you before even reaching them)

@pascalwengerter
Copy link
Contributor

pascalwengerter commented Nov 9, 2021

Changes look pretty good (just ran them locally against the oCIS-wopi example. To go forward with this, you'll have to run yarn test:unit packages/web-app-external/ -u to update & commit the snapshot tests (and we'll need to investigate why the CI died for you before even reaching them)

Also, could you add one (or two?) bugfix changelog item(s) in the unreleased folder? Same idea/structure/process as in REVA from my understanding

@ownclouders
Copy link
Contributor

Results for oC10SharingAccept https://drone.owncloud.com/owncloud/web/20177/14/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@diocas
Copy link
Contributor Author

diocas commented Nov 10, 2021

Is the pipeline breaking in sharing? I don't see the relation to this PR. Can you help me?

@pascalwengerter
Copy link
Contributor

Is the pipeline breaking in sharing? I don't see the relation to this PR. Can you help me?

Yeah we'll do a code review & CI check after standup today!

@ownclouders
Copy link
Contributor

Results for oCISFavorites https://drone.owncloud.com/owncloud/web/20223/53/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oCISResharing1 https://drone.owncloud.com/owncloud/web/20223/62/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10XGAPortrait2 https://drone.owncloud.com/owncloud/web/20223/45/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10XGAPortrait1 https://drone.owncloud.com/owncloud/web/20223/44/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oCISFiles1 https://drone.owncloud.com/owncloud/web/20223/54/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10SharingExternalRoot https://drone.owncloud.com/owncloud/web/20223/42/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10XGAPortraitNotifications https://drone.owncloud.com/owncloud/web/20223/43/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

Copy link
Contributor

@pascalwengerter pascalwengerter left a comment

Choose a reason for hiding this comment

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

Sorry for being this naggy, found more small stuff 😬

changelog/unreleased/enhancement-app-provider-feedback Outdated Show resolved Hide resolved
changelog/unreleased/bugfix-no-context-menu-app-provider Outdated Show resolved Hide resolved
@@ -3,6 +3,7 @@
exports[`The external app error screen component displays an icon and a paragraph 1`] = `
<div class="uk-text-center">
<ocicon-stub size="xxlarge" name="warning"></ocicon-stub>
<p data-msgid="Error when loading the application" data-current-language="en_US">Error when loading the application</p>
<h1 class="oc-text-lead" data-msgid="Error when loading the application" data-current-language="en_US">Error when loading the application</h1>
<!---->
Copy link
Contributor

Choose a reason for hiding this comment

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

Would like to see a scenario where an error message is given and rendered in the ErrorScreen test!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how to add tests... Can you explain/give some pointers?

Copy link
Contributor

Choose a reason for hiding this comment

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

The test lives close to the component (https://github.com/owncloud/web/blob/master/packages/web-app-external/tests/unit/components/ErrorScreen.spec.ts) and should be pretty self-explanatory:

  • describe steps (strings) to explain the context
  • it steps (strings) to assert certain behavior
  • components get mounted and then you can assert a certain DOM structure (snapshot tests, like in this case), check if user interactions trigger correct behavior (by e.g. mocking clicks) etc
  • you can mount them passing props (in this case you'd want one snapshot test with and one without the errorMessage and check if the <p> tag gets rendered if an errorMessage is given

Feel free to get inspired by the other tests, usually the files app offers more diverse test scenarios: https://github.com/owncloud/web/tree/master/packages/web-app-files/tests/unit/components

<h1 class="oc-invisible-sr">"exampleApp" app page</h1>
<errorscreen-stub></errorscreen-stub>
<loadingscreen-stub></loadingscreen-stub>
Copy link
Contributor

Choose a reason for hiding this comment

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

Somehow this doesn't render the errorscreen anymore, could you investigate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@elizavetaRa can you have a look?

<h1 class="oc-invisible-sr">"exampleApp" app page</h1>
<errorscreen-stub></errorscreen-stub>
<loadingscreen-stub></loadingscreen-stub>
Copy link
Contributor

Choose a reason for hiding this comment

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

Somehow this doesn't render the errorscreen anymore, could you investigate?

@diocas
Copy link
Contributor Author

diocas commented Nov 11, 2021

Np! I'm super picky when reviewing PRs so I expect the same from others :)

@ownclouders
Copy link
Contributor

Results for oC10SharingPermissionsUsers https://drone.owncloud.com/owncloud/web/20262/33/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@diocas diocas force-pushed the up_app_provider branch 2 times, most recently from 82c1ea1 to 8d9b664 Compare November 16, 2021 11:56
@ownclouders
Copy link
Contributor

Results for oC10SharingAccept https://drone.owncloud.com/owncloud/web/20315/14/1
The following scenarios passed on retry:

  • webUISharingAcceptSharesToRoot/acceptShares.feature:108

@diocas
Copy link
Contributor Author

diocas commented Dec 2, 2021

Updated the branch with latest master. @elizavetaRa can you check @pascalwengerter message?

Somehow this doesn't render the errorscreen anymore, could you investigate?

@pascalwengerter sorry, didn't have time to add tests. Could your QA team do it?

@sonarcloud
Copy link

sonarcloud bot commented Dec 9, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@diocas
Copy link
Contributor Author

diocas commented Dec 13, 2021

Can this be merged?
I saw that @dschmidt is handling #6002 but that is already fixed in this PR.
I guess the only thing missing are some tests.

@pascalwengerter pascalwengerter changed the base branch from master to external-apps-errorhandling December 13, 2021 15:29
@pascalwengerter
Copy link
Contributor

I'll merge this PR into a temporary branch in web in order to being able to fix the tests myself. Thanks @diocas for the contribution!

@pascalwengerter pascalwengerter merged commit 72cacbd into owncloud:external-apps-errorhandling Dec 13, 2021
@diocas diocas deleted the up_app_provider branch December 15, 2021 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

No right click menu nor action on non app-providder items Wrong iframe size for external apps
3 participants