Open MayamaTakeshi opened 1 year ago
Actually, the error 2 was happening only in case
Display comments "in reverse chronological order"
was used. Using "in chronological order" there was no error. The problem remains as this requires the javascript code to know the order and get/insert the journal in the correct order. But I found another error that is in case we try to dynamically modify the details of an issue that doesn't have any history entries yet, the javascript code will crash and further changes will not be possible. So for this, I just added code to prevent the crash. So the notes/history will not be updated but dynamic update will continue to be possible.
UPDATE: I have added code to support comments in reverse order.
Hi, I am check your solution. I installed clear Kubuntu 22.10 system on the virtual machine, ruby - standard, obtained via apt-get install ruby ruby-dev, database - postgres, downloaded redmine 5.0.5, cloned issue_dynamics_edit to the plugins folder, start redmine in production environment and on the webrick. Indeed, I did not pay attention earlier, but from the start this plugin does not work - an error occurs on a virtual machine in the yandex browser (crome like):
Uncaught TypeError: Cannot read properties of null (reading 'appendChild')
at request.onreadystatechange
Ok, try to install nodejs and npm via apt-get.
After restarting Redmine, the error went away and the plugin worked, but after I added a comment, some problems really appeared:
It's really strange - I was sure that this error occurs due to conflicts with other plugins, and by itself it will work.
The firefox browser is friendlier - at least it wrote the following error (although there was already another error there):
<Provider> does not support changing
storeon the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for the migration instructions.
... But everything suddenly worked, it was only necessary to execute the command RAILS_ENV=production bundle exec rake redmine:plugins:assets
Ok, let's try to install your version.
All work correctly, even some old errors were fixed when updating the task, but one small detail remained: when updating the task, a comment is added to the currently open history tab (notes), although it should not be added there - it should be added to the History and State Change tabs:
Well, and besides, the "Update" button adds a new record about updating the task, although it should not (a record about changing the title appeared 3 times)
The incorrect entry disappears if you start switching between tabs.
Also, when adding journal for issue details changes, if the current tab is tab-notes, the journal should be added but not be made visible. I have added another commit to resolve this.
Regarding the problem of absent history, I have added code to create it if necessary.
So to summarize what this PR contemplates:
1) javascript code will crash and dynamic update will stop working if url contains querystring or hashmarks like http://192.168.225.201:3000/issues/38?tab=properties http://192.168.225.201:3000/issues/38#note-3 SOLVED 2) javascript code crashes and dynamic update will stop working if user is configured with "Display comments in reverse chronological order" SOLVED 3) when adding journals in history, the javascript code doesn't check which is the tab currently enabled. For example, if it is tab-notes, a dynamic change of issue properties should add the journal but not make the entry visible. SOLVED 4) if there is no history entries yet, javascript code will crash and dynamic update will stop working SOLVED: will create appropriate div history if absent
Hi, while testing redmine_issue_dynamic_edit with latest redmine:
wiithout any other plugins installed I verified that if the tab location contains querystrings (or hashmark) like:
the plugin javascript code will crash with this:
This is happening because the code will try to do a fetch for:
So I added code to clean up the LOCATION_HREF at the beginning of the script.
Also, no matter if the LOCATION_HREF is clean or not, when handling the response from the server, the code will crash at another spot:
I added code to solve this too.