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

Show a warning when viewing a non-public add-on #11368

Closed
kumar303 opened this issue Jan 26, 2018 · 10 comments · Fixed by mozilla/addons-frontend#5969
Closed

Show a warning when viewing a non-public add-on #11368

kumar303 opened this issue Jan 26, 2018 · 10 comments · Fixed by mozilla/addons-frontend#5969

Comments

@kumar303
Copy link
Contributor

Describe the problem and steps to reproduce it:

As an admin, log in to AMO and view the detail page for a disabled add-on

or

As a developer, upload an add-on, make it non-public, log in to AMO and view its detail page

What happened?

You see a complete detail page as if nothing was different

What did you expect to happen?

You should see a warning saying that the add-on is not public but you're seeing it anyway because you have elevated privileges.

Anything else we should know?

This has created confusion a couple of times from admins or developers who are not expecting to see a public listing.

It should be pretty easy to fix:

diff --git a/src/amo/components/Addon/index.js b/src/amo/components/Addon/index.js
index a2d4eec21..52e2b4d4e 100644
--- a/src/amo/components/Addon/index.js
+++ b/src/amo/components/Addon/index.js
@@ -53,6 +53,7 @@ import Card from 'ui/components/Card';
 import Icon from 'ui/components/Icon';
 import LoadingText from 'ui/components/LoadingText';
 import ShowMoreCard from 'ui/components/ShowMoreCard';
+import Notice from 'ui/components/Notice';
 
 import './styles.scss';
 
@@ -537,6 +538,11 @@ export class AddonBase extends React.Component {
                 reason={compatibility.reason}
               />
             ) : null}
+            {addon && addon.status !== 'public' ? (
+              <Notice type="error">
+                {i18n.gettext('This is not a public listing. You are only seeing it because of elevated permissions.')}
+              </Notice>
+            ) : null}
             <header className="Addon-header">
               {this.headerImage({ compatible: isCompatible })}
 
@ioanarusiczki
Copy link

Yes, while testing I've also noticed this behavior, it is still reproducible on AMO dev and AMO stage with FF60(Win10). Would be nice to display the message on the new frontend too

no message - new site

@willdurand
Copy link
Member

Yes, while testing I've also noticed this behavior, it is still reproducible on AMO dev and AMO stage with FF60(Win10). Would be nice to display the message on the new frontend too

Yup, it was never fixed so I am marking this issue as "contrib: welcome".

@lavish205
Copy link

I would like to work on this bug.

@rebmullin
Copy link
Contributor

hey @lavish205, this one was already taken but feel free to find another 1 to help out on : )

@rebmullin
Copy link
Contributor

hey @kumar303 @willdurand,

Here is what the update looks like (in PR mozilla/addons-frontend#5969)
Alt text

and just had some follow up questions here:

Do we want both errors?

Do we care about styles here?

@willdurand
Copy link
Member

Do we want both errors?

Yes, that'd be nice.

Do we care about styles here?

Yes, the minimum is to have some padding below the second notification.

@ioanarusiczki
Copy link

@willdurand I checked for both scenarios given by @kumar303 with FF61(win10) on AMO dev

First one works

As an admin, log in to AMO and view the detail page for a disabled add-on

disabled add-on as seen by an admin

The second seems to be with problems - I could file a separate issue and close this one

As a developer, upload an add-on, make it non-public, log in to AMO and view its detail page

I logged in with a developer account and made one of the add-ons "Invisible" from dev hub (the versions page). Then went to it's detail page but the message won't show up in this case

the invisible status

@willdurand
Copy link
Member

ah... yeah so an add-on marked as non-public is visible (status) but disabled (is_disabled = true).

@ioanarusiczki can you file an issue? I am about to fix it.

@ioanarusiczki
Copy link

@willdurand It works now for the second scenario too

invisible from devhub

Verified fixed on AMO dev with FF61(Win10 & Android 8.0)

@ioanarusiczki
Copy link

I'm adding that the message is also available for developers before the add-ons are auto-approved or approved by admins. Verified on AMO stage with FF61(Win10)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants