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

Datagrid: Fallback Image when image can not be loaded #5442

Closed
hemantg05 opened this issue Jul 20, 2021 · 8 comments · Fixed by #5757 or #6174
Closed

Datagrid: Fallback Image when image can not be loaded #5442

hemantg05 opened this issue Jul 20, 2021 · 8 comments · Fixed by #5757 or #6174

Comments

@hemantg05
Copy link

We would like to show a fallback image in case the image url provided to the datagrid image column doesn't load successfully.

Describe alternatives you've considered

(Soho.Formatters as any).ImageUnavailableFallbackCustomFormatter = (
      row: number,
      cell: any,
      value: any,
      column: SohoDataGridColumn,
      item: any,
      api: SohoDataGridStatic
    ) => {
     return `<img src="`+
      'http://stackoverflow.com/does-not-exist.png' +
      `" onerror="console.log('errror'); this.src='https://cdn.sstatic.net/Img/unified/sprites.svg?v=e5e58ae7df45'"
       alt="" width="35" height="35">`
    };
    

But onerror is removed by IDS for Security concerns (related to XSS attacks).

I referred to this answer for fallback image solution. https://stackoverflow.com/a/7995298

Additional context
Infor PIM

@tmcconechy tmcconechy changed the title Soho Datagrid: Fallback Image when image can not be loaded Datagrid: Fallback Image when image can not be loaded Jul 20, 2021
@tmcconechy tmcconechy added [3] Velocity rating (Fibonacci) type: enhancement ✨ labels Jul 20, 2021
@bbmuni
Copy link

bbmuni commented Sep 15, 2021

@tmcconechy Please prioritize this ticket as we have issue reported by customer related to this functionality

@tmcconechy tmcconechy added this to Triage in Enterprise (Next) Sprint Grooming via automation Sep 15, 2021
@tmcconechy tmcconechy added this to To do in Enterprise 4.57.x (Oct 2021) Sprint via automation Sep 29, 2021
@tmcconechy
Copy link
Member

@ericangeles for the design we should use the placeholder images / icons here similar to this https://main-enterprise.demo.design.infor.com/components/images/example-index.html

@bbmuni
Copy link

bbmuni commented Oct 18, 2021

@tmcconechy Any update on this issue and when we except the fix ?

@ericangeles
Copy link
Contributor

@bbmuni hi, this issue is still in progress, and expect to be part of the 4.57 version. End of October Sprint.

@tmcconechy
Copy link
Member

Also wondering @bbmuni can you see the project info on the right side of the issue? It says which version and sprint. But wondering if thats available/visible to you?

Screen Shot 2021-10-18 at 9 14 53 AM

@nganotice
Copy link

This has been QA tested and passed on v4.57.0-beta.

https://4570-beta0-enterprise.demo.design.infor.com/components/treemap/example-stats.html?theme=new&mode=light
Screen Shot 2021-11-04 at 2 16 22 PM

Moving this ticket to Done.

Thanks!

@nganotice nganotice moved this from Ready for QA (beta) to Done in Enterprise 4.57.x (Oct 2021) Sprint Nov 4, 2021
@tmcconechy tmcconechy added this to To do in Enterprise 4.61.x (Feb 2022) Sprint via automation Mar 7, 2022
@tmcconechy tmcconechy reopened this Mar 7, 2022
@tmcconechy
Copy link
Member

Testing with @hemantg05 if you use add row or re-render then this fails to work. Pushing a new easy fix

@tmcconechy tmcconechy moved this from To do to Pending Review in Enterprise 4.61.x (Feb 2022) Sprint Mar 7, 2022
@jbrcna
Copy link
Contributor

jbrcna commented Mar 9, 2022

This has been QA tested and passed on v4.61.0-beta.
https://4610-beta0-enterprise.demo.design.infor.com/components/datagrid/test-images-error.html
image

@jbrcna jbrcna moved this from Ready for QA (beta) to Done in Enterprise 4.61.x (Feb 2022) Sprint Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement ✨ [3] Velocity rating (Fibonacci)
Projects
No open projects
7 participants