fix sprint sorting.
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-07-13 22:13:47 +02:00
parent e268c1fd97
commit 5987b7c8e1
2 changed files with 16 additions and 1 deletions
@@ -103,7 +103,7 @@ import Checkbox from "$lib/components/layout/Checkbox.svelte";
</script>
<form on:submit|preventDefault={submit}>
<Modal closable show={show} verb={op} noun="Item" disabled={loading} error={error}>
<Modal closable show={show} verb={op} noun="Stat" disabled={loading} error={error}>
<ModalBody>
<label for="name">Name</label>
<input name="name" type="text" bind:value={stat.name} />
+15
View File
@@ -85,6 +85,21 @@ func (s *Service) ListScopedBetween(ctx context.Context, from, to time.Time) ([]
}
func (s *Service) fillMany(ctx context.Context, sprints []entities.Sprint) ([]Result, error) {
sort.Slice(sprints, func(i, j int) bool {
si := sprints[i]
sj := sprints[j]
if si.IsTimed != sj.IsTimed {
return si.IsTimed
}
if !si.FromTime.Equal(sj.FromTime) {
return si.FromTime.Before(sj.FromTime)
}
return si.ID < sj.ID
})
parts, err := s.Repository.ListParts(ctx, sprints...)
if err != nil {
return nil, err