Closed chia-yh closed 1 year ago
Overall works as intended! Good work implementing the features. It is probably a good idea to abstract out the title-editor as a separate component!
Some notes: I noticed that the edit button text is no longer centralised after the PR.
Thanks for catching this! I missed it, I'll try and fix it so that it's centralised like before.
Patch coverage: 50.87
% and project coverage change: +0.02
:tada:
Comparison is base (
94134a8
) 54.63% compared to head (269c52b
) 54.66%.
:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@chia-yh thanks for taking up this issue. Now that we have the fix in view, we can consider if the additional code is worth the payback. Seems like it requires a lot of code changes, including a lot of new code. Is it worth the benefit? What do you all think? If the answer is not a confident 'yes', we can close this PR without merging, but still give @chia-yh credit for the work done.
@chunweii Is the extra code worth the benefit (as I mentioned in https://github.com/CATcher-org/CATcher/pull/1197#issuecomment-1607709030) ?
Just something I noticed while writing the additional tests in title-editor.component.spec.ts
with reference to comment-editor.component.spec.ts
, but I believe that some of the async
tests in comment-editor.component.spec.ts
might be bugged, in that the expect
statements seem to never execute.
The affected tests I've found are:
describe('all buttons in the formatting toolbar add the correct markups when text box is empty', () => {
...
it(`should add correct markups when the ${buttonName} button is pressed`, async () => {
describe('all buttons in the formatting toolbar add the correct markups when some text is highlighted', () => {
...
it(`should add correct markups when the ${buttonName} button is pressed`, async () => {
describe('text input box', () => {
...
it('should allow users to input text', async () => {
Changing the expect
statements for these tests to intentionally fail doesn't raise any errors regarding failed tests when running npm run test
, e.g. changing expect(textBoxDe.nativeElement.value).toEqual(expectedMarkup);
to expect(textBoxDe.nativeElement.value).toEqual('');
Following the same format in title-editor.component.spec.ts
, I managed to resolve this by adding await
like so:
await fixture.whenStable().then(() => {
expect(textBox.value).toEqual('123');
});
As this PR may be closed without being merged as the additional code may not be worth the payback, and this issue seems to be a separate concern from the issue this PR is addressing, should I create a separate issue regarding this, and fix it in a separate PR?
As this PR may be closed without being merged as the additional code may not be worth the payback, and this issue seems to be a separate concern from the issue this PR is addressing, should I create a separate issue regarding this, and fix it in a separate PR?
Thank you for discovering this bug in our tests! You should create a separate issue and fix it in a separate PR, even if this PR is accepted
@chunweii Is the extra code worth the benefit (as I mentioned in #1197 (comment)) ?
I think the extra code looks good to merge, but the benefit is small because there are no issues with using the default browser undo/redo for the title component. What do other developers think? @CATcher-org/2223s2
I don't think the undo-redo feature will be used often for Title component in PE. It is simply easier to backspace and only applicable to Bug Reporting Phase. I also can't tell there is a change in behaviour.
Seems like it requires a lot of code changes, including a lot of new code. Is it worth the benefit? What do you all think?
I think we can merge the part of refactoring UndoRedo model. The comment-editor has too many functions, it will be good to refactor out the parts related to UndoRedo to its respective class.
I agree that the behavioral change isn't significant enough to warrant the extra code, especially since most users are unlikely to notice it.
Should I go ahead and open a new PR that refactors the UndoRedo model as mentioned? So that this PR can be closed without merging?
I've opened a new PR (#1205) as mentioned in a previous comment, so this PR can be closed without merging.
Summary:
Fixes #1176
Changes Made:
title-editor.component
, which uses theUndoRedo
model to handle the undo / redo logic for the Title component in the same manner ascomment-editor.component
handles undo / redo logic in the description, but without support for image uploads andctrl+i
,ctrl+b
new-issue.component
,title.component
to useTitleEditorComponent
title-editor.component.spec.ts
for testingTitleEditorComponent
Proposed Commit Message: