mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-22 01:44:24 +01:00
Compare commits
19 commits
abc4a9d673
...
786fa38be0
Author | SHA1 | Date | |
---|---|---|---|
786fa38be0 | |||
24037176f4 | |||
3d9884865e | |||
59e0334ecf | |||
e100f1d40e | |||
de7d50cd54 | |||
015266b2eb | |||
3b1fb3b0b7 | |||
72bb32ca7a | |||
ebcf17d792 | |||
2caa110c1c | |||
c8487d63a5 | |||
b803631c66 | |||
fc69541e4f | |||
863c8b08f5 | |||
5ab246dccc | |||
03d55f0a7e | |||
b8433d9439 | |||
5105146207 |
|
@ -2622,9 +2622,9 @@ diff.browse_source = Browse source
|
|||
diff.parent = parent
|
||||
diff.commit = commit
|
||||
diff.git-notes = Notes
|
||||
diff.git-notes.add = Add note
|
||||
diff.git-notes.remove-header = Remove note
|
||||
diff.git-notes.remove-body = This note will be removed.
|
||||
diff.git-notes.add = Add Note
|
||||
diff.git-notes.remove-header = Remove Note
|
||||
diff.git-notes.remove-body = This will remove this Note
|
||||
diff.data_not_available = Diff content is not available
|
||||
diff.options_button = Diff options
|
||||
diff.show_diff_stats = Show stats
|
||||
|
|
15
package-lock.json
generated
15
package-lock.json
generated
|
@ -18,7 +18,7 @@
|
|||
"asciinema-player": "3.8.0",
|
||||
"chart.js": "4.4.5",
|
||||
"chartjs-adapter-dayjs-4": "1.0.4",
|
||||
"chartjs-plugin-zoom": "2.1.0",
|
||||
"chartjs-plugin-zoom": "2.0.1",
|
||||
"clippie": "4.1.1",
|
||||
"css-loader": "7.0.0",
|
||||
"dayjs": "1.11.12",
|
||||
|
@ -4807,12 +4807,6 @@
|
|||
"integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/hammerjs": {
|
||||
"version": "2.0.46",
|
||||
"resolved": "https://registry.npmjs.org/@types/hammerjs/-/hammerjs-2.0.46.tgz",
|
||||
"integrity": "sha512-ynRvcq6wvqexJ9brDMS4BnBLzmr0e14d6ZJTEShTBWKymQiHwlAyGu0ZPEFI2Fh1U53F7tN9ufClWM5KvqkKOw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
||||
|
@ -6485,12 +6479,11 @@
|
|||
}
|
||||
},
|
||||
"node_modules/chartjs-plugin-zoom": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/chartjs-plugin-zoom/-/chartjs-plugin-zoom-2.1.0.tgz",
|
||||
"integrity": "sha512-7lMimfQCUaIJLhPJaWSAA4gw+1m8lyR3Wn+M3MxjHbM/XxRUnOxN7cM5RR9jUmxmyW0h7L2hZ8KhvUsqrFxy/Q==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/chartjs-plugin-zoom/-/chartjs-plugin-zoom-2.0.1.tgz",
|
||||
"integrity": "sha512-ogOmLu6e+Q7E1XWOCOz9YwybMslz9qNfGV2a+qjfmqJYpsw5ZMoRHZBUyW+NGhkpQ5PwwPA/+rikHpBZb7PZuA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/hammerjs": "^2.0.45",
|
||||
"hammerjs": "^2.0.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"asciinema-player": "3.8.0",
|
||||
"chart.js": "4.4.5",
|
||||
"chartjs-adapter-dayjs-4": "1.0.4",
|
||||
"chartjs-plugin-zoom": "2.1.0",
|
||||
"chartjs-plugin-zoom": "2.0.1",
|
||||
"clippie": "4.1.1",
|
||||
"css-loader": "7.0.0",
|
||||
"dayjs": "1.11.12",
|
||||
|
|
|
@ -7,7 +7,6 @@ label_bug=bug
|
|||
label_feature=feature
|
||||
label_ui=forgejo/ui
|
||||
label_breaking=breaking
|
||||
label_security=security
|
||||
label_localization=forgejo/i18n
|
||||
|
||||
payload=$(mktemp)
|
||||
|
@ -18,71 +17,50 @@ function test_main() {
|
|||
set -ex
|
||||
PS4='${BASH_SOURCE[0]}:$LINENO: ${FUNCNAME[0]}: '
|
||||
|
||||
test_payload_labels $label_worth $label_breaking $label_security $label_bug
|
||||
test "$(categorize)" = 'AA Breaking security bug fixes'
|
||||
|
||||
test_payload_labels $label_worth $label_security $label_bug
|
||||
test "$(categorize)" = 'AB Security bug fixes'
|
||||
|
||||
test_payload_labels $label_worth $label_breaking $label_security $label_feature
|
||||
test "$(categorize)" = 'AC Breaking security features'
|
||||
|
||||
test_payload_labels $label_worth $label_security $label_feature
|
||||
test "$(categorize)" = 'AD Security features'
|
||||
|
||||
test_payload_labels $label_worth $label_security
|
||||
test "$(categorize)" = 'ZA Security changes without a feature or bug label'
|
||||
|
||||
test_payload_labels $label_worth $label_breaking $label_feature
|
||||
test "$(categorize)" = 'BA Breaking features'
|
||||
test "$(categorize)" = 'AA Breaking features'
|
||||
|
||||
test_payload_labels $label_worth $label_breaking $label_bug
|
||||
test "$(categorize)" = 'BB Breaking bug fixes'
|
||||
test "$(categorize)" = 'AB Breaking bug fixes'
|
||||
|
||||
test_payload_labels $label_worth $label_breaking
|
||||
test "$(categorize)" = 'ZB Breaking changes without a feature or bug label'
|
||||
test "$(categorize)" = 'ZC Breaking changes without a feature or bug label'
|
||||
|
||||
test_payload_labels $label_worth $label_ui $label_feature
|
||||
test "$(categorize)" = 'CA User Interface features'
|
||||
test "$(categorize)" = 'BA User Interface features'
|
||||
|
||||
test_payload_labels $label_worth $label_ui $label_bug
|
||||
test "$(categorize)" = 'CB User Interface bug fixes'
|
||||
test "$(categorize)" = 'BB User Interface bug fixes'
|
||||
|
||||
test_payload_labels $label_worth $label_ui
|
||||
test "$(categorize)" = 'ZC User Interface changes without a feature or bug label'
|
||||
test "$(categorize)" = 'ZD User Interface changes without a feature or bug label'
|
||||
|
||||
test_payload_labels $label_worth $label_feature
|
||||
test "$(categorize)" = 'CA Features'
|
||||
|
||||
test_payload_labels $label_worth $label_bug
|
||||
test "$(categorize)" = 'CB Bug fixes'
|
||||
|
||||
test_payload_labels $label_worth $label_localization
|
||||
test "$(categorize)" = 'DA Localization'
|
||||
|
||||
test_payload_labels $label_worth $label_feature
|
||||
test "$(categorize)" = 'EA Features'
|
||||
|
||||
test_payload_labels $label_worth $label_bug
|
||||
test "$(categorize)" = 'EB Bug fixes'
|
||||
|
||||
test_payload_labels $label_worth
|
||||
test "$(categorize)" = 'ZE Other changes without a feature or bug label'
|
||||
|
||||
test_payload_labels
|
||||
test "$(categorize)" = 'ZF Included for completeness but not worth a release note'
|
||||
|
||||
test_payload_draft "fix(security)!: breaking security bug fix"
|
||||
test "$(categorize)" = 'AA Breaking security bug fixes'
|
||||
|
||||
test_payload_draft "fix(security): security bug fix"
|
||||
test "$(categorize)" = 'AB Security bug fixes'
|
||||
|
||||
test_payload_draft "feat!: breaking feature"
|
||||
test "$(categorize)" = 'BA Breaking features'
|
||||
test "$(categorize)" = 'AA Breaking features'
|
||||
|
||||
test_payload_draft "fix!: breaking bug fix"
|
||||
test "$(categorize)" = 'BB Breaking bug fixes'
|
||||
test "$(categorize)" = 'AB Breaking bug fixes'
|
||||
|
||||
test_payload_draft "feat: feature"
|
||||
test "$(categorize)" = 'EA Features'
|
||||
test "$(categorize)" = 'CA Features'
|
||||
|
||||
test_payload_draft "fix: bug fix"
|
||||
test "$(categorize)" = 'EB Bug fixes'
|
||||
test "$(categorize)" = 'CB Bug fixes'
|
||||
|
||||
test_payload_draft "something with no prefix"
|
||||
test "$(categorize)" = 'ZE Other changes without a feature or bug label'
|
||||
|
@ -131,7 +109,6 @@ function categorize() {
|
|||
is_feature=false
|
||||
is_localization=false
|
||||
is_breaking=false
|
||||
is_security=false
|
||||
|
||||
#
|
||||
# first try to figure out the category from the labels
|
||||
|
@ -148,12 +125,6 @@ function categorize() {
|
|||
;;
|
||||
esac
|
||||
|
||||
case "$labels" in
|
||||
*$label_security*)
|
||||
is_security=true
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$labels" in
|
||||
*$label_breaking*)
|
||||
is_breaking=true
|
||||
|
@ -172,15 +143,6 @@ function categorize() {
|
|||
if ! $is_bug && ! $is_feature; then
|
||||
draft="$(jq --raw-output .Draft <$payload)"
|
||||
case "$draft" in
|
||||
fix\(security\)!:*)
|
||||
is_bug=true
|
||||
is_breaking=true
|
||||
is_security=true
|
||||
;;
|
||||
fix\(security\):*)
|
||||
is_bug=true
|
||||
is_security=true
|
||||
;;
|
||||
fix!:*)
|
||||
is_bug=true
|
||||
is_breaking=true
|
||||
|
@ -209,45 +171,29 @@ function categorize() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if $is_security; then
|
||||
if $is_bug; then
|
||||
if $is_breaking; then
|
||||
echo -n AA Breaking security bug fixes
|
||||
else
|
||||
echo -n AB Security bug fixes
|
||||
fi
|
||||
elif $is_feature; then
|
||||
if $is_breaking; then
|
||||
echo -n AC Breaking security features
|
||||
else
|
||||
echo -n AD Security features
|
||||
fi
|
||||
else
|
||||
echo -n ZA Security changes without a feature or bug label
|
||||
fi
|
||||
elif $is_breaking; then
|
||||
if $is_breaking; then
|
||||
if $is_feature; then
|
||||
echo -n BA Breaking features
|
||||
echo -n AA Breaking features
|
||||
elif $is_bug; then
|
||||
echo -n BB Breaking bug fixes
|
||||
echo -n AB Breaking bug fixes
|
||||
else
|
||||
echo -n ZB Breaking changes without a feature or bug label
|
||||
echo -n ZC Breaking changes without a feature or bug label
|
||||
fi
|
||||
elif $is_ui; then
|
||||
if $is_feature; then
|
||||
echo -n CA User Interface features
|
||||
echo -n BA User Interface features
|
||||
elif $is_bug; then
|
||||
echo -n CB User Interface bug fixes
|
||||
echo -n BB User Interface bug fixes
|
||||
else
|
||||
echo -n ZC User Interface changes without a feature or bug label
|
||||
echo -n ZD User Interface changes without a feature or bug label
|
||||
fi
|
||||
elif $is_localization; then
|
||||
echo -n DA Localization
|
||||
else
|
||||
if $is_feature; then
|
||||
echo -n EA Features
|
||||
echo -n CA Features
|
||||
elif $is_bug; then
|
||||
echo -n EB Bug fixes
|
||||
echo -n CB Bug fixes
|
||||
else
|
||||
echo -n ZE Other changes without a feature or bug label
|
||||
fi
|
||||
|
|
|
@ -128,9 +128,6 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="commit-notes-add-button" class="item">
|
||||
{{ctx.Locale.Tr "repo.diff.git-notes.add"}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
@ -280,20 +277,20 @@
|
|||
<span class="text grey" id="note-authored-time">{{DateUtils.TimeSince .NoteCommit.Author.When}}</span>
|
||||
{{if or ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}
|
||||
<div class="ui right">
|
||||
<button id="commit-notes-edit-button" class="ui tiny primary button" data-modal="#delete-note-modal">{{ctx.Locale.Tr "edit"}}</button>
|
||||
<button id="commit-notes-edit-button" class="ui tiny button yellow" data-modal="#delete-note-modal">{{ctx.Locale.Tr "edit"}}</button>
|
||||
<button class="ui tiny button red show-modal" data-modal="#delete-note-modal">{{ctx.Locale.Tr "remove"}}</button>
|
||||
</div>
|
||||
<div class="ui small modal" id="delete-note-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "repo.diff.git-notes.remove-header"}}
|
||||
</div>
|
||||
<p>{{ctx.Locale.Tr "repo.diff.git-notes.remove-body"}}</p>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "repo.diff.git-notes.remove-body"}}</p>
|
||||
<div class="text right actions">
|
||||
<form action="{{.Link}}/notes/remove" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
<button type="button" class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</button>
|
||||
<button type="submit" class="ui red button" href="{{.Link}}/notes/remove">{{ctx.Locale.Tr "remove"}}</button>
|
||||
<button type="submit" class="ui primary button red" href="{{.Link}}/notes/remove">{{ctx.Locale.Tr "remove"}}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -319,6 +316,7 @@
|
|||
</div>
|
||||
{{end}}
|
||||
{{else if and ($.Permission.CanWrite $.UnitTypeCode) (not $.Repository.IsArchived) (not .IsDeleted)}}
|
||||
<button id="commit-notes-add-button" class="ui primary button green tw-mt-3">{{ctx.Locale.Tr "repo.diff.git-notes.add"}}</button>
|
||||
<div id="commit-notes-add-area" class="ui tw-mt-3 segment tw-hidden">
|
||||
<form class="ui form" action="{{.Link}}/notes" method="post">
|
||||
{{.CsrfTokenHtml}}
|
||||
|
|
|
@ -38,6 +38,7 @@ export function initCommitNotes() {
|
|||
const notesAddButton = document.getElementById('commit-notes-add-button');
|
||||
if (notesAddButton !== null) {
|
||||
notesAddButton.addEventListener('click', () => {
|
||||
notesAddButton.classList.add('tw-hidden');
|
||||
document.getElementById('commit-notes-add-area').classList.remove('tw-hidden');
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue