Improve issue history dialog and make poster can delete their own history (#27323)

Fix #27313 (see the comment)

And some UI improvements:

### Before


![image](420a314d-8f34-4e30-a557-f41cf4f0d2f2)


![image](60ca0be4-b55e-4e65-be73-fd53e0d4fc36)


### After


![image](d354f815-5a0c-4e63-8d59-d03ed344dbea)


![image](6ef437a4-aa6f-4917-a260-00625ee71e79)


![image](9d88a36c-616b-4dc9-8c6b-76adaad8acf6)
This commit is contained in:
wxiaoguang 2023-09-28 16:43:20 +08:00 committed by GitHub
parent 7ea2a910ce
commit 72c68177ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 9 deletions

View file

@ -3,13 +3,18 @@
width: fit-content;
}
.ui.modal.g-modal-confirm > .inside.close {
.ui.modal.g-modal-confirm > .inside.close.icon {
padding: 0;
width: 1em;
height: 1em;
top: 1.2em;
}
.ui.modal > .close.icon[height="16"] {
top: 0.7em; /* fomantic uses absolute layout, so if we have special icon size, it needs this trick to align vertically */
color: var(--color-text-dark);
}
.ui.modal > .header {
/* can't use display:flex, because some headers have space-separated elements, eg: delete branch modal */
color: var(--color-text-dark);

View file

@ -2578,12 +2578,14 @@ tbody.commit-list {
.comment-diff-data {
background: var(--color-code-bg);
min-height: 12em;
max-height: calc(100vh - 10.5rem);
overflow-y: auto;
}
.comment-diff-data pre {
line-height: 18px;
margin: 1em;
white-space: pre-wrap;
word-break: break-all;
overflow-wrap: break-word;

View file

@ -17,14 +17,15 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH
${svg('octicon-x', 16, 'close icon inside')}
<div class="header gt-df gt-ac gt-sb">
<div>${itemTitleHtml}</div>
<div class="ui dropdown dialog-header-options gt-df gt-ac gt-mr-5 gt-hidden">
${i18nTextOptions}${svg('octicon-triangle-down', 14, 'dropdown icon')}
<div class="ui dropdown dialog-header-options gt-mr-5 gt-hidden">
${i18nTextOptions}
${svg('octicon-triangle-down', 14, 'dropdown icon')}
<div class="menu">
<div class="item red text" data-option-item="delete">${i18nTextDeleteFromHistory}</div>
</div>
</div>
</div>
<div class="comment-diff-data gt-text-left gt-p-3 is-loading"></div>
<div class="comment-diff-data is-loading"></div>
</div>`);
$dialog.appendTo($('body'));
$dialog.find('.dialog-header-options').dropdown({