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

[Discussion] Refactor Comment Editor Using OOP #9004

Closed
noi5e opened this issue Jan 13, 2021 · 11 comments
Closed

[Discussion] Refactor Comment Editor Using OOP #9004

noi5e opened this issue Jan 13, 2021 · 11 comments
Assignees
Labels
discussion feature explains that the issue is to add a new feature JavaScript outreachy

Comments

@noi5e
Copy link
Contributor

noi5e commented Jan 13, 2021

I wanted to open up an issue to collect ideas/observations I've had about the comment editor's state management. I'll leave this issue open for a few weeks to collect thoughts as they come up (if that's okay). I'm hoping this will help us to conceptualize a code overhaul.

To start with, I wanted to give a bug as an example:

Video of this bug in action

  1. Go to a note/question/wiki page with multiple comments.
  2. Open up a "Reply to this comment..." form.
  3. Open up a separate Edit Comment form.
  4. Scroll back to the Reply Comment form.
  5. Press rich-text buttons in the Reply Comment form.

Expected Behavior: Rich-text changes go in the Reply Comment form.
Actual Behavior: They go in the Edit Comment form.

Why This Happens

It's because we set state (for the focused comment form) here in the edit comment form partial:

function setInit(id) {
var args = {
'textarea': 'c'+id+'text',
'preview': 'c'+id+'preview'
}
$E.initialize(args);
}

But we don't do a similar thing when we open a reply comment form:

<script>
$("#comment-<%= comment.cid %>-reply-toggle").click(function () {
$("#comment-<%= comment.cid %>-reply").toggle();
});
</script>

The Bug Fix

I currently have a PR open that fixes the above bug at #9003.

I intentionally decided not to fix the bug by putting lines to set state when opening a reply comment form.

After all, just because a user opens up a comment form, doesn't mean that they necessarily want the focus to be there.

I thought a better fix would be to set state when the rich-text button was clicked. That seems to signal stronger user intention.

State Management Idea

So the idea is to start thinking about which user actions should set state, and which should not.

Set State

  • click on toolbar buttons
  • drag-and-drop an image
  • type text into a form
  • load a new page (initial state should focus on the main comment form)

Don't Set State

  • open a reply form
  • open an edit form

The Goal

Just to summarize: some sort of object-oriented, React-like refactoring where as much of this code can be inside a single script, creating modular comment form objects, where the state can be clearly transparent at each step of the way. 🎈


(This issue is part of the larger Comment Editor Overhaul Project with Outreachy. Refer to Planning Issue #9069 for more context)

@noi5e noi5e added feature explains that the issue is to add a new feature discussion JavaScript outreachy labels Jan 13, 2021
@noi5e noi5e self-assigned this Jan 13, 2021
@jywarren
Copy link
Member

I wonder, once all system tests are in place, would an actual React component be plausible here? I don't have much experience with React, do you? I'm mainly just curious how integration would work and if it would be worth it. Curious to hear your thoughts! I like what you're planning on here, thanks!

@noi5e
Copy link
Contributor Author

noi5e commented Jan 18, 2021

@jywarren I do have an okay amount of React experience. I see that there is a Rails React gem... It's worth looking into in a deeper way, but I have a feeling it would require rewriting the entire codebase in React, like v3 of the entire site. I've never heard of, for example, using React for just the comments form on a website... Maybe this does happen, maybe it doesn't, but I'm only familiar with entire sites built with React.

I guess I have a bias towards React being a junior developer, and it being the framework I'm most familiar with. I'd be willing to pitch in my two cents further down the line if Public Lab considered switching to a new stack!

Luckily, I think the Comment Editor is small enough that we can get somewhere without using React... Like, I'm working on a PR right now that I'll link here that's doing some object-oriented refactoring of editor.js, and I think it'll improve things a lot.

Another related issue I'm discovering in my refactoring is that a lot of the scripts used with the Comment Editor, like dragdrop.js and editor.js are repurposed on other places in the site, like the legacy editor in wiki/new, wiki/edit, and I just discovered features/new as well... That's turning out to be a bigger hurdle than state management.

@noi5e noi5e changed the title Feature: Improve Comment Editor State Management Feature: Refactor Comment Editor Using OOP Jan 18, 2021
@jywarren
Copy link
Member

I believe it is possible to run just one component, and we've been interested in that as a proof of concept before trying to do the entire site... but really, that's out of scope unless you finish early and are really interested in it, so no worries!

I hear you re: reused scripts. I think it's possible to explore copying the scripts and splitting their use cases instead of trying to retain the code re-usability, if that is slowing down your work and/or refactoring progress!

noi5e added a commit to noi5e/plots2 that referenced this issue Jan 18, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 18, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 18, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 18, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
noi5e added a commit to noi5e/plots2 that referenced this issue Jan 19, 2021
cesswairimu pushed a commit that referenced this issue Jan 19, 2021
* write setState method with default parameters #9004

* set preview when calling E.setState #9004

* set preview when calling E.setState #9004

* change E.initialize to E.setState; add comment-preview class #9004

* change E.initialize({}) to E.initialize() #9004

* change regex test to match /features/new in wrap #9004

* rewrite selector for more specificity #9004

* rewrite for cognitive complexity #9004

* desperately trying to pass codeclimate #9004

* desperately trying to pass codeclimate #9004

* desperately trying to pass codeclimate #9004

* desperately trying to pass codeclimate #9004

* oops, switched ternary operator #9004
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
* delete get_textarea_id method publiclab#9004

* change #c23edit selector to #comment-form-edit-23 publiclab#9004

* assign unique IDs to comment forms publiclab#9004

* change selectors from #c1edit to #comment-form-edit-1 publiclab#9004

* change preview IDs from #preview1 to #comment-preview-1 publiclab#9004

* change main preview selector to #comment-preview-main from #preview-main publiclab#9004

* change main preview selector to #comment-preview-main from #preview-main publiclab#9004
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
* move E.initialize call to higher level views publiclab#9004

* change selectors for preview & textarea elements publiclab#9004

* change #edit-comment-btn to .edit-comment-btn publiclab#9004

* change selectors to match new edit form publiclab#9004

* update selectors for edit form publiclab#9004
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
* object-oriented refactor! publiclab#9004

* create instances of new object-oriented editor publiclab#9004

* pass codeclimate: add semicolon; comment unused methods publiclab#9004

* move editor instantiation to notes/comments partial publiclab#9004

* adding const to pass codeclimate publiclab#9004

* reformat object methods publiclab#9004

* instantiate 1 editor object each on wikis, notes, and questions publiclab#9004

* rewrite to reduce cognitive complexity publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* hopefully the last codeclimate rewrite publiclab#9004

* rewrite E.wrap's parameters to pass codeclimate publiclab#9004

* remove newlines to appease codeclimate publiclab#9004

* typo: highlighT instead of highligh publiclab#9004

* fixing typo publiclab#9004

* change const to let publiclab#9004

* assign textarea & preview to jQuery objects in constructor publiclab#9004

* change newText assignment

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

* change uri check for null publiclab#9004

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
* object-oriented refactor! publiclab#9004

create instances of new object-oriented editor publiclab#9004

pass codeclimate: add semicolon; comment unused methods publiclab#9004

move editor instantiation to notes/comments partial publiclab#9004

adding const to pass codeclimate publiclab#9004

reformat object methods publiclab#9004

instantiate 1 editor object each on wikis, notes, and questions publiclab#9004

rewrite to reduce cognitive complexity publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

hopefully the last codeclimate rewrite publiclab#9004

rewrite E.wrap's parameters to pass codeclimate publiclab#9004

remove newlines to appease codeclimate publiclab#9004

typo: highlighT instead of highligh publiclab#9004

fixing typo publiclab#9004

change const to let publiclab#9004

assign textarea & preview to jQuery objects in constructor publiclab#9004

* change main comment form ID to #text-input-main publiclab#9004

* change parameters for E.setState publiclab#9004

* delete get_toolbar_element_id helper publiclab#9004

* rewrite E.setState for 1 ID parameter publiclab#9004

* add unique ID to toggle preview button publiclab#9004

* rewrite constructor for 1 parameter; toggle preview button on unique ID publiclab#9004

* fix extra whitespace in edit comment form's textarea publiclab#9004

* update system tests with new selectors publiclab#9004

* toggle form preview on unique ID publiclab#9004
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
* merge editor refactor branches publiclab#9004

* delete refresh & isSingleFormPage methods publiclab#9004

* delete some D.selected assignments publiclab#9004

* add dropzone class to choose one input elements

* E.setState on image select upload publiclab#9004

* remove D.selected from progress bar handlers publiclab#9004

* add unique IDs to image upload progress bars publiclab#9004

* updated image upload progress bar selectors publiclab#9004

* update progress bar selector publiclab#9004

* update selectors for image upload text publiclab#9004
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
…lab#9110)

* merge editor refactor branches publiclab#9004

* remove dropzone class publiclab#9004

* add new constructor param; write getter methods; change E.method to this.method publiclab#9004

* call new E.textAreaValue getter publiclab#9004

* call new E.constructor; change imagebar IDs publiclab#9004

* change preview ID selector publiclab#9004

* delete typo from merge conflict publiclab#9004

* apply suggestions from code review

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
* merge comment editor refactor branches publiclab#9004

* add classes for small and large dropzones

* disable drag&drop on image upload button

* add data-form-ID attribute to large dropzone

* update selectors for large dropzone
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this issue Mar 2, 2021
* merge branches publiclab#9104 publiclab#9107 publiclab#9108 publiclab#9110 publiclab#9118

* change #dropzone-large ID to #comment-form-body

* add comprehensive preview button test

* add text-input class, data-form-id attribute to textarea publiclab#9004 publiclab#9131

* add data-form-id to save & recover buttons publiclab#9004 publiclab#9131

* E.setState when clicking save, recover, & .text-input publiclab#9004 publiclab#9131

* refactor save & recover publiclab#9004 publiclab#9131

* add icon to recover button publiclab#9004 publiclab#9131

* restore edit button tooltip publiclab#9004 publiclab#9131

* save with window.location.pathname, not href publiclab#9004 publiclab#9131

* new system test for save & recover publiclab#9004 publiclab#9131

* update test selector publiclab#9004 publiclab#9131
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* write setState method with default parameters publiclab#9004

* set preview when calling E.setState publiclab#9004

* set preview when calling E.setState publiclab#9004

* change E.initialize to E.setState; add comment-preview class publiclab#9004

* change E.initialize({}) to E.initialize() publiclab#9004

* change regex test to match /features/new in wrap publiclab#9004

* rewrite selector for more specificity publiclab#9004

* rewrite for cognitive complexity publiclab#9004

* desperately trying to pass codeclimate publiclab#9004

* desperately trying to pass codeclimate publiclab#9004

* desperately trying to pass codeclimate publiclab#9004

* desperately trying to pass codeclimate publiclab#9004

* oops, switched ternary operator publiclab#9004
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
…b#9037)

* move comment.js & dragdrop.js to higher-level views publiclab#9004

* attach eventListeners on document.load publiclab#9004

* move dragdrop.js & comment.js to notes/comments partial publiclab#9004
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* remove editorHelper publiclab#9004

* deleted editorHelper & moved function to editorToolbar publiclab#9004

* moved rich-text eventListener to editorToolbar.js publiclab#9004

* rename dragdrop.js to editorToolbar.js
publiclab#9004

* rename dragdrop.js to editorToolbar.js

* rename dragdrop.js to editorToolbar.js
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* delete get_textarea_id method publiclab#9004

* change #c23edit selector to #comment-form-edit-23 publiclab#9004

* assign unique IDs to comment forms publiclab#9004

* change selectors from #c1edit to #comment-form-edit-1 publiclab#9004

* change preview IDs from #preview1 to #comment-preview-1 publiclab#9004

* change main preview selector to #comment-preview-main from #preview-main publiclab#9004

* change main preview selector to #comment-preview-main from #preview-main publiclab#9004
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* move E.initialize call to higher level views publiclab#9004

* change selectors for preview & textarea elements publiclab#9004

* change #edit-comment-btn to .edit-comment-btn publiclab#9004

* change selectors to match new edit form publiclab#9004

* update selectors for edit form publiclab#9004
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* object-oriented refactor! publiclab#9004

* create instances of new object-oriented editor publiclab#9004

* pass codeclimate: add semicolon; comment unused methods publiclab#9004

* move editor instantiation to notes/comments partial publiclab#9004

* adding const to pass codeclimate publiclab#9004

* reformat object methods publiclab#9004

* instantiate 1 editor object each on wikis, notes, and questions publiclab#9004

* rewrite to reduce cognitive complexity publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* hopefully the last codeclimate rewrite publiclab#9004

* rewrite E.wrap's parameters to pass codeclimate publiclab#9004

* remove newlines to appease codeclimate publiclab#9004

* typo: highlighT instead of highligh publiclab#9004

* fixing typo publiclab#9004

* change const to let publiclab#9004

* assign textarea & preview to jQuery objects in constructor publiclab#9004

* change newText assignment

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

* change uri check for null publiclab#9004

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* object-oriented refactor! publiclab#9004

create instances of new object-oriented editor publiclab#9004

pass codeclimate: add semicolon; comment unused methods publiclab#9004

move editor instantiation to notes/comments partial publiclab#9004

adding const to pass codeclimate publiclab#9004

reformat object methods publiclab#9004

instantiate 1 editor object each on wikis, notes, and questions publiclab#9004

rewrite to reduce cognitive complexity publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

hopefully the last codeclimate rewrite publiclab#9004

rewrite E.wrap's parameters to pass codeclimate publiclab#9004

remove newlines to appease codeclimate publiclab#9004

typo: highlighT instead of highligh publiclab#9004

fixing typo publiclab#9004

change const to let publiclab#9004

assign textarea & preview to jQuery objects in constructor publiclab#9004

* change main comment form ID to #text-input-main publiclab#9004

* change parameters for E.setState publiclab#9004

* delete get_toolbar_element_id helper publiclab#9004

* rewrite E.setState for 1 ID parameter publiclab#9004

* add unique ID to toggle preview button publiclab#9004

* rewrite constructor for 1 parameter; toggle preview button on unique ID publiclab#9004

* fix extra whitespace in edit comment form's textarea publiclab#9004

* update system tests with new selectors publiclab#9004

* toggle form preview on unique ID publiclab#9004
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* merge editor refactor branches publiclab#9004

* delete refresh & isSingleFormPage methods publiclab#9004

* delete some D.selected assignments publiclab#9004

* add dropzone class to choose one input elements

* E.setState on image select upload publiclab#9004

* remove D.selected from progress bar handlers publiclab#9004

* add unique IDs to image upload progress bars publiclab#9004

* updated image upload progress bar selectors publiclab#9004

* update progress bar selector publiclab#9004

* update selectors for image upload text publiclab#9004
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
…lab#9110)

* merge editor refactor branches publiclab#9004

* remove dropzone class publiclab#9004

* add new constructor param; write getter methods; change E.method to this.method publiclab#9004

* call new E.textAreaValue getter publiclab#9004

* call new E.constructor; change imagebar IDs publiclab#9004

* change preview ID selector publiclab#9004

* delete typo from merge conflict publiclab#9004

* apply suggestions from code review

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* merge comment editor refactor branches publiclab#9004

* add classes for small and large dropzones

* disable drag&drop on image upload button

* add data-form-ID attribute to large dropzone

* update selectors for large dropzone
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this issue Oct 16, 2021
* merge branches publiclab#9104 publiclab#9107 publiclab#9108 publiclab#9110 publiclab#9118

* change #dropzone-large ID to #comment-form-body

* add comprehensive preview button test

* add text-input class, data-form-id attribute to textarea publiclab#9004 publiclab#9131

* add data-form-id to save & recover buttons publiclab#9004 publiclab#9131

* E.setState when clicking save, recover, & .text-input publiclab#9004 publiclab#9131

* refactor save & recover publiclab#9004 publiclab#9131

* add icon to recover button publiclab#9004 publiclab#9131

* restore edit button tooltip publiclab#9004 publiclab#9131

* save with window.location.pathname, not href publiclab#9004 publiclab#9131

* new system test for save & recover publiclab#9004 publiclab#9131

* update test selector publiclab#9004 publiclab#9131
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* write setState method with default parameters publiclab#9004

* set preview when calling E.setState publiclab#9004

* set preview when calling E.setState publiclab#9004

* change E.initialize to E.setState; add comment-preview class publiclab#9004

* change E.initialize({}) to E.initialize() publiclab#9004

* change regex test to match /features/new in wrap publiclab#9004

* rewrite selector for more specificity publiclab#9004

* rewrite for cognitive complexity publiclab#9004

* desperately trying to pass codeclimate publiclab#9004

* desperately trying to pass codeclimate publiclab#9004

* desperately trying to pass codeclimate publiclab#9004

* desperately trying to pass codeclimate publiclab#9004

* oops, switched ternary operator publiclab#9004
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
…b#9037)

* move comment.js & dragdrop.js to higher-level views publiclab#9004

* attach eventListeners on document.load publiclab#9004

* move dragdrop.js & comment.js to notes/comments partial publiclab#9004
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* remove editorHelper publiclab#9004

* deleted editorHelper & moved function to editorToolbar publiclab#9004

* moved rich-text eventListener to editorToolbar.js publiclab#9004

* rename dragdrop.js to editorToolbar.js
publiclab#9004

* rename dragdrop.js to editorToolbar.js

* rename dragdrop.js to editorToolbar.js
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* delete get_textarea_id method publiclab#9004

* change #c23edit selector to #comment-form-edit-23 publiclab#9004

* assign unique IDs to comment forms publiclab#9004

* change selectors from #c1edit to #comment-form-edit-1 publiclab#9004

* change preview IDs from #preview1 to #comment-preview-1 publiclab#9004

* change main preview selector to #comment-preview-main from #preview-main publiclab#9004

* change main preview selector to #comment-preview-main from #preview-main publiclab#9004
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* move E.initialize call to higher level views publiclab#9004

* change selectors for preview & textarea elements publiclab#9004

* change #edit-comment-btn to .edit-comment-btn publiclab#9004

* change selectors to match new edit form publiclab#9004

* update selectors for edit form publiclab#9004
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* object-oriented refactor! publiclab#9004

* create instances of new object-oriented editor publiclab#9004

* pass codeclimate: add semicolon; comment unused methods publiclab#9004

* move editor instantiation to notes/comments partial publiclab#9004

* adding const to pass codeclimate publiclab#9004

* reformat object methods publiclab#9004

* instantiate 1 editor object each on wikis, notes, and questions publiclab#9004

* rewrite to reduce cognitive complexity publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* trying to pass codeclimate publiclab#9004

* hopefully the last codeclimate rewrite publiclab#9004

* rewrite E.wrap's parameters to pass codeclimate publiclab#9004

* remove newlines to appease codeclimate publiclab#9004

* typo: highlighT instead of highligh publiclab#9004

* fixing typo publiclab#9004

* change const to let publiclab#9004

* assign textarea & preview to jQuery objects in constructor publiclab#9004

* change newText assignment

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

* change uri check for null publiclab#9004

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* object-oriented refactor! publiclab#9004

create instances of new object-oriented editor publiclab#9004

pass codeclimate: add semicolon; comment unused methods publiclab#9004

move editor instantiation to notes/comments partial publiclab#9004

adding const to pass codeclimate publiclab#9004

reformat object methods publiclab#9004

instantiate 1 editor object each on wikis, notes, and questions publiclab#9004

rewrite to reduce cognitive complexity publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

trying to pass codeclimate publiclab#9004

hopefully the last codeclimate rewrite publiclab#9004

rewrite E.wrap's parameters to pass codeclimate publiclab#9004

remove newlines to appease codeclimate publiclab#9004

typo: highlighT instead of highligh publiclab#9004

fixing typo publiclab#9004

change const to let publiclab#9004

assign textarea & preview to jQuery objects in constructor publiclab#9004

* change main comment form ID to #text-input-main publiclab#9004

* change parameters for E.setState publiclab#9004

* delete get_toolbar_element_id helper publiclab#9004

* rewrite E.setState for 1 ID parameter publiclab#9004

* add unique ID to toggle preview button publiclab#9004

* rewrite constructor for 1 parameter; toggle preview button on unique ID publiclab#9004

* fix extra whitespace in edit comment form's textarea publiclab#9004

* update system tests with new selectors publiclab#9004

* toggle form preview on unique ID publiclab#9004
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* merge editor refactor branches publiclab#9004

* delete refresh & isSingleFormPage methods publiclab#9004

* delete some D.selected assignments publiclab#9004

* add dropzone class to choose one input elements

* E.setState on image select upload publiclab#9004

* remove D.selected from progress bar handlers publiclab#9004

* add unique IDs to image upload progress bars publiclab#9004

* updated image upload progress bar selectors publiclab#9004

* update progress bar selector publiclab#9004

* update selectors for image upload text publiclab#9004
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
…lab#9110)

* merge editor refactor branches publiclab#9004

* remove dropzone class publiclab#9004

* add new constructor param; write getter methods; change E.method to this.method publiclab#9004

* call new E.textAreaValue getter publiclab#9004

* call new E.constructor; change imagebar IDs publiclab#9004

* change preview ID selector publiclab#9004

* delete typo from merge conflict publiclab#9004

* apply suggestions from code review

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>

Co-authored-by: Sagarpreet <53554917+Sagarpreet@users.noreply.github.com>
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* merge comment editor refactor branches publiclab#9004

* add classes for small and large dropzones

* disable drag&drop on image upload button

* add data-form-ID attribute to large dropzone

* update selectors for large dropzone
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this issue Dec 28, 2021
* merge branches publiclab#9104 publiclab#9107 publiclab#9108 publiclab#9110 publiclab#9118

* change #dropzone-large ID to #comment-form-body

* add comprehensive preview button test

* add text-input class, data-form-id attribute to textarea publiclab#9004 publiclab#9131

* add data-form-id to save & recover buttons publiclab#9004 publiclab#9131

* E.setState when clicking save, recover, & .text-input publiclab#9004 publiclab#9131

* refactor save & recover publiclab#9004 publiclab#9131

* add icon to recover button publiclab#9004 publiclab#9131

* restore edit button tooltip publiclab#9004 publiclab#9131

* save with window.location.pathname, not href publiclab#9004 publiclab#9131

* new system test for save & recover publiclab#9004 publiclab#9131

* update test selector publiclab#9004 publiclab#9131
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion feature explains that the issue is to add a new feature JavaScript outreachy
Projects
None yet
Development

No branches or pull requests

2 participants