Frontify / frontify-aem-connector

Frontify Adobe Experience Manager
MIT License
4 stars 4 forks source link

ffy-filter.js Error obtaining categories alert window. #24

Open UladzimirLitvinchuk1 opened 3 years ago

UladzimirLitvinchuk1 commented 3 years ago

I would like to suggest improving the user experience for authors. The fact is that in the case when the user is not logged in to Frontify in the side bar (new build, configuration change or connection/configuration problems, etc.), there is a high probability of an error message ("Error obtaining categories") and the way of displaying it on the screen is very annoying for the authors, every time when they open/create a new page, they may encounter, and in most cases they constantly encounter this modal window. On many projects, two approaches are used simultaneously (DAM and FFY) for a very long time, for example, during the migration of the solution to use Frintify, therefore, this problem becomes a difficulty for many authors who may not even work with Frontify. Information about problems with connecting to Frontify is not mandatory for authors, it is necessary for developers, so it is possible to use the browser console for these purposes for example.

ui.frontend/src/main/webpack/site/components/ffy-filter.js lines 37 and 43

var localCategories = sessionStorage.getItem("ffy.categories"); if (localCategories == null || localCategories == undefined) { try { data = await graphQLClient.request(query); } catch (error) { $(window).adaptTo("foundation-ui").alert("Error", "Error while executing the search"); } if (data != null || data != undefined) { sessionStorage.setItem("ffy.categories", JSON.stringify(data)); localCategories = JSON.stringify(data); } else { $(window).adaptTo("foundation-ui").alert("Error", "Error obtaining categories"); } }