1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-06-27 16:35:57 +00:00
forgejo/web_src/js/components/DashboardRepoList.vue

535 lines
19 KiB
Vue
Raw Normal View History

<script>
import {createApp} from 'vue';
import $ from 'jquery';
import {SvgIcon} from '../svg.js';
import {GET} from '../modules/fetch.js';
const {appSubUrl, assetUrlPrefix, pageData} = window.config;
// make sure this matches templates/repo/commit_status.tmpl
const commitStatus = {
pending: {name: 'octicon-dot-fill', color: 'yellow'},
success: {name: 'octicon-check', color: 'green'},
error: {name: 'gitea-exclamation', color: 'red'},
failure: {name: 'octicon-x', color: 'red'},
warning: {name: 'gitea-exclamation', color: 'yellow'},
};
const sfc = {
components: {SvgIcon},
data() {
const params = new URLSearchParams(window.location.search);
const tab = params.get('repo-search-tab') || 'repos';
const reposFilter = params.get('repo-search-filter') || 'all';
const privateFilter = params.get('repo-search-private') || 'both';
const archivedFilter = params.get('repo-search-archived') || 'unarchived';
const searchQuery = params.get('repo-search-query') || '';
const page = Number(params.get('repo-search-page')) || 1;
return {
tab,
repos: [],
reposTotalCount: 0,
reposFilter,
archivedFilter,
privateFilter,
page,
finalPage: 1,
searchQuery,
isLoading: false,
staticPrefix: assetUrlPrefix,
counts: {},
repoTypes: {
all: {
searchMode: '',
},
forks: {
searchMode: 'fork',
},
mirrors: {
searchMode: 'mirror',
},
sources: {
searchMode: 'source',
},
collaborative: {
searchMode: 'collaborative',
},
},
textArchivedFilterTitles: {},
textPrivateFilterTitles: {},
organizations: [],
isOrganization: true,
canCreateOrganization: false,
organizationsTotalCount: 0,
organizationId: 0,
subUrl: appSubUrl,
...pageData.dashboardRepoList,
activeIndex: -1, // don't select anything at load, first cursor down will select
};
},
computed: {
showMoreReposLink() {
return this.repos.length > 0 && this.repos.length < this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`];
},
searchURL() {
return `${this.subUrl}/repo/search?sort=updated&order=desc&uid=${this.uid}&team_id=${this.teamId}&q=${this.searchQuery
}&page=${this.page}&limit=${this.searchLimit}&mode=${this.repoTypes[this.reposFilter].searchMode
}${this.archivedFilter === 'archived' ? '&archived=true' : ''}${this.archivedFilter === 'unarchived' ? '&archived=false' : ''
}${this.privateFilter === 'private' ? '&is_private=true' : ''}${this.privateFilter === 'public' ? '&is_private=false' : ''
}`;
},
repoTypeCount() {
return this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`];
},
checkboxArchivedFilterTitle() {
return this.textArchivedFilterTitles[this.archivedFilter];
},
checkboxArchivedFilterProps() {
return {checked: this.archivedFilter === 'archived', indeterminate: this.archivedFilter === 'both'};
},
checkboxPrivateFilterTitle() {
return this.textPrivateFilterTitles[this.privateFilter];
},
checkboxPrivateFilterProps() {
return {checked: this.privateFilter === 'private', indeterminate: this.privateFilter === 'both'};
},
},
mounted() {
const el = document.getElementById('dashboard-repo-list');
this.changeReposFilter(this.reposFilter);
$(el).find('.dropdown').dropdown();
this.textArchivedFilterTitles = {
'archived': this.textShowOnlyArchived,
'unarchived': this.textShowOnlyUnarchived,
'both': this.textShowBothArchivedUnarchived,
};
this.textPrivateFilterTitles = {
'private': this.textShowOnlyPrivate,
'public': this.textShowOnlyPublic,
'both': this.textShowBothPrivatePublic,
};
},
methods: {
changeTab(t) {
this.tab = t;
this.updateHistory();
},
changeReposFilter(filter) {
this.reposFilter = filter;
this.repos = [];
this.page = 1;
this.counts[`${filter}:${this.archivedFilter}:${this.privateFilter}`] = 0;
this.searchRepos();
},
updateHistory() {
const params = new URLSearchParams(window.location.search);
if (this.tab === 'repos') {
params.delete('repo-search-tab');
} else {
params.set('repo-search-tab', this.tab);
}
if (this.reposFilter === 'all') {
params.delete('repo-search-filter');
} else {
params.set('repo-search-filter', this.reposFilter);
}
if (this.privateFilter === 'both') {
params.delete('repo-search-private');
} else {
params.set('repo-search-private', this.privateFilter);
}
if (this.archivedFilter === 'unarchived') {
params.delete('repo-search-archived');
} else {
params.set('repo-search-archived', this.archivedFilter);
}
if (this.searchQuery === '') {
params.delete('repo-search-query');
} else {
params.set('repo-search-query', this.searchQuery);
}
if (this.page === 1) {
params.delete('repo-search-page');
} else {
params.set('repo-search-page', `${this.page}`);
}
const queryString = params.toString();
if (queryString) {
window.history.replaceState({}, '', `?${queryString}`);
} else {
window.history.replaceState({}, '', window.location.pathname);
}
},
toggleArchivedFilter() {
if (this.archivedFilter === 'unarchived') {
this.archivedFilter = 'archived';
} else if (this.archivedFilter === 'archived') {
this.archivedFilter = 'both';
} else { // including both
this.archivedFilter = 'unarchived';
}
this.page = 1;
this.repos = [];
this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`] = 0;
this.searchRepos();
},
togglePrivateFilter() {
if (this.privateFilter === 'both') {
this.privateFilter = 'public';
} else if (this.privateFilter === 'public') {
this.privateFilter = 'private';
} else { // including private
this.privateFilter = 'both';
}
this.page = 1;
this.repos = [];
this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`] = 0;
this.searchRepos();
},
changePage(page) {
this.page = page;
if (this.page > this.finalPage) {
this.page = this.finalPage;
}
if (this.page < 1) {
this.page = 1;
}
this.repos = [];
this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`] = 0;
this.searchRepos();
},
async searchRepos() {
this.isLoading = true;
const searchedMode = this.repoTypes[this.reposFilter].searchMode;
const searchedURL = this.searchURL;
const searchedQuery = this.searchQuery;
let response, json;
try {
if (!this.reposTotalCount) {
const totalCountSearchURL = `${this.subUrl}/repo/search?count_only=1&uid=${this.uid}&team_id=${this.teamId}&q=&page=1&mode=`;
response = await GET(totalCountSearchURL);
this.reposTotalCount = response.headers.get('X-Total-Count') ?? '?';
}
response = await GET(searchedURL);
json = await response.json();
} catch {
if (searchedURL === this.searchURL) {
this.isLoading = false;
}
return;
}
if (searchedURL === this.searchURL) {
this.repos = json.data.map((webSearchRepo) => {
return {
...webSearchRepo.repository,
2024-03-19 14:03:28 +01:00
latest_commit_status: webSearchRepo.latest_commit_status,
locale_latest_commit_status: webSearchRepo.locale_latest_commit_status,
};
});
const count = response.headers.get('X-Total-Count');
if (searchedQuery === '' && searchedMode === '' && this.archivedFilter === 'both') {
this.reposTotalCount = count;
}
this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`] = count;
this.finalPage = Math.ceil(count / this.searchLimit);
this.updateHistory();
this.isLoading = false;
}
},
repoIcon(repo) {
if (repo.fork) {
return 'octicon-repo-forked';
} else if (repo.mirror) {
return 'octicon-mirror';
} else if (repo.template) {
return `octicon-repo-template`;
} else if (repo.private) {
return 'octicon-lock';
} else if (repo.internal) {
return 'octicon-repo';
}
return 'octicon-repo';
},
statusIcon(status) {
return commitStatus[status].name;
},
statusColor(status) {
return commitStatus[status].color;
},
reposFilterKeyControl(e) {
switch (e.key) {
case 'Enter':
document.querySelector('.repo-owner-name-list li.active a')?.click();
break;
case 'ArrowUp':
if (this.activeIndex > 0) {
this.activeIndex--;
} else if (this.page > 1) {
this.changePage(this.page - 1);
this.activeIndex = this.searchLimit - 1;
}
break;
case 'ArrowDown':
if (this.activeIndex < this.repos.length - 1) {
this.activeIndex++;
} else if (this.page < this.finalPage) {
this.activeIndex = 0;
this.changePage(this.page + 1);
}
break;
case 'ArrowRight':
if (this.page < this.finalPage) {
this.changePage(this.page + 1);
}
break;
case 'ArrowLeft':
if (this.page > 1) {
this.changePage(this.page - 1);
}
break;
}
if (this.activeIndex === -1 || this.activeIndex > this.repos.length - 1) {
this.activeIndex = 0;
}
},
},
};
export function initDashboardRepoList() {
const el = document.getElementById('dashboard-repo-list');
if (el) {
createApp(sfc).mount(el);
}
}
export default sfc; // activate the IDE's Vue plugin
</script>
<template>
<div>
<div v-if="!isOrganization" class="ui secondary stackable menu tabs-with-labels">
<a :class="{item: true, active: tab === 'repos'}" @click="changeTab('repos')">{{ textMyRepos }} <span class="ui grey label tw-ml-2">{{ reposTotalCount }}</span></a>
<a :class="{item: true, active: tab === 'organizations'}" @click="changeTab('organizations')">{{ textMyOrgs }} <span class="ui grey label tw-ml-2">{{ organizationsTotalCount }}</span></a>
</div>
<div v-show="tab === 'repos'" class="ui tab active list dashboard-repos">
<h4 v-if="isOrganization" class="ui top attached tw-mt-4 tw-flex tw-items-center">
<div class="tw-flex-1 tw-flex tw-items-center">
{{ textMyRepos }}
<span class="ui grey label tw-ml-2">{{ reposTotalCount }}</span>
</div>
</h4>
<div class="ui top attached segment repos-search">
<div class="ui small fluid action left icon input">
<input type="search" spellcheck="false" maxlength="255" @input="changeReposFilter(reposFilter)" v-model="searchQuery" ref="search" @keydown="reposFilterKeyControl" :placeholder="textSearchRepos">
<i class="icon loading-icon-3px" :class="{'is-loading': isLoading}"><svg-icon name="octicon-search" :size="16"/></i>
<div class="ui dropdown icon button" :title="textFilter">
<svg-icon name="octicon-filter" :size="16"/>
<div class="menu">
<a class="item" @click="toggleArchivedFilter()">
<div class="ui checkbox" ref="checkboxArchivedFilter" :title="checkboxArchivedFilterTitle">
<!--the "tw-pointer-events-none" is necessary to prevent the checkbox from handling user's input,
otherwise if the "input" handles click event for intermediate status, it breaks the internal state-->
<input type="checkbox" class="tw-pointer-events-none" v-bind.prop="checkboxArchivedFilterProps">
<label>
<svg-icon name="octicon-archive" :size="16" class="tw-mr-1"/>
{{ textShowArchived }}
</label>
</div>
</a>
<a class="item" @click="togglePrivateFilter()">
<div class="ui checkbox" ref="checkboxPrivateFilter" :title="checkboxPrivateFilterTitle">
<input type="checkbox" class="tw-pointer-events-none" v-bind.prop="checkboxPrivateFilterProps">
<label>
<svg-icon name="octicon-lock" :size="16" class="tw-mr-1"/>
{{ textShowPrivate }}
</label>
</div>
</a>
</div>
</div>
</div>
Add `<overflow-menu>`, rename webcomponents (#29400) 1. Add `<overflow-menu>` web component 2. Rename `<gitea-origin-url>` to `<origin-url>` and make filenames match. <img width="439" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/2fbe4ca4-110b-4ad2-8e17-c1e116ccbd74"> <img width="444" alt="Screenshot 2024-03-02 at 21 36 52" src="https://github.com/go-gitea/gitea/assets/115237/aa8f786e-dc8c-4030-b12d-7cfb74bdfd6e"> <img width="537" alt="Screenshot 2024-03-03 at 03 05 06" src="https://github.com/go-gitea/gitea/assets/115237/fddd50aa-adf1-4b4b-bd7f-caf30c7b2245"> ![image](https://github.com/go-gitea/gitea/assets/115237/0f43770c-834c-4a05-8e3d-d30eb8653786) ![image](https://github.com/go-gitea/gitea/assets/115237/4b4c6bd7-843f-4f49-808f-6b3aed5e9f9a) TODO: - [x] Check if removal of `requestAnimationFrame` is possible to avoid flash of content. Likely needs a `MutationObserver`. - [x] Hide tippy when button is removed from DOM. - [x] ~~Implement right-aligned items (https://github.com/go-gitea/gitea/pull/28976)~~. Not going to do it. - [x] Clean up CSS so base element has no background and add background via tailwind instead. - [x] Use it for org and user page. --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> (cherry picked from commit 256a1eeb9a67b18c62a10f5909b584b7b220848a) Conflicts: options/locale/locale_en-US.ini templates/package/content/cargo.tmpl templates/package/content/cran.tmpl templates/package/content/debian.tmpl templates/package/content/maven.tmpl
2024-03-15 03:05:31 +01:00
<overflow-menu class="ui secondary pointing tabular borderless menu repos-filter">
<div class="overflow-menu-items tw-justify-center">
<a class="item" tabindex="0" :class="{active: reposFilter === 'all'}" @click="changeReposFilter('all')">
{{ textAll }}
<div v-show="reposFilter === 'all'" class="ui circular mini grey label">{{ repoTypeCount }}</div>
</a>
<a class="item" tabindex="0" :class="{active: reposFilter === 'sources'}" @click="changeReposFilter('sources')">
{{ textSources }}
<div v-show="reposFilter === 'sources'" class="ui circular mini grey label">{{ repoTypeCount }}</div>
</a>
<a class="item" tabindex="0" :class="{active: reposFilter === 'forks'}" @click="changeReposFilter('forks')">
{{ textForks }}
<div v-show="reposFilter === 'forks'" class="ui circular mini grey label">{{ repoTypeCount }}</div>
</a>
<a class="item" tabindex="0" :class="{active: reposFilter === 'mirrors'}" @click="changeReposFilter('mirrors')" v-if="isMirrorsEnabled">
{{ textMirrors }}
<div v-show="reposFilter === 'mirrors'" class="ui circular mini grey label">{{ repoTypeCount }}</div>
</a>
<a class="item" tabindex="0" :class="{active: reposFilter === 'collaborative'}" @click="changeReposFilter('collaborative')">
{{ textCollaborative }}
<div v-show="reposFilter === 'collaborative'" class="ui circular mini grey label">{{ repoTypeCount }}</div>
</a>
</div>
</overflow-menu>
</div>
<div v-if="repos.length" class="ui attached table segment tw-rounded-b">
<ul class="repo-owner-name-list">
<li class="tw-flex tw-items-center tw-py-2" v-for="repo, index in repos" :class="{'active': index === activeIndex}" :key="repo.id">
<a class="repo-list-link muted" :href="repo.link">
<svg-icon :name="repoIcon(repo)" :size="16" class="repo-list-icon"/>
<div class="text truncate">{{ repo.full_name }}</div>
<div v-if="repo.archived">
<svg-icon name="octicon-archive" :size="16"/>
</div>
</a>
[gitea] week 2025-22 cherry pick (gitea/main -> forgejo) (#8198) ## Checklist - [x] go to the last cherry-pick PR (forgejo/forgejo#8040) to figure out how far it went: [gitea@d5bbaee64e](https://github.com/go-gitea/gitea/commit/d5bbaee64e44327e78e39ad7a1977e21ddc59e1c) - [x] cherry-pick and open PR (forgejo/forgejo#8198) - [ ] have the PR pass the CI - end-to-end (specially important if there are actions related changes) - [ ] add `run-end-to-end` label - [ ] check the result - [ ] write release notes - [ ] assign reviewers - [ ] 48h later, last call - merge 1 hour after the last call ## Legend - :question: - No decision about the commit has been made. - :cherries: - The commit has been cherry picked. - :fast_forward: - The commit has been skipped. - :bulb: - The commit has been skipped, but should be ported to Forgejo. - :writing_hand: - The commit has been skipped, and a port to Forgejo already exists. ## Commits - :cherries: [`gitea`](https://github.com/go-gitea/gitea/commit/17cfae82a5e8357f90701815b11c9bc615d0f7e8) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/6397da88d30de0a470dabadb8e27fbb202d75458) Hide href attribute of a tag if there is no target_url ([gitea#34556](https://github.com/go-gitea/gitea/pull/34556)) - :cherries: [`gitea`](https://github.com/go-gitea/gitea/commit/b408bf2f0bb6e76e73421e63128f08d42047e7c0) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/46bc899d57515fc5349e9113e92da2e4b0d93c75) Fix: skip paths check on tag push events in workflows ([gitea#34602](https://github.com/go-gitea/gitea/pull/34602)) - :cherries: [`gitea`](https://github.com/go-gitea/gitea/commit/9165ea8713adb959b6dda4e64bee1a9b2f818288) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/04332f31bfd8a1c0e8676e4764d44e087f1ccc30) Only activity tab needs heatmap data loading ([gitea#34652](https://github.com/go-gitea/gitea/pull/34652)) - :cherries: [`gitea`](https://github.com/go-gitea/gitea/commit/3f7dbbdaf1dbec3b741b3b883f7e44104e77c80b) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/2a9019fd0491684cdeab6d50a16e5cffaef5508b) Small fix in Pull Requests page ([gitea#34612](https://github.com/go-gitea/gitea/pull/34612)) - :cherries: [`gitea`](https://github.com/go-gitea/gitea/commit/497b83b75d567e6ee867d6be41ce37c4cee74e7e) -> [`forgejo`](https://codeberg.org/forgejo/forgejo/commit/9a83cc7bad79fe79447bf6e3cb3144292f922ebb) Fix migration pull request title too long ([gitea#34577](https://github.com/go-gitea/gitea/pull/34577)) ## TODO - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/6b8b5802185f8ba3cd2d0416cc5640fe758ea532) Refactor container and UI ([gitea#34736](https://github.com/go-gitea/gitea/pull/34736)) Packages: Fix for container, needs careful merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/bbee652e293dd761c1d1255a14106e6b9f726003) Prevent duplicate form submissions when creating forks ([gitea#34714](https://github.com/go-gitea/gitea/pull/34714)) Fork: Fix, needs careful merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/d21ce9fa0739a954e2ecbc5d2aa1e324b5781a4b) Improve the performance when detecting the file editable ([gitea#34653](https://github.com/go-gitea/gitea/pull/34653)) LFS: Performance improvement - needs careful merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/8fed27bf6a8a7582a3b2afcda7842b735f6ea5bd) Fix various problems ([gitea#34708](https://github.com/go-gitea/gitea/pull/34708)) Various: Fixes, tests missing. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/c9505a26b9c4147bc7098e20de732a415669520e) Improve instance wide ssh commit signing ([gitea#34341](https://github.com/go-gitea/gitea/pull/34341)) CodeSign: Nice feature - needs careful merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/fbc3796f9e26e38e1ab8624d5d9ab24ccf1ba6ac) Fix pull requests API convert panic when head repository is deleted. ([gitea#34685](https://github.com/go-gitea/gitea/pull/34685)) Pull: Fix, needs careful merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/1610a63bfd9e243a0d1ad8a5d05a5ae011a957a9) Fix commit message rendering and some UI problems ([gitea#34680](https://github.com/go-gitea/gitea/pull/34680)) Various Fixes - needs carefull merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/0082cb51fa381338c8f96076f90f9e7a49909f8e) Fix last admin check when syncing users ([gitea#34649](https://github.com/go-gitea/gitea/pull/34649)) oidc: fix "first user is always admin". Needs careful merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/c6b2cbd75d290b3b831d9b0ee8b47270e68b273b) Fix footnote jump behavior on the issue page. ([gitea#34621](https://github.com/go-gitea/gitea/pull/34621)) Issues: Fix Markdown rendering. Needs carefull merge ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/7a59f5a8253402d6f98234bf0047ec53156d3af9) Ignore "Close" error when uploading container blob ([gitea#34620](https://github.com/go-gitea/gitea/pull/34620)) No issue, no test. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/6d0b24064a922ee8195a7a7cb858823763bac524) Keeping consistent between UI and API about combined commit status state and fix some bugs ([gitea#34562](https://github.com/go-gitea/gitea/pull/34562)) Next PR in Commit-Status story. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/f6041441ee280faba5f06ec4b7a78c35a402bf87) Refactor FindOrgOptions to use enum instead of bool, fix membership visibility ([gitea#34629](https://github.com/go-gitea/gitea/pull/34629)) Just for a common sense here: How should I consider refactorings? ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/cc942e2a86152939305b30373b618536d46aedca) Fix GetUsersByEmails ([gitea#34643](https://github.com/go-gitea/gitea/pull/34643)) User: Seems to fix email validation - but seems not to be finished. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/7fa5a88831141f9e7b858e282558e786b7e95716) Add `--color-logo` for text that should match logo color ([gitea#34639](https://github.com/go-gitea/gitea/pull/34639)) UI: Nice idea - can we adapt this? ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/47d69b7749689a7a7570ac20bdfd30d336daf7c1) Validate hex colors when creating/editing labels ([gitea#34623](https://github.com/go-gitea/gitea/pull/34623)) Label: Color validation but needs careful merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/108db0b04f007a0dc03262cb100aa1fe7b80e785) Fix possible pull request broken when leave the page immediately after clicking the update button ([gitea#34509](https://github.com/go-gitea/gitea/pull/34509)) Nice fix for a bug hard to trace down. Needs careful merge & think about whether a test is possible. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/79cc3698928cdddec433199ac4d9339b4bfcde7d) Fix issue label delete incorrect labels webhook payload ([gitea#34575](https://github.com/go-gitea/gitea/pull/34575)) Small fix but would expect a test, showing what was fixed. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/fe57ee3074c1d6421845bce67e9c580a14e2529e) fixed incorrect page navigation with up and down arrow on last item of dashboard repos ([gitea#34570](https://github.com/go-gitea/gitea/pull/34570)) Small & simple - but tests are missing. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/4e471487fbc680c89985d6afa10724e53739ae8b) Remove unnecessary duplicate code ([gitea#34552](https://github.com/go-gitea/gitea/pull/34552)) Fix arround "Split GetLatestCommitStatus". ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/c5e78fc7addd29b8949883134bc0d5339f64341e) Do not mutate incoming options to SearchRepositoryByName ([gitea#34553](https://github.com/go-gitea/gitea/pull/34553)) Large refactoring to simplify options handling. But needs careful merge. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/f48c0135a611bd8e59b4262c9d2514bda6bb91c1) Fix/improve avatar sync from LDAP ([gitea#34573](https://github.com/go-gitea/gitea/pull/34573)) Nice fix but needs test. ------ - :bulb: [`gitea`](https://github.com/go-gitea/gitea/commit/e8d8984f7c2c49c91bb24ac9c0d86e92a8ec795a) Fix some trivial problems ([gitea#34579](https://github.com/go-gitea/gitea/pull/34579)) Various fixes, tests missing. ------ ## Skipped - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/637070e07bd34c914162cc479aa1683507d9cb14) Fix container range bug ([gitea#34725](https://github.com/go-gitea/gitea/pull/34725)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/0d3e9956cd73b78514a0507eb05446dcc9b7b8cc) [skip ci] Updated translations via Crowdin ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/28debdbe00a51ae031d539f95919351032254695) [skip ci] Updated translations via Crowdin ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/dcc9206a597e9f77a9ecedb0201f48af1e64f258) Raise minimum Node.js version to 20, test on 24 ([gitea#34713](https://github.com/go-gitea/gitea/pull/34713)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/bc28654b49e7bea0ee3088977c86b29b5c032fca) [skip ci] Updated translations via Crowdin ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/65986f423fd7718e8c0afc68261d2655bf60571c) Refactor embedded assets and drop unnecessary dependencies ([gitea#34692](https://github.com/go-gitea/gitea/pull/34692)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/18bafcc3785e0afe66b8c1188bb940eb5bb864a6) Bump minimum go version to 1.24.4 ([gitea#34699](https://github.com/go-gitea/gitea/pull/34699)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/8d135ef5cf2cd64ae7311ef23469689ed333de9d) Update JS deps ([gitea#34701](https://github.com/go-gitea/gitea/pull/34701)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/d5893ee260d6fa7cb1919748555fc1d69b9145cb) Fix markdown wrap ([gitea#34697](https://github.com/go-gitea/gitea/pull/34697)) - gitea UI specific specific ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/06ccb3a1d46433aa0dda24f697f7586f3024c032) [skip ci] Updated translations via Crowdin ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/94db956e319232b35a12d4f2e186b188a88a1be2) frontport changelog ([gitea#34689](https://github.com/go-gitea/gitea/pull/34689)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/d5afdccde82e7f00e54d140533308fe76bf41783) [skip ci] Updated translations via Crowdin ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/e9f5105e9502c4cedd19b7f6dde02adee8caff2a) Migrate to urfave v3 ([gitea#34510](https://github.com/go-gitea/gitea/pull/34510)) already in Forgejo - see https://codeberg.org/forgejo/forgejo/pulls/8035 ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/2c341b6803622772619621e2620755a0ddce07e8) [skip ci] Updated translations via Crowdin ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/92e7e98c565235cd24db82679aa801dace2d1bd8) Update x/crypto package and make builtin SSH use default parameters ([gitea#34667](https://github.com/go-gitea/gitea/pull/34667)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/7b39c8258779363e2071b6171726166c58f843ae) Fix "oras" OCI client compatibility ([gitea#34666](https://github.com/go-gitea/gitea/pull/34666)) Already in forgejo - see https://codeberg.org/forgejo/forgejo/issues/8070 ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/1fe652cd2697b5bb459741f988782163a091c6c8) [skip ci] Updated translations via Crowdin ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/a9a705f4db95dfcfd21a0ad4fcb8f6a7a8809ff5) Fix missed merge commit sha and time when migrating from codecommit ([gitea#34645](https://github.com/go-gitea/gitea/pull/34645)) Migration: Seems to be an important fix, but no tests. As I know @earl-warren worked hard on migration, is this still relevant to us? ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/1e0758a9f1aade415de434163bb0f6363dc6ca50) [skip ci] Updated translations via Crowdin ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/f6f6aedd4fe918df7b5b3593dd1a4e65f6b2ae10) Update JS deps, regenerate SVGs ([gitea#34640](https://github.com/go-gitea/gitea/pull/34640)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/aa2b3b2b1fdaf37917014770cd6bef3a2a5028a3) Misc CSS fixes ([gitea#34638](https://github.com/go-gitea/gitea/pull/34638)) - gitea UI specific specific ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/b38f2d31fdcd1fc5facda86be33d3f830503f538) add codecommit to supported services in api docs ([gitea#34626](https://github.com/go-gitea/gitea/pull/34626)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/74a0178c6a9c28da6ab76545b466ed68c569eb75) add openssh-keygen to rootless image ([gitea#34625](https://github.com/go-gitea/gitea/pull/34625)) already in Forgejo - see https://codeberg.org/forgejo/forgejo/issues/6896 ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/5b22af4373c3936a951dd91da38860a830fcf743) bump to alpine 3.22 ([gitea#34613](https://github.com/go-gitea/gitea/pull/34613)) ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/9e0e107d236022d550d077da7aa9af415ac02f8a) Fix notification count positioning for variable-width elements ([gitea#34597](https://github.com/go-gitea/gitea/pull/34597)) - gitea UI specific specific ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/e5781cec75d7ba350fb9162b3882192574c80429) Fix margin issue in markup paragraph rendering ([gitea#34599](https://github.com/go-gitea/gitea/pull/34599)) - gitea UI specific specific ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/375dab111198e6432b303a3c29b8e91bec95d361) Make pull request and issue history more compact ([gitea#34588](https://github.com/go-gitea/gitea/pull/34588)) - gitea UI specific specific ------ - :fast_forward: [`gitea`](https://github.com/go-gitea/gitea/commit/2a1585b32ea2c3cb961cd1aedf4117d880255a53) Refactor some tests ([gitea#34580](https://github.com/go-gitea/gitea/pull/34580)) ------ <details> <summary><h2>Stats</h2></summary> <br> Between [`gitea@d5bbaee64e`](https://github.com/go-gitea/gitea/commit/d5bbaee64e44327e78e39ad7a1977e21ddc59e1c) and [`gitea@6b8b580218`](https://github.com/go-gitea/gitea/commit/6b8b5802185f8ba3cd2d0416cc5640fe758ea532), **55** commits have been reviewed. We picked **5**, skipped **28** (of which **3** were already in Forgejo!), and decided to port **22**. </details> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: NorthRealm <155140859+NorthRealm@users.noreply.github.com> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-authored-by: endo0911engineer <161911062+endo0911engineer@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8198 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de> Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
2025-06-17 18:28:07 +02:00
<a class="tw-flex tw-items-center" v-if="repo.latest_commit_status" :href="repo.latest_commit_status.TargetURL || null" :data-tooltip-content="repo.locale_latest_commit_status">
<!-- the commit status icon logic is taken from templates/repo/commit_status.tmpl -->
<svg-icon :name="statusIcon(repo.latest_commit_status.State)" :class="'tw-ml-2 commit-status icon text ' + statusColor(repo.latest_commit_status.State)" :size="16"/>
</a>
</li>
</ul>
<div v-if="showMoreReposLink" class="tw-text-center">
<div class="divider tw-my-0"/>
<div class="ui borderless pagination menu narrow tw-my-2">
<a
class="item navigation tw-py-1" :class="{'disabled': page === 1}"
@click="changePage(1)" :title="textFirstPage"
>
<svg-icon name="gitea-double-chevron-left" :size="16" class="tw-mr-1"/>
</a>
<a
class="item navigation tw-py-1" :class="{'disabled': page === 1}"
@click="changePage(page - 1)" :title="textPreviousPage"
>
<svg-icon name="octicon-chevron-left" :size="16" class="tw-mr-1"/>
</a>
<a class="active item tw-py-1">{{ page }}</a>
<a
class="item navigation" :class="{'disabled': page === finalPage}"
@click="changePage(page + 1)" :title="textNextPage"
>
<svg-icon name="octicon-chevron-right" :size="16" class="tw-ml-1"/>
</a>
<a
class="item navigation tw-py-1" :class="{'disabled': page === finalPage}"
@click="changePage(finalPage)" :title="textLastPage"
>
<svg-icon name="gitea-double-chevron-right" :size="16" class="tw-ml-1"/>
</a>
</div>
</div>
</div>
</div>
<div v-if="!isOrganization" v-show="tab === 'organizations'" class="ui tab active list dashboard-orgs">
<div v-if="organizations.length" class="ui attached table segment tw-rounded">
<ul class="repo-owner-name-list">
<li class="tw-flex tw-items-center tw-py-2" v-for="org in organizations" :key="org.name">
<a class="repo-list-link muted" :href="subUrl + '/' + encodeURIComponent(org.name)">
<svg-icon name="octicon-organization" :size="16" class="repo-list-icon"/>
<div class="text truncate">{{ org.name }}</div>
<div><!-- div to prevent underline of label on hover -->
<span class="ui tiny basic label" v-if="org.org_visibility !== 'public'">
{{ org.org_visibility === 'limited' ? textOrgVisibilityLimited: textOrgVisibilityPrivate }}
</span>
</div>
</a>
<div class="text light grey tw-flex tw-items-center tw-ml-2">
{{ org.num_repos }}
<svg-icon name="octicon-repo" :size="16" class="tw-ml-1 tw-mt-0.5"/>
</div>
</li>
</ul>
</div>
</div>
</div>
</template>
<style scoped>
ul {
list-style: none;
margin: 0;
padding-left: 0;
}
ul li {
padding: 0 10px;
}
ul li:not(:last-child) {
border-bottom: 1px solid var(--color-secondary);
}
Add `<overflow-menu>`, rename webcomponents (#29400) 1. Add `<overflow-menu>` web component 2. Rename `<gitea-origin-url>` to `<origin-url>` and make filenames match. <img width="439" alt="image" src="https://github.com/go-gitea/gitea/assets/115237/2fbe4ca4-110b-4ad2-8e17-c1e116ccbd74"> <img width="444" alt="Screenshot 2024-03-02 at 21 36 52" src="https://github.com/go-gitea/gitea/assets/115237/aa8f786e-dc8c-4030-b12d-7cfb74bdfd6e"> <img width="537" alt="Screenshot 2024-03-03 at 03 05 06" src="https://github.com/go-gitea/gitea/assets/115237/fddd50aa-adf1-4b4b-bd7f-caf30c7b2245"> ![image](https://github.com/go-gitea/gitea/assets/115237/0f43770c-834c-4a05-8e3d-d30eb8653786) ![image](https://github.com/go-gitea/gitea/assets/115237/4b4c6bd7-843f-4f49-808f-6b3aed5e9f9a) TODO: - [x] Check if removal of `requestAnimationFrame` is possible to avoid flash of content. Likely needs a `MutationObserver`. - [x] Hide tippy when button is removed from DOM. - [x] ~~Implement right-aligned items (https://github.com/go-gitea/gitea/pull/28976)~~. Not going to do it. - [x] Clean up CSS so base element has no background and add background via tailwind instead. - [x] Use it for org and user page. --------- Co-authored-by: Giteabot <teabot@gitea.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> (cherry picked from commit 256a1eeb9a67b18c62a10f5909b584b7b220848a) Conflicts: options/locale/locale_en-US.ini templates/package/content/cargo.tmpl templates/package/content/cran.tmpl templates/package/content/debian.tmpl templates/package/content/maven.tmpl
2024-03-15 03:05:31 +01:00
.repos-search {
padding-bottom: 0 !important;
}
.repos-filter {
padding-top: 0 !important;
margin-top: 0 !important;
border-bottom-width: 0 !important;
margin-bottom: 2px !important;
}
.repos-filter .item {
padding-left: 6px !important;
padding-right: 6px !important;
}
.repo-list-link {
min-width: 0; /* for text truncation */
display: flex;
align-items: center;
flex: 1;
gap: 0.5rem;
}
.repo-list-link .svg {
color: var(--color-text-light-2);
}
.repo-list-icon {
min-width: 16px;
margin-right: 2px;
}
/* octicon-mirror has no padding inside the SVG */
.repo-list-icon.octicon-mirror {
width: 14px;
min-width: 14px;
margin-left: 1px;
margin-right: 3px;
}
.repo-owner-name-list li.active {
background: var(--color-hover);
}
</style>