Design Prot Merge #1
@@ -304,8 +304,6 @@ namespace Musify.Application.Mixes
|
|||||||
database.Mixes.RemoveRange(previousMixes);
|
database.Mixes.RemoveRange(previousMixes);
|
||||||
}
|
}
|
||||||
|
|
||||||
var today = DateOnly.FromDateTime(DateTime.UtcNow);
|
|
||||||
|
|
||||||
for (var position = 0; position < drafts.Count; position++)
|
for (var position = 0; position < drafts.Count; position++)
|
||||||
{
|
{
|
||||||
var draft = drafts[position];
|
var draft = drafts[position];
|
||||||
@@ -314,7 +312,6 @@ namespace Musify.Application.Mixes
|
|||||||
UserId = userId,
|
UserId = userId,
|
||||||
Title = draft.Title,
|
Title = draft.Title,
|
||||||
Subtitle = draft.Subtitle,
|
Subtitle = draft.Subtitle,
|
||||||
GeneratedOn = today,
|
|
||||||
Position = position
|
Position = position
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ namespace Musify.Application.Mixes.Responses
|
|||||||
Guid Id,
|
Guid Id,
|
||||||
string Title,
|
string Title,
|
||||||
string? Subtitle,
|
string? Subtitle,
|
||||||
DateOnly GeneratedOn,
|
|
||||||
int ItemCount,
|
int ItemCount,
|
||||||
IReadOnlyList<MixItemApplicationResponse> Items)
|
IReadOnlyList<MixItemApplicationResponse> Items)
|
||||||
{
|
{
|
||||||
@@ -20,7 +19,6 @@ namespace Musify.Application.Mixes.Responses
|
|||||||
mix.Id,
|
mix.Id,
|
||||||
mix.Title,
|
mix.Title,
|
||||||
mix.Subtitle,
|
mix.Subtitle,
|
||||||
mix.GeneratedOn,
|
|
||||||
itemCount,
|
itemCount,
|
||||||
[.. items.Select(MixItemApplicationResponse.FromEntity)]);
|
[.. items.Select(MixItemApplicationResponse.FromEntity)]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ namespace Musify.Domain.Entities
|
|||||||
[MaxLength(256)]
|
[MaxLength(256)]
|
||||||
public string? Subtitle { get; set; }
|
public string? Subtitle { get; set; }
|
||||||
|
|
||||||
[Required]
|
|
||||||
public required DateOnly GeneratedOn { get; set; }
|
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public int Position { get; set; } = 0;
|
public int Position { get; set; } = 0;
|
||||||
|
|
||||||
|
|||||||
Generated
+1175
File diff suppressed because it is too large
Load Diff
+30
@@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Musify.Infrastructure.Persistence.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class DropMixGeneratedOn : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "GeneratedOn",
|
||||||
|
table: "Mixes");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<DateOnly>(
|
||||||
|
name: "GeneratedOn",
|
||||||
|
table: "Mixes",
|
||||||
|
type: "date",
|
||||||
|
nullable: false,
|
||||||
|
defaultValue: new DateOnly(1, 1, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -325,9 +325,6 @@ namespace Musify.Infrastructure.Persistence.Migrations
|
|||||||
b.Property<DateTime>("CreatedAt")
|
b.Property<DateTime>("CreatedAt")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<DateOnly>("GeneratedOn")
|
|
||||||
.HasColumnType("date");
|
|
||||||
|
|
||||||
b.Property<int>("Position")
|
b.Property<int>("Position")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
|||||||
Vendored
-2
@@ -608,8 +608,6 @@ export interface components {
|
|||||||
id: string;
|
id: string;
|
||||||
title: string;
|
title: string;
|
||||||
subtitle: null | string;
|
subtitle: null | string;
|
||||||
/** Format: date */
|
|
||||||
generatedOn: string;
|
|
||||||
/** Format: int32 */
|
/** Format: int32 */
|
||||||
itemCount: number | string;
|
itemCount: number | string;
|
||||||
items: components["schemas"]["MixItemApplicationResponse"][];
|
items: components["schemas"]["MixItemApplicationResponse"][];
|
||||||
|
|||||||
@@ -1,57 +0,0 @@
|
|||||||
<script lang="ts" module>
|
|
||||||
import type { LucideIcon } from '@lucide/svelte';
|
|
||||||
|
|
||||||
export interface ChipOption {
|
|
||||||
value: string;
|
|
||||||
label: string;
|
|
||||||
icon?: LucideIcon;
|
|
||||||
disabled?: boolean;
|
|
||||||
hint?: string;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script lang="ts">
|
|
||||||
import Check from '@lucide/svelte/icons/check';
|
|
||||||
|
|
||||||
interface Props {
|
|
||||||
options: ChipOption[];
|
|
||||||
selected: string[];
|
|
||||||
label: string;
|
|
||||||
onChange: (selected: string[]) => void;
|
|
||||||
class?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
let { options, selected, label, onChange, class: klass = '' }: Props = $props();
|
|
||||||
|
|
||||||
function toggle(value: string) {
|
|
||||||
onChange(selected.includes(value) ? selected.filter((v) => v !== value) : [...selected, value]);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<div role="group" aria-label={label} class="flex flex-wrap items-center gap-2 {klass}">
|
|
||||||
{#each options as option (option.value)}
|
|
||||||
{@const active = selected.includes(option.value)}
|
|
||||||
<label
|
|
||||||
title={option.hint}
|
|
||||||
class="inline-flex cursor-pointer items-center gap-1.5 rounded-full border px-3.5 py-1.5 text-sm font-semibold transition select-none
|
|
||||||
{active
|
|
||||||
? 'border-transparent bg-accent text-on-accent'
|
|
||||||
: 'border-line bg-surface text-fg-2 hover:bg-surface-hover'}
|
|
||||||
{option.disabled ? 'pointer-events-none opacity-45' : ''}"
|
|
||||||
>
|
|
||||||
<input
|
|
||||||
type="checkbox"
|
|
||||||
class="sr-only"
|
|
||||||
checked={active}
|
|
||||||
disabled={option.disabled}
|
|
||||||
onchange={() => toggle(option.value)}
|
|
||||||
/>
|
|
||||||
{#if active}
|
|
||||||
<Check class="h-3.5 w-3.5" strokeWidth={3} />
|
|
||||||
{:else if option.icon}
|
|
||||||
<option.icon class="h-3.5 w-3.5" strokeWidth={2} />
|
|
||||||
{/if}
|
|
||||||
{option.label}
|
|
||||||
</label>
|
|
||||||
{/each}
|
|
||||||
</div>
|
|
||||||
Reference in New Issue
Block a user