badge-generator icon indicating copy to clipboard operation
badge-generator copied to clipboard

Extend HTML mode - persist checkbox value and use across views

Open irenejoeunpark opened this issue 3 years ago • 4 comments

This PR is an additional feature to issue #101. Created method to store asHtml in store.ts and use that value in Code.vue. If you check/uncheck the Html checkbox in one view, it applies to all other views.

irenejoeunpark avatar Nov 26 '21 04:11 irenejoeunpark

Also a problem I found is that the checkbox only syncs across views - I'd like it to sync within the Catalogue view across checkboxes.

So maybe the asHtml boolean is passed in as a prop to the component. That will make the tests easier. And also then the Catalogue page can have an asHtml value which is passed to all components, so they all share the same value. Events will be needed to sync them.

I tried this global approach but had errors

https://stackoverflow.com/a/54882568/6250733

MichaelCurrin avatar Nov 26 '21 20:11 MichaelCurrin

Also an problem I found is that the checkbox only syncs across views - I'd like it to sync within the Catalogue view across checkboxes.

So maybe the asHtml boolean is passed in as a prop to the component. That will make the tests easier. And also then the Catalogue page can have an asHtml value which is passed to all components, so they all share the same value. Events will be needed to sync them.

I tried this global approach but had errors

https://stackoverflow.com/a/54882568/6250733

Also an problem I found is that the checkbox only syncs across views - I'd like it to sync within the Catalogue view across checkboxes.

So maybe the asHtml boolean is passed in as a prop to the component. That will make the tests easier. And also then the Catalogue page can have an asHtml value which is passed to all components, so they all share the same value. Events will be needed to sync them.

I tried this global approach but had errors

https://stackoverflow.com/a/54882568/6250733

Thanks for noticing those! I will give you a fix as soon as I finish them. And how do I run the test?

irenejoeunpark avatar Nov 29 '21 15:11 irenejoeunpark

https://github.com/MichaelCurrin/badge-generator/blob/master/docs/usage.md#tests

Or on Windows

yarn test

Also note the checks at the bottom of the conversation with green ticks and then a red cross for the failing tests on GitHub Actions

MichaelCurrin avatar Nov 29 '21 23:11 MichaelCurrin

Let me know if you need more info to complete this. Thanks.

MichaelCurrin avatar Jan 06 '22 13:01 MichaelCurrin