mirror of
https://github.com/go-gitea/gitea
synced 2024-11-24 19:03:09 +01:00
toasty error messages
This commit is contained in:
parent
63ccf82237
commit
ffff47d635
2 changed files with 4 additions and 2 deletions
|
@ -39,7 +39,7 @@
|
||||||
<div class="ui attached segment">
|
<div class="ui attached segment">
|
||||||
<div class="flex-list" id="protected-branches-list" data-update-priority-url="{{$.Repository.Link}}/settings/branches/priority">
|
<div class="flex-list" id="protected-branches-list" data-update-priority-url="{{$.Repository.Link}}/settings/branches/priority">
|
||||||
{{range .ProtectedBranches}}
|
{{range .ProtectedBranches}}
|
||||||
<div class="item" data-id="{{.ID}}">
|
<div data-id="{{.ID}}">
|
||||||
<div class="flex-item tw-items-center">
|
<div class="flex-item tw-items-center">
|
||||||
<div class="drag-handle tw-cursor-grab">
|
<div class="drag-handle tw-cursor-grab">
|
||||||
{{svg "octicon-grabber" 16}}
|
{{svg "octicon-grabber" 16}}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {createSortable} from '../modules/sortable.ts';
|
import {createSortable} from '../modules/sortable.ts';
|
||||||
import {POST} from '../modules/fetch.ts';
|
import {POST} from '../modules/fetch.ts';
|
||||||
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
|
|
||||||
export function initRepoBranchesSettings() {
|
export function initRepoBranchesSettings() {
|
||||||
const protectedBranchesList = document.querySelector('#protected-branches-list');
|
const protectedBranchesList = document.querySelector('#protected-branches-list');
|
||||||
|
@ -21,7 +22,8 @@ export function initRepoBranchesSettings() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to update branch protection rule priority:', err);
|
const errorMessage = String(err);
|
||||||
|
showErrorToast(`Failed to update branch protection rule priority:, error: ${errorMessage}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue