mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:15:43 +01:00
83d2b3b7fa
UX/Translation changes: - new teams: remove redundant tooltips that don't add meaningful information - move general information to table fieldset - new teams: rename "general" to "custom" access for clarity - new teams: show labels beside options on mobile Accessibility: - semantic form elements allow easier navigation (fieldset, mostly) - improve better labelling of new teams table - fix accessibility scan issues - TODO: the parts that "disable" form elements were not yet touched and are not really accessible to screenreaders Technical: - replace two JavaScript solutions with one CSS standard - implement a simpler grid (.simple-grid) - simplify markup - remove some webhook settings specific CSS Testing: - check more form content for accessibility issues - but exclude tooltips from the scan :( - reuse existing form tests from previous PR
26 lines
683 B
JavaScript
26 lines
683 B
JavaScript
import $ from 'jquery';
|
|
|
|
const {appSubUrl} = window.config;
|
|
|
|
export function initOrgTeamSearchRepoBox() {
|
|
const $searchRepoBox = $('#search-repo-box');
|
|
$searchRepoBox.search({
|
|
minCharacters: 2,
|
|
apiSettings: {
|
|
url: `${appSubUrl}/repo/search?q={query}&uid=${$searchRepoBox.data('uid')}`,
|
|
onResponse(response) {
|
|
const items = [];
|
|
$.each(response.data, (_i, item) => {
|
|
items.push({
|
|
title: item.repository.full_name.split('/')[1],
|
|
description: item.repository.full_name,
|
|
});
|
|
});
|
|
|
|
return {results: items};
|
|
},
|
|
},
|
|
searchFields: ['full_name'],
|
|
showNoResults: false,
|
|
});
|
|
}
|