nextcloud-libraries / nextcloud-libraries/nextcloud-dialogs
`showLoading` and `showUndo` "ignore" `isHTML = true`
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 19
- Forks
- 8
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 37
Description
The showLoading and showUndo functions somewhat "ignore" isHTML = true, because they don't simply pass the text argument to showMessage, which itself just forwards it to Toastify, but they create a new element and set its innerText property to the value of text and then pass the whole element to showMessage.
I think it would be fine to do
const loaderContent = document.createElement('div')
loaderContent[options.isHTML ? 'innerHTML' : 'innerText'] = text
The containers are flex containers, so I think it won't be a problem
If you don't want to change this, I think it would be a good idea to at least remove isHTML from the options
export function showLoading(text: string, options?: Omit<ToastOptions, 'isHTML'>): Toast { }
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/toast.ts around lines 213-223 to inspect how showLoading and showUndo handle text and isHTML. Check styles/toast.scss around lines 23-28, then verify that HTML text is rendered as intended without breaking the toast layout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100