[pull] master from monkeytypegame:master#768
Merged
Merged
Conversation
fehmer was complaining
### Description Fixes the following bug: - Create tag - Go to account page - Add that tag to some result - Delete the tag - Go back to account page - Notice that it still thinks that the test has a tag --------- Co-authored-by: Jack <jack@monkeytype.com>
### Description <!-- Please describe the change(s) made in your PR --> Refactor `frontend/ts/modals/*` to replace jQuery (some still TODO). I've also modified `dom.ts` to add `setValue` for `ElementsWithUtils<ElementWithValue>` instance. Still trying to grep the whole flow/codebase, so usage of `qsr` or `qs` is uncertain (Probably use `qsr` always? Can find non-existing elements that way or developer error). There are a lot of atomic commits in this PR, feel free to squash. While doing the refactor, also stumbled upon things that I have questions for (didn't made any changes to them), which I thought can be improved: - `custom-generator.ts:146`: The user is able to write minLength > maxLength. Is this behavior correct? - `custom-test-duration.ts:99`: It seems like `parseInput`, always expects a non nullable string, and we seem to always expect that `#customTestDurationModal input` to always exist (so I used `qsr`), which makes the conditions `val !== null`, `!isNaN(val)` seem to be unnecessary (val is never null or NaN, tbh also isFinite, and val >= 0 is the only valid condition) - `custom-text.ts:169`: These elements does not seem exist `.randomWordsCheckbox`, `.replaceNewlineWithSpace`, `.typographyCheck`, and `.delimiterCheck` (last two is just in a challenge file). Are they good to remove? - `edit-preset.ts:146`: Noticed that we're not updaitng the DOM, since for the most part, in the logic, we mostly use `state.checkboxes`, so no problem happens, but I think it is also a good idea to update the DOM to match current state? Either calling `updateUI()` here or just changing the checked value inline. - `quote-rate.ts:89`: `getQuoteStats` expects a `quote` but we're not really passing anything to it, so this essentially does nothing, since it returns immediately on `!quote` ### Checks - [x] Adding/modifying Typescript code? - [x] I have used `qs`, `qsa` or `qsr` instead of JQuery selectors. - [x] Check if any open issues are related to this PR; if so, be sure to tag them below. - [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. <!-- label(optional scope): pull request title (@your_github_username) --> <!-- I know I know they seem boring but please do them, they help us and you will find out it also helps you.--> Related #7186 <!-- the issue(s) your PR resolves if any (delete if that is not the case) --> <!-- please also reference any issues and or PRs related to your pull request --> <!-- Also remove it if you are not following any issues. --> <!-- pro tip: you can mention an issue, PR, or discussion on GitHub by referencing its hash number e.g: [#1234](#1234) --> <!-- pro tip: you can press . (dot or period) in the code tab of any GitHub repo to get access to GitHub's VS Code web editor Enjoy! :) --> #7186 --------- Co-authored-by: Miodec <jack@monkeytype.com>
…biplavbarua) (#7333) This PR addresses the `TODO` in `simple-modals.ts` by moving event handlers to their respective page controller files (`account-settings.ts` and `settings.ts`). **Key Changes:** 1. Moved `.pageAccountSettings` handlers to `account-settings.ts`. 2. Moved `.pageSettings` handlers to `settings.ts`. 3. Extracted `PopupKey`, `list`, and `showPopup` to `simple-modals-base.ts` to resolve circular dependencies introduced by importing page controllers in `simple-modals.ts` (which now import `showPopup` from base). **Testing:** - Verified no circular dependencies with `madge`. - Verified type safety with `tsc`. - Verified build success. --------- Co-authored-by: Jack <jack@monkeytype.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )