mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
Workshop - Visual pass
This commit is contained in:
parent
7b71ee05da
commit
74c24c84ae
@ -43,7 +43,7 @@
|
||||
<Border Grid.Row="0" Classes="card" Margin="0 0 0 10">
|
||||
<StackPanel>
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBlock Classes="h4 no-margin">Release info</TextBlock>
|
||||
<TextBlock Theme="{StaticResource SubtitleTextBlockStyle}">Release info</TextBlock>
|
||||
|
||||
<Panel Grid.Column="1" IsVisible="{CompiledBinding InstallationAvailable}">
|
||||
<!-- Install progress -->
|
||||
|
||||
@ -64,12 +64,7 @@ public partial class EntrySpecificationsViewModel : ValidatableViewModelBase
|
||||
_categoriesValid = categoriesRule.ValidationChanged.Select(c => c.IsValid).ToProperty(this, vm => vm.CategoriesValid);
|
||||
_descriptionValid = descriptionRule.ValidationChanged.Select(c => c.IsValid).ToProperty(this, vm => vm.DescriptionValid);
|
||||
|
||||
this.WhenActivatedAsync(async d =>
|
||||
{
|
||||
// Load categories
|
||||
await PopulateCategories();
|
||||
Disposable.Create(ClearIcon).DisposeWith(d);
|
||||
});
|
||||
this.WhenActivatedAsync(async _ => await PopulateCategories());
|
||||
}
|
||||
|
||||
public ReactiveCommand<Unit, Unit> SelectIcon { get; }
|
||||
@ -98,12 +93,6 @@ public partial class EntrySpecificationsViewModel : ValidatableViewModelBase
|
||||
IconChanged = true;
|
||||
}
|
||||
|
||||
private void ClearIcon()
|
||||
{
|
||||
IconBitmap?.Dispose();
|
||||
IconBitmap = null;
|
||||
}
|
||||
|
||||
private async Task PopulateCategories()
|
||||
{
|
||||
IOperationResult<IGetCategoriesResult> categories = await _workshopClient.GetCategories.ExecuteAsync();
|
||||
|
||||
@ -42,10 +42,10 @@
|
||||
<Border Grid.Row="0" Classes="card" Margin="0 0 0 10">
|
||||
<StackPanel>
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<Button Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Classes="icon-button" Command="{CompiledBinding Close}">
|
||||
<Button Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Classes="icon-button" Margin="0 0 5 0" Command="{CompiledBinding Close}">
|
||||
<avalonia:MaterialIcon Kind="ArrowBack" />
|
||||
</Button>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Classes="h4 no-margin">Release info</TextBlock>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Theme="{StaticResource SubtitleTextBlockStyle}">Release info</TextBlock>
|
||||
<StackPanel Grid.Column="2">
|
||||
<!-- Install progress -->
|
||||
<StackPanel Orientation="Horizontal"
|
||||
|
||||
@ -7,7 +7,9 @@
|
||||
x:Class="Artemis.UI.Screens.Workshop.Library.SubmissionDetailsView"
|
||||
x:DataType="library:SubmissionDetailsViewModel">
|
||||
<Grid ColumnDefinitions="*,300" RowDefinitions="*, Auto">
|
||||
<ContentControl Grid.Column="0" Grid.Row="0" Content="{CompiledBinding EntrySpecificationsViewModel}"></ContentControl>
|
||||
<Border Classes="card" Grid.Column="0" Grid.Row="0">
|
||||
<ContentControl Content="{CompiledBinding EntrySpecificationsViewModel}"></ContentControl>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Column="1" Grid.Row="0" Classes="card" Margin="10 0 0 0">
|
||||
<Grid RowDefinitions="*,Auto">
|
||||
|
||||
@ -79,6 +79,8 @@ public partial class SubmissionDetailsViewModel : RoutableScreen
|
||||
bool confirmed = await _windowService.ShowConfirmContentDialog("You have unsaved changes", "Do you want to discard your unsaved changes?");
|
||||
if (!confirmed)
|
||||
args.Cancel();
|
||||
else
|
||||
await ExecuteDiscardChanges();
|
||||
}
|
||||
|
||||
private async Task ApplyDetailsFromEntry(CancellationToken cancellationToken)
|
||||
@ -94,6 +96,7 @@ public partial class SubmissionDetailsViewModel : RoutableScreen
|
||||
if (Entry == null)
|
||||
{
|
||||
EntrySpecificationsViewModel = null;
|
||||
ApplyImagesFromEntry();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -176,7 +179,6 @@ public partial class SubmissionDetailsViewModel : RoutableScreen
|
||||
private async Task ExecuteDiscardChanges()
|
||||
{
|
||||
await ApplyDetailsFromEntry(CancellationToken.None);
|
||||
ApplyImagesFromEntry();
|
||||
}
|
||||
|
||||
private async Task ExecuteSaveChanges(CancellationToken cancellationToken)
|
||||
|
||||
@ -83,6 +83,17 @@ public partial class SubmissionManagementViewModel : RoutableHostScreen<Routable
|
||||
// If there is a 2nd parameter, it's a release ID
|
||||
SelectedRelease = args.RouteParameters.Length > 1 ? Releases?.FirstOrDefault(r => r.Id == (long) args.RouteParameters[1]) : null;
|
||||
|
||||
// OnNavigating may just be getting called to update the selected release
|
||||
if (Entry?.Id == parameters.EntryId)
|
||||
{
|
||||
// Reapply the entry when closing a release, this is mainly because the entry icon probably got disposed
|
||||
if (SelectedRelease == null)
|
||||
await _detailsViewModel.SetEntry(Entry, cancellationToken);
|
||||
|
||||
// No need to reload the entry since it's the same
|
||||
return;
|
||||
}
|
||||
|
||||
IOperationResult<IGetSubmittedEntryByIdResult> result = await _client.GetSubmittedEntryById.ExecuteAsync(parameters.EntryId, cancellationToken);
|
||||
if (result.IsErrorResult())
|
||||
return;
|
||||
|
||||
@ -5,24 +5,95 @@
|
||||
xmlns:library="clr-namespace:Artemis.UI.Screens.Workshop.Library"
|
||||
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:controls1="clr-namespace:Artemis.UI.Controls"
|
||||
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
||||
xmlns:sharedConverters="clr-namespace:Artemis.UI.Shared.Converters;assembly=Artemis.UI.Shared"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Artemis.UI.Screens.Workshop.Library.SubmissionReleaseView"
|
||||
x:DataType="library:SubmissionReleaseViewModel">
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<StackPanel Grid.Row="0" Orientation="Horizontal" Spacing="5">
|
||||
<Button VerticalAlignment="Center" Classes="icon-button" Command="{CompiledBinding Close}">
|
||||
<avalonia:MaterialIcon Kind="ArrowBack" />
|
||||
</Button>
|
||||
<TextBlock Classes="h3 no-margin" Text="{CompiledBinding Release.Version}" />
|
||||
</StackPanel>
|
||||
<UserControl.Resources>
|
||||
<converters:DateTimeConverter x:Key="DateTimeConverter" />
|
||||
<sharedConverters:BytesToStringConverter x:Key="BytesToStringConverter" />
|
||||
</UserControl.Resources>
|
||||
<UserControl.Styles>
|
||||
<Style Selector="Grid.info-container">
|
||||
<Setter Property="Margin" Value="10" />
|
||||
</Style>
|
||||
<Style Selector="avalonia|MaterialIcon.info-icon">
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="Margin" Value="0 3 10 0" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.info-title">
|
||||
<Setter Property="Margin" Value="0 0 0 5" />
|
||||
<Setter Property="Opacity" Value="0.8" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.info-body">
|
||||
</Style>
|
||||
<Style Selector="TextBlock.info-link">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource SystemAccentColorLight3}" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.info-link:pointerover">
|
||||
<Setter Property="Cursor" Value="Hand" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource SystemAccentColorLight1}" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
|
||||
<controls1:SplitMarkdownEditor Grid.Row="1" Title="Changelog" Markdown="{CompiledBinding Changelog}"/>
|
||||
<Grid RowDefinitions="Auto,*,Auto">
|
||||
<Border Grid.Row="0" Classes="card" Margin="0 0 0 10">
|
||||
<StackPanel>
|
||||
<Grid ColumnDefinitions="Auto,*,Auto">
|
||||
<Button Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" Classes="icon-button" Command="{CompiledBinding Close}" Margin="0 0 5 0">
|
||||
<avalonia:MaterialIcon Kind="ArrowBack" />
|
||||
</Button>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Theme="{StaticResource SubtitleTextBlockStyle}">Release management</TextBlock>
|
||||
<Button Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right" Classes="danger" Command="{CompiledBinding DeleteRelease}">Delete release</Button>
|
||||
</Grid>
|
||||
<Border Classes="card-separator" />
|
||||
<Grid Margin="-5 -10" ColumnDefinitions="*,*,*">
|
||||
<Grid Grid.Column="0" ColumnDefinitions="*,*" RowDefinitions="*,*" Classes="info-container" HorizontalAlignment="Left">
|
||||
<avalonia:MaterialIcon Kind="TickNetworkOutline" Grid.Column="0" Grid.RowSpan="2" Classes="info-icon" />
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Classes="info-title">Version</TextBlock>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Classes="info-body"
|
||||
Cursor="Hand"
|
||||
Text="{CompiledBinding Release.Version}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="1" ColumnDefinitions="*,*" RowDefinitions="*,*,*" Classes="info-container" HorizontalAlignment="Center">
|
||||
<avalonia:MaterialIcon Kind="Calendar" Grid.Column="0" Grid.RowSpan="2" Classes="info-icon" />
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Classes="info-title">Release date</TextBlock>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Classes="info-body"
|
||||
Text="{CompiledBinding Release.CreatedAt, Converter={StaticResource DateTimeConverter}}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="2" ColumnDefinitions="*,*" RowDefinitions="*,*" Classes="info-container" HorizontalAlignment="Right">
|
||||
<avalonia:MaterialIcon Kind="File" Grid.Column="0" Grid.RowSpan="2" Classes="info-icon" />
|
||||
<TextBlock Grid.Column="1" Grid.Row="0" Classes="info-title">File size</TextBlock>
|
||||
<TextBlock Grid.Column="1"
|
||||
Grid.Row="1"
|
||||
Classes="info-body"
|
||||
Text="{CompiledBinding Release.DownloadSize, Converter={StaticResource BytesToStringConverter}, Mode=OneWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1" Classes="card">
|
||||
<Grid RowDefinitions="Auto,Auto,*">
|
||||
<TextBlock Grid.Row="0" Classes="h5 no-margin">Release notes</TextBlock>
|
||||
<Border Grid.Row="1" Classes="card-separator" />
|
||||
|
||||
<controls1:SplitMarkdownEditor Grid.Row="2" Title="Changelog" Markdown="{CompiledBinding Changelog}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<StackPanel Grid.Row="2" Margin="0 10 0 0" Orientation="Horizontal" Spacing="5" HorizontalAlignment="Right">
|
||||
<Button Classes="danger" Command="{CompiledBinding DeleteRelease}">Delete release</Button>
|
||||
<Button Command="{CompiledBinding Discard}">Discard changes</Button>
|
||||
<Button Command="{CompiledBinding Save}">Save</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
||||
@ -1,5 +1,6 @@
|
||||
using System.Reactive.Disposables;
|
||||
using Artemis.UI.Screens.Workshop.SubmissionWizard.Steps.Layout;
|
||||
using Artemis.UI.Screens.Workshop.SubmissionWizard.Steps.Plugin;
|
||||
using Artemis.UI.Screens.Workshop.SubmissionWizard.Steps.Profile;
|
||||
using Artemis.WebClient.Workshop;
|
||||
using PropertyChanged.SourceGenerator;
|
||||
@ -32,7 +33,7 @@ public partial class ChangelogStepViewModel : SubmissionViewModel
|
||||
if (State.EntryType == EntryType.Layout)
|
||||
State.ChangeScreen<LayoutInfoStepViewModel>();
|
||||
else if (State.EntryType == EntryType.Plugin)
|
||||
State.ChangeScreen<SpecificationsStepViewModel>();
|
||||
State.ChangeScreen<PluginSelectionStepViewModel>();
|
||||
else if (State.EntryType == EntryType.Profile)
|
||||
State.ChangeScreen<ProfileAdaptionHintsStepViewModel>();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user