mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-22 19:14:31 +03:00
fix: series list in stack header
This commit is contained in:
parent
d4e81fd227
commit
014e0704ca
@ -6,7 +6,7 @@
|
||||
import Button from '@gitbutler/ui/Button.svelte';
|
||||
|
||||
interface Props {
|
||||
series: PatchSeries[];
|
||||
series: (PatchSeries | Error)[];
|
||||
onCollapseButtonClick: () => void;
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
<script lang="ts">
|
||||
import Select from '$lib/select/Select.svelte';
|
||||
import { PatchSeries } from '$lib/vbranches/types';
|
||||
import { isPatchSeries, PatchSeries } from '$lib/vbranches/types';
|
||||
import Icon from '@gitbutler/ui/Icon.svelte';
|
||||
import SeriesLabelsRow from '@gitbutler/ui/SeriesLabelsRow.svelte';
|
||||
|
||||
interface Props {
|
||||
series: PatchSeries[];
|
||||
series: (PatchSeries | Error)[];
|
||||
disableSelector?: boolean;
|
||||
}
|
||||
|
||||
@ -13,7 +13,12 @@
|
||||
|
||||
const shiftedSeries = $derived(series.slice(1));
|
||||
const seriesTypes = $derived(
|
||||
shiftedSeries.map((s) => (s.patches?.[0] ? s.patches?.[0].status : 'local'))
|
||||
shiftedSeries.map((s) => {
|
||||
if (isPatchSeries(s) && s.patches?.[0]) {
|
||||
return s.patches?.[0].status;
|
||||
}
|
||||
return 'error';
|
||||
})
|
||||
);
|
||||
</script>
|
||||
|
||||
@ -174,6 +179,10 @@
|
||||
&.integrated {
|
||||
background-color: var(--clr-commit-integrated);
|
||||
}
|
||||
|
||||
&.error {
|
||||
background-color: var(--clr-theme-err-element);
|
||||
}
|
||||
}
|
||||
|
||||
.selector-series-chain-icon {
|
||||
|
@ -4,6 +4,7 @@
|
||||
import { BranchController } from '$lib/vbranches/branchController';
|
||||
import { VirtualBranch } from '$lib/vbranches/types';
|
||||
import { getContext } from '@gitbutler/shared/context';
|
||||
import { isError } from '@gitbutler/ui/utils/typeguards';
|
||||
|
||||
interface Props {
|
||||
branch: VirtualBranch;
|
||||
@ -14,7 +15,12 @@
|
||||
|
||||
const { onCollapseButtonClick, branch }: Props = $props();
|
||||
|
||||
const nonArchivedSeries = $derived(branch.validSeries.filter((s) => !s.archived));
|
||||
const nonArchivedSeries = $derived(
|
||||
branch.series.filter((s) => {
|
||||
if (isError(s)) return s;
|
||||
return !s.archived;
|
||||
})
|
||||
);
|
||||
</script>
|
||||
|
||||
<div class="stack-header">
|
||||
|
Loading…
Reference in New Issue
Block a user