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

Display custom Apps' logos #3749

Merged
merged 11 commits into from
Jun 15, 2023
Merged

Display custom Apps' logos #3749

merged 11 commits into from
Jun 15, 2023

Conversation

lkostrowski
Copy link
Member

@lkostrowski lkostrowski commented Jun 12, 2023

Displays logo from Manifest (available from 3.14) in apps list, app installation and app details

To be tested with App with logo:
https://saleor-app-products-feed-git-app-logo-saleorcommerce.vercel.app/api/manifest

or any preview URLs from this PR saleor/apps#552 (comment)
(copy preview URL + add /api/manifest

QA:

  1. Using app that does not contain brand.logo.default field in manifest will not display custom logo - will fallback to generic icon
  2. Using app with brand.logo.default will use this logo in following places: app installation page, app list - during installation, app list - after installation, app details

Other changes

  1. App installation page icons are changed: new Saleor logo + rectangle icons instead circles
  2. App icon size in app details page is bigger

Screenshots

Zrzut ekranu 2023-06-13 o 09 58 16 Zrzut ekranu 2023-06-13 o 09 58 10
Zrzut ekranu 2023-06-13 o 09 57 57 Zrzut ekranu 2023-06-13 o 09 57 52
Zrzut ekranu 2023-06-13 o 09 57 36 Zrzut ekranu 2023-06-13 o 09 57 29

Pull Request Checklist

  1. This code contains UI changes
  2. All visible strings are translated with proper context including data-formatting
  3. Attributes data-test-id are added for new elements
  4. The changes are tested in Chrome/Firefox/Safari browsers and in light/dark mode
  5. Your code works with the latest stable version of the core

Test environment config

API_URI=https://automation-dashboard.staging.saleor.cloud/graphql/
APPS_MARKETPLACE_API_URI=https://apps.staging.saleor.io/api/v2/saleor-apps

Do you want to run more stable tests?

To run all tests, just select the stable checkbox. To speed up tests, increase the number of containers. Tests will be re-run only when the "run e2e" label is added.

  1. stable
  2. giftCard
  3. category
  4. collection
  5. attribute
  6. productType
  7. shipping
  8. customer
  9. permissions
  10. menuNavigation
  11. pages
  12. sales
  13. vouchers
  14. homePage
  15. login
  16. orders
  17. products
  18. app
  19. plugins
  20. translations
  21. navigation
  22. variants
  23. payments

CONTAINERS=1

@github-actions github-actions bot temporarily deployed to brand-logo June 12, 2023 19:34 Inactive
@github-actions github-actions bot temporarily deployed to storybook brand-logo June 12, 2023 19:34 Inactive
@github-actions github-actions bot temporarily deployed to brand-logo June 13, 2023 08:10 Inactive
@github-actions github-actions bot temporarily deployed to storybook brand-logo June 13, 2023 08:10 Inactive
@github-actions github-actions bot temporarily deployed to brand-logo June 13, 2023 11:36 Inactive
@github-actions github-actions bot temporarily deployed to storybook brand-logo June 13, 2023 11:36 Inactive
@lkostrowski lkostrowski marked this pull request as ready for review June 13, 2023 11:37
@lkostrowski lkostrowski requested review from a team, krzysztofzuraw and Droniu June 13, 2023 11:37
@lkostrowski lkostrowski changed the title WIP Display custom Apps' logos Display custom Apps' logos Jun 13, 2023
@lkostrowski lkostrowski self-assigned this Jun 13, 2023
@@ -39,6 +41,18 @@ export const AppInstallPage: React.FC<AppInstallPageProps> = ({
}) => {
const intl = useIntl();
const classes = useStyles();
const { theme } = useTheme();

const getSaleorLogoUrl = () => {
Copy link
Member

Choose a reason for hiding this comment

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

We already have a themeable Saleor logo in the side navigation. Is the code duplicated, or was there another reason?

Copy link
Member Author

Choose a reason for hiding this comment

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

Previously it was using a fixed image. In this diff I replaced it to one that is used in the navigation. Its not themable - these are 2 different PNGs

@wojteknowacki
Copy link
Member

There is only one view that does not have an app img - Manage App - is it on purpose?
Zrzut ekranu 2023-06-13 o 16 28 45

@wojteknowacki
Copy link
Member

App img during the installation process is not visible on the app list view from the start - default img is visible and then a new one is placed in its place or sometimes new img is not replacing the default one at all

Nagranie.z.ekranu.2023-06-13.o.16.44.02.mov

@wojteknowacki
Copy link
Member

wojteknowacki commented Jun 13, 2023

Not all apps placeholders images are visible on the list view after installation - for example slack. When entering details and moving back placeholder img is visible for a while
Zrzut ekranu 2023-06-13 o 16 49 31
Not sure is it related to this PR changes or not

@lkostrowski
Copy link
Member Author

There is only one view that does not have an app img - Manage App - is it on purpose? Zrzut ekranu 2023-06-13 o 16 28 45

It was never there, but its a good time add it 👍

@github-actions github-actions bot temporarily deployed to brand-logo June 14, 2023 11:09 Inactive
@github-actions github-actions bot temporarily deployed to storybook brand-logo June 14, 2023 11:09 Inactive
Copy link
Member Author

Choose a reason for hiding this comment

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

Removed test. It tests nothing and is very flaky

wojteknowacki
wojteknowacki previously approved these changes Jun 14, 2023
Comment on lines 20 to 24
brand {
logo {
default
}
}
Copy link
Member

Choose a reason for hiding this comment

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

We should set logo thumbnail size and format arguments - it can significantly reduce loading times. Something like this should work:

default(size: 64, format:WEBP)

sorry for not mentioning this earlier

Copy link
Member Author

Choose a reason for hiding this comment

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

TIL :) I will update it

Copy link
Member Author

Choose a reason for hiding this comment

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

@przlada updated. base64 looks broken to me, please verify

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

Droniu
Droniu previously approved these changes Jun 15, 2023
@github-actions github-actions bot temporarily deployed to brand-logo June 15, 2023 08:44 Inactive
@github-actions github-actions bot temporarily deployed to storybook brand-logo June 15, 2023 08:44 Inactive
@lkostrowski lkostrowski enabled auto-merge (squash) June 15, 2023 13:57
@lkostrowski lkostrowski merged commit 8ba2905 into main Jun 15, 2023
@lkostrowski lkostrowski deleted the brand-logo branch June 15, 2023 14:06
andrzejewsky pushed a commit that referenced this pull request Jun 20, 2023
* wip

* implement logo in all contexts

* fix types

* Improve icons rendering

* Reuse App Header in Manage App page

* Remove loading fallback icon for official Saleor apps. It will be fetched with manifest now

* Imprve app fallback icon

* wip fix tests

* Remove useless test

* Add sizes for logos queries

* Fix thumbnail size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

7 participants