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

Changing labels while editing issue kills your changes. #8342

Closed
1 of 3 tasks
Jaffex opened this issue Oct 1, 2019 · 7 comments
Closed
1 of 3 tasks

Changing labels while editing issue kills your changes. #8342

Jaffex opened this issue Oct 1, 2019 · 7 comments
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI type/bug

Comments

@Jaffex
Copy link

Jaffex commented Oct 1, 2019

Description

If you change the labels of an issue while you're editing its text, your changes will disappear after closing the label-selection dialogue.

Screenshots

example

@lunny lunny added type/enhancement An improvement of existing functionality topic/ui Change the appearance of the Gitea UI labels Oct 2, 2019
@bagasme
Copy link
Contributor

bagasme commented Oct 2, 2019

Please give more details (Git version on your server, your OS, etc).

@lunny shouldn't this issue a bug?

@Jaffex
Copy link
Author

Jaffex commented Oct 7, 2019

On my own server, here's the specs:

  • Gitea version (or commit ref): 1.9.0
  • Git version: 2.7.4
  • Operating system: Ubuntu 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite

@lunny lunny added type/bug and removed type/enhancement An improvement of existing functionality labels Oct 7, 2019
@blueworrybear
Copy link
Contributor

Hi, it seems to me that the issue is caused by function initListSubmits(selector, outerSelector).

As codes below show, the web page is forced to reload each time the dropdown menu hide. I think it's because assignee and milestone are render in server side. To update those information, the original codes force to reload the whole page.

$('.' + selector).dropdown('setting', 'onHide', function(){
    hasLabelUpdateAction = $listMenu.data('action') == 'update'; // Update the var
    if (hasLabelUpdateAction) {
        const promises = [];
        Object.keys(labels).forEach(function(elementId) {
            const label = labels[elementId];
            const promise = updateIssuesMeta(
                label["update-url"],
                label["action"],
                label["issue-id"],
                elementId
            );
            promises.push(promise);
        });
        Promise.all(promises).then(reload);
    }
});

Since all labels are loaded to web page by default and could be shown/hided with JavaScript, it's not necessary to reload. Therefore there maybe two options to fix this issue:

  1. Prevent reloading if selector equals to select-label

    Although this could quickly fix the issue for updating labels, updating milestone and assignee would still kill editing content.

  2. Move some server-side render content to front-end. (This may take more effort to do so 😅 )

Please let me know what you guys think. I could try to fix this issue. 😄

@stale
Copy link

stale bot commented Dec 11, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Dec 11, 2019
@lunny lunny added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Dec 12, 2019
@stale stale bot removed the issue/stale label Dec 12, 2019
@brupelo
Copy link

brupelo commented Apr 7, 2020

Related issue: #11004

@jolheiser
Copy link
Member

This should be partially fixed by #23014 in that a confirmation dialog comes up before a reload. Just mentioning here to aid tracking.

@lunny
Copy link
Member

lunny commented Apr 26, 2023

This should be resolved by #23876

@lunny lunny closed this as completed Apr 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented topic/ui Change the appearance of the Gitea UI type/bug
Projects
None yet
Development

No branches or pull requests

6 participants