diff --git a/src/Artemis.UI/Routing/Routes.cs b/src/Artemis.UI/Routing/Routes.cs index cac359e3d..b600e635f 100644 --- a/src/Artemis.UI/Routing/Routes.cs +++ b/src/Artemis.UI/Routing/Routes.cs @@ -49,7 +49,9 @@ namespace Artemis.UI.Routing new RouteRegistration("library", [ new RouteRegistration("installed"), new RouteRegistration("submissions"), - new RouteRegistration("submissions/{entryId:long}") + new RouteRegistration("submissions/{entryId:long}", [ + new RouteRegistration("releases/{releaseId:long}") + ]) ]) ]), new RouteRegistration("surface-editor"), diff --git a/src/Artemis.UI/Screens/Workshop/EntryReleases/EntryReleasesViewModel.cs b/src/Artemis.UI/Screens/Workshop/EntryReleases/EntryReleasesViewModel.cs index 6b2b344f8..3d92494f8 100644 --- a/src/Artemis.UI/Screens/Workshop/EntryReleases/EntryReleasesViewModel.cs +++ b/src/Artemis.UI/Screens/Workshop/EntryReleases/EntryReleasesViewModel.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Reactive; using System.Reactive.Disposables; using System.Threading.Tasks; using Artemis.UI.Shared; using Artemis.UI.Shared.Routing; using Artemis.WebClient.Workshop; -using Artemis.WebClient.Workshop.Models; using PropertyChanged.SourceGenerator; using ReactiveUI; @@ -24,7 +22,6 @@ public partial class EntryReleasesViewModel : ActivatableViewModelBase Entry = entry; Releases = Entry.Releases.OrderByDescending(r => r.CreatedAt).Take(5).Select(r => getEntryReleaseItemViewModel(r)).ToList(); - NavigateToRelease = ReactiveCommand.CreateFromTask(ExecuteNavigateToRelease); this.WhenActivated(d => { @@ -35,30 +32,11 @@ public partial class EntryReleasesViewModel : ActivatableViewModelBase this.WhenAnyValue(vm => vm.SelectedRelease) .WhereNotNull() - .Subscribe(s => ExecuteNavigateToRelease(s.Release)) + .Subscribe(s => _router.Navigate($"/releases/{s.Release.Id}")) .DisposeWith(d); }); } public IEntryDetails Entry { get; } public List Releases { get; } - public ReactiveCommand NavigateToRelease { get; } - - private async Task ExecuteNavigateToRelease(IRelease release) - { - switch (Entry.EntryType) - { - case EntryType.Profile: - await _router.Navigate($"workshop/entries/profiles/details/{Entry.Id}/releases/{release.Id}"); - break; - case EntryType.Layout: - await _router.Navigate($"workshop/entries/layouts/details/{Entry.Id}/releases/{release.Id}"); - break; - case EntryType.Plugin: - await _router.Navigate($"workshop/entries/plugins/details/{Entry.Id}/releases/{release.Id}"); - break; - default: - throw new ArgumentOutOfRangeException(nameof(Entry.EntryType)); - } - } } \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailView.axaml b/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailView.axaml deleted file mode 100644 index dbb99d606..000000000 --- a/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailView.axaml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - - - - Management - - - - - - downloads - - - - - Created - - - - - - - - - - - - - View workshop page - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailView.axaml.cs b/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailView.axaml.cs deleted file mode 100644 index 729f02a2b..000000000 --- a/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailView.axaml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Avalonia.ReactiveUI; - -namespace Artemis.UI.Screens.Workshop.Library; - -public partial class SubmissionDetailView : ReactiveUserControl -{ - public SubmissionDetailView() - { - InitializeComponent(); - } -} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsView.axaml b/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsView.axaml new file mode 100644 index 000000000..11cb73c81 --- /dev/null +++ b/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsView.axaml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsView.axaml.cs b/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsView.axaml.cs new file mode 100644 index 000000000..77a1f67ec --- /dev/null +++ b/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsView.axaml.cs @@ -0,0 +1,14 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; +using Avalonia.ReactiveUI; + +namespace Artemis.UI.Screens.Workshop.Library; + +public partial class SubmissionDetailsView : ReactiveUserControl +{ + public SubmissionDetailsView() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailViewModel.cs b/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsViewModel.cs similarity index 83% rename from src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailViewModel.cs rename to src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsViewModel.cs index 839511a5d..1011f8045 100644 --- a/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailViewModel.cs +++ b/src/Artemis.UI/Screens/Workshop/Library/SubmissionDetailsViewModel.cs @@ -8,8 +8,7 @@ using System.Reactive; using System.Threading; using System.Threading.Tasks; using Artemis.UI.Screens.Workshop.Image; -using Artemis.UI.Screens.Workshop.Parameters; -using Artemis.UI.Screens.Workshop.SubmissionWizard; +using Artemis.UI.Shared; using Artemis.UI.Shared.Routing; using Artemis.UI.Shared.Services; using Artemis.WebClient.Workshop; @@ -25,7 +24,7 @@ using EntrySpecificationsViewModel = Artemis.UI.Screens.Workshop.Entries.Details namespace Artemis.UI.Screens.Workshop.Library; -public partial class SubmissionDetailViewModel : RoutableScreen +public partial class SubmissionDetailsViewModel : RoutableScreen { private readonly IWorkshopClient _client; private readonly IWindowService _windowService; @@ -40,7 +39,7 @@ public partial class SubmissionDetailViewModel : RoutableScreen vm.HasChanges)); SaveChanges = ReactiveCommand.CreateFromTask(ExecuteSaveChanges, this.WhenAnyValue(vm => vm.HasChanges)); } - + public ObservableCollection Images { get; } = new(); - public ReactiveCommand CreateRelease { get; } - public ReactiveCommand DeleteSubmission { get; } - public ReactiveCommand ViewWorkshopPage { get; } public ReactiveCommand AddImage { get; } public ReactiveCommand SaveChanges { get; } public ReactiveCommand DiscardChanges { get; } - public override async Task OnNavigating(WorkshopDetailParameters parameters, NavigationArguments args, CancellationToken cancellationToken) + public async Task SetEntry(IGetSubmittedEntryById_Entry? entry, CancellationToken cancellationToken) { - IOperationResult result = await _client.GetSubmittedEntryById.ExecuteAsync(parameters.EntryId, cancellationToken); - if (result.IsErrorResult()) - return; - - Entry = result.Data?.Entry; + Entry = entry; await ApplyDetailsFromEntry(cancellationToken); - ApplyImagesFromEntry(); } - public override async Task OnClosing(NavigationArguments args) + public async Task OnClosing(NavigationArguments args) { if (!HasChanges) return; @@ -243,30 +231,7 @@ public partial class SubmissionDetailViewModel : RoutableScreen(Entry); - } - - private async Task ExecuteDeleteSubmission(CancellationToken cancellationToken) - { - if (Entry == null) - return; - - bool confirmed = await _windowService.ShowConfirmContentDialog( - "Delete submission?", - "You cannot undo this by yourself.\r\n" + - "Users that have already downloaded your submission will keep it."); - if (!confirmed) - return; - - IOperationResult result = await _client.RemoveEntry.ExecuteAsync(Entry.Id, cancellationToken); - result.EnsureNoErrors(); - await _router.Navigate("workshop/library/submissions"); - } - + private async Task ExecuteAddImage(CancellationToken arg) { string[]? result = await _windowService.CreateOpenFileDialog().WithAllowMultiple().HavingFilter(f => f.WithBitmaps()).ShowAsync(); @@ -297,12 +262,6 @@ public partial class SubmissionDetailViewModel : RoutableScreen + + + + + + + + Management + + + + + + downloads + + + + + Created + + + + + + + + + + + + + + Releases + + + + + + + + + + Created + + + + + + + + + + View workshop page + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionManagementView.axaml.cs b/src/Artemis.UI/Screens/Workshop/Library/SubmissionManagementView.axaml.cs new file mode 100644 index 000000000..2c5493d7a --- /dev/null +++ b/src/Artemis.UI/Screens/Workshop/Library/SubmissionManagementView.axaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Reactive.Disposables; +using Avalonia.ReactiveUI; +using ReactiveUI; + +namespace Artemis.UI.Screens.Workshop.Library; + +public partial class SubmissionManagementView : ReactiveUserControl +{ + public SubmissionManagementView() + { + InitializeComponent(); + this.WhenActivated(d => ViewModel.WhenAnyValue(vm => vm.Screen) + .Subscribe(screen => RouterFrame.NavigateFromObject(screen ?? ViewModel?.DetailsViewModel)) + .DisposeWith(d)); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionManagementViewModel.cs b/src/Artemis.UI/Screens/Workshop/Library/SubmissionManagementViewModel.cs new file mode 100644 index 000000000..af7fd558b --- /dev/null +++ b/src/Artemis.UI/Screens/Workshop/Library/SubmissionManagementViewModel.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reactive.Disposables; +using System.Threading; +using System.Threading.Tasks; +using Artemis.UI.Screens.Workshop.Parameters; +using Artemis.UI.Screens.Workshop.SubmissionWizard; +using Artemis.UI.Shared.Routing; +using Artemis.UI.Shared.Services; +using Artemis.WebClient.Workshop; +using Artemis.WebClient.Workshop.Services; +using PropertyChanged.SourceGenerator; +using ReactiveUI; +using StrawberryShake; + +namespace Artemis.UI.Screens.Workshop.Library; + +public partial class SubmissionManagementViewModel : RoutableHostScreen +{ + private readonly IWorkshopClient _client; + private readonly IWindowService _windowService; + private readonly IRouter _router; + private readonly IWorkshopService _workshopService; + + [Notify] private IGetSubmittedEntryById_Entry? _entry; + [Notify] private List? _releases; + [Notify] private IGetSubmittedEntryById_Entry_Releases? _selectedRelease; + + public SubmissionManagementViewModel(IWorkshopClient client, IRouter router, IWindowService windowService, IWorkshopService workshopService, SubmissionDetailsViewModel detailsViewModel) + { + DetailsViewModel = detailsViewModel; + _client = client; + _router = router; + _windowService = windowService; + _workshopService = workshopService; + + this.WhenActivated(d => + { + this.WhenAnyValue(vm => vm.SelectedRelease) + .WhereNotNull() + .Subscribe(r => _router.Navigate($"/releases/{r.Id}")) + .DisposeWith(d); + }); + } + + public SubmissionDetailsViewModel DetailsViewModel { get; } + + public async Task ViewWorkshopPage() + { + if (Entry != null) + await _workshopService.NavigateToEntry(Entry.Id, Entry.EntryType); + } + + public async Task CreateRelease() + { + if (Entry != null) + await _windowService.ShowDialogAsync(Entry); + } + + public async Task DeleteSubmission() + { + if (Entry == null) + return; + + bool confirmed = await _windowService.ShowConfirmContentDialog( + "Delete submission?", + "You cannot undo this by yourself.\r\n" + + "Users that have already downloaded your submission will keep it."); + if (!confirmed) + return; + + IOperationResult result = await _client.RemoveEntry.ExecuteAsync(Entry.Id); + result.EnsureNoErrors(); + await _router.Navigate("workshop/library/submissions"); + } + + public override async Task OnNavigating(WorkshopDetailParameters parameters, NavigationArguments args, CancellationToken cancellationToken) + { + // 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; + + IOperationResult result = await _client.GetSubmittedEntryById.ExecuteAsync(parameters.EntryId, cancellationToken); + if (result.IsErrorResult()) + return; + + Entry = result.Data?.Entry; + Releases = Entry?.Releases.OrderByDescending(r => r.CreatedAt).ToList(); + + await DetailsViewModel.SetEntry(Entry, cancellationToken); + } + + public override async Task OnClosing(NavigationArguments args) + { + await DetailsViewModel.OnClosing(args); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseView.axaml b/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseView.axaml new file mode 100644 index 000000000..105417bf4 --- /dev/null +++ b/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseView.axaml @@ -0,0 +1,68 @@ + + + + + + + + + + + Synchronized scrolling + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseView.axaml.cs b/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseView.axaml.cs new file mode 100644 index 000000000..503c3cb87 --- /dev/null +++ b/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseView.axaml.cs @@ -0,0 +1,100 @@ +using System.Linq; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Media; +using Avalonia.Media.Immutable; +using Avalonia.ReactiveUI; +using AvaloniaEdit.TextMate; +using ReactiveUI; +using TextMateSharp.Grammars; +using VisualExtensions = Artemis.UI.Shared.Extensions.VisualExtensions; + +namespace Artemis.UI.Screens.Workshop.Library; + +public partial class SubmissionReleaseView : ReactiveUserControl +{ + private ScrollViewer? _editorScrollViewer; + private ScrollViewer? _previewScrollViewer; + private bool _updating; + + public SubmissionReleaseView() + { + InitializeComponent(); + + DescriptionEditor.Options.AllowScrollBelowDocument = false; + RegistryOptions options = new(ThemeName.Dark); + TextMate.Installation? install = DescriptionEditor.InstallTextMate(options); + + install.SetGrammar(options.GetScopeByExtension(".md")); + + this.WhenActivated(_ => SetupScrollSync()); + } + + protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) + { + if (this.TryFindResource("SystemAccentColorLight3", out object? resource) && resource is Color color) + DescriptionEditor.TextArea.TextView.LinkTextForegroundBrush = new ImmutableSolidColorBrush(color); + + base.OnAttachedToVisualTree(e); + } + + private void SetupScrollSync() + { + if (_editorScrollViewer != null) + _editorScrollViewer.PropertyChanged -= EditorScrollViewerOnPropertyChanged; + if (_previewScrollViewer != null) + _previewScrollViewer.PropertyChanged -= PreviewScrollViewerOnPropertyChanged; + + _editorScrollViewer = VisualExtensions.GetVisualChildrenOfType(DescriptionEditor).FirstOrDefault(); + _previewScrollViewer = VisualExtensions.GetVisualChildrenOfType(DescriptionPreview).FirstOrDefault(); + + if (_editorScrollViewer != null) + _editorScrollViewer.PropertyChanged += EditorScrollViewerOnPropertyChanged; + if (_previewScrollViewer != null) + _previewScrollViewer.PropertyChanged += PreviewScrollViewerOnPropertyChanged; + } + + private void EditorScrollViewerOnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e) + { + if (e.Property.Name != nameof(ScrollViewer.Offset) || _updating || SynchronizedScrolling.IsChecked != true) + return; + + try + { + _updating = true; + SynchronizeScrollViewers(_editorScrollViewer, _previewScrollViewer); + } + finally + { + _updating = false; + } + } + + private void PreviewScrollViewerOnPropertyChanged(object? sender, AvaloniaPropertyChangedEventArgs e) + { + if (e.Property.Name != nameof(ScrollViewer.Offset) || _updating || SynchronizedScrolling.IsChecked != true) + return; + + try + { + _updating = true; + SynchronizeScrollViewers(_previewScrollViewer, _editorScrollViewer); + } + finally + { + _updating = false; + } + } + + private void SynchronizeScrollViewers(ScrollViewer? source, ScrollViewer? target) + { + if (source == null || target == null) + return; + + double sourceScrollableHeight = source.Extent.Height - source.Viewport.Height; + double targetScrollableHeight = target.Extent.Height - target.Viewport.Height; + + if (sourceScrollableHeight != 0) + target.Offset = new Vector(target.Offset.X, targetScrollableHeight * (source.Offset.Y / sourceScrollableHeight)); + } +} \ No newline at end of file diff --git a/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseViewModel.cs b/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseViewModel.cs new file mode 100644 index 000000000..eb02f12b6 --- /dev/null +++ b/src/Artemis.UI/Screens/Workshop/Library/SubmissionReleaseViewModel.cs @@ -0,0 +1,124 @@ +using System; +using System.Reactive; +using System.Reactive.Disposables; +using System.Threading; +using System.Threading.Tasks; +using Artemis.UI.Screens.Workshop.Parameters; +using Artemis.UI.Shared.Routing; +using Artemis.UI.Shared.Services; +using Artemis.UI.Shared.Services.Builders; +using Artemis.WebClient.Workshop; +using Avalonia.Layout; +using AvaloniaEdit.Document; +using PropertyChanged.SourceGenerator; +using ReactiveUI; +using StrawberryShake; + +namespace Artemis.UI.Screens.Workshop.Library; + +public partial class SubmissionReleaseViewModel : RoutableScreen +{ + private readonly IWorkshopClient _client; + private readonly IRouter _router; + private readonly IWindowService _windowService; + private readonly INotificationService _notificationService; + private readonly ObservableAsPropertyHelper _hasChanges; + + [Notify] private IGetReleaseById_Release? _release; + [Notify] private string _changelog = string.Empty; + [Notify] private TextDocument? _markdownDocument; + + public SubmissionReleaseViewModel(IWorkshopClient client, IRouter router, IWindowService windowService, INotificationService notificationService) + { + _client = client; + _router = router; + _windowService = windowService; + _notificationService = notificationService; + _hasChanges = this.WhenAnyValue(vm => vm.Changelog, vm => vm.Release, (current, release) => current != release?.Changelog).ToProperty(this, vm => vm.HasChanges); + + Discard = ReactiveCommand.Create(ExecuteDiscard, this.WhenAnyValue(vm => vm.HasChanges)); + Save = ReactiveCommand.CreateFromTask(ExecuteSave, this.WhenAnyValue(vm => vm.HasChanges)); + + this.WhenActivated(d => + { + Disposable.Create(() => + { + if (MarkdownDocument != null) + MarkdownDocument.TextChanged -= MarkdownDocumentOnTextChanged; + }).DisposeWith(d); + }); + } + + public bool HasChanges => _hasChanges.Value; + public ReactiveCommand Discard { get; set; } + public ReactiveCommand Save { get; set; } + + public override async Task OnNavigating(ReleaseDetailParameters parameters, NavigationArguments args, CancellationToken cancellationToken) + { + IOperationResult result = await _client.GetReleaseById.ExecuteAsync(parameters.ReleaseId, cancellationToken); + Release = result.Data?.Release; + Changelog = Release?.Changelog ?? string.Empty; + + SetupMarkdownDocument(); + } + + public async Task DeleteRelease() + { + if (Release == null) + return; + + bool confirmed = await _windowService.ShowConfirmContentDialog( + "Delete release?", + "This cannot be undone.\r\n" + + "Users that have already downloaded this release will keep it."); + if (!confirmed) + return; + + await _client.RemoveRelease.ExecuteAsync(Release.Id); + _notificationService.CreateNotification() + .WithTitle("Deleted release.") + .WithSeverity(NotificationSeverity.Success) + .WithHorizontalPosition(HorizontalAlignment.Left) + .Show(); + + await Close(); + } + + public async Task Close() + { + await _router.GoUp(); + } + + private async Task ExecuteSave(CancellationToken cancellationToken) + { + if (Release == null) + return; + + await _client.UpdateRelease.ExecuteAsync(new UpdateReleaseInput {Id = Release.Id, Changelog = Changelog}, cancellationToken); + _notificationService.CreateNotification() + .WithTitle("Saved changelog.") + .WithSeverity(NotificationSeverity.Success) + .WithHorizontalPosition(HorizontalAlignment.Left) + .Show(); + } + + private void ExecuteDiscard() + { + Changelog = Release?.Changelog ?? string.Empty; + SetupMarkdownDocument(); + } + + private void SetupMarkdownDocument() + { + if (MarkdownDocument != null) + MarkdownDocument.TextChanged -= MarkdownDocumentOnTextChanged; + + MarkdownDocument = new TextDocument(new StringTextSource(Changelog)); + MarkdownDocument.TextChanged += MarkdownDocumentOnTextChanged; + } + + private void MarkdownDocumentOnTextChanged(object? sender, EventArgs e) + { + Changelog = MarkdownDocument?.Text ?? string.Empty; + } +} \ No newline at end of file diff --git a/src/Artemis.WebClient.Workshop/Mutations/UpdateEntry.graphql b/src/Artemis.WebClient.Workshop/Mutations/UpdateEntry.graphql index fe53ec3e5..1a667c53b 100644 --- a/src/Artemis.WebClient.Workshop/Mutations/UpdateEntry.graphql +++ b/src/Artemis.WebClient.Workshop/Mutations/UpdateEntry.graphql @@ -3,3 +3,16 @@ mutation UpdateEntry ($input: UpdateEntryInput!) { id } } + + +mutation UpdateRelease($input: UpdateReleaseInput!) { + updateRelease(input: $input) { + id + } +} + +mutation RemoveRelease($input: Long!) { + removeRelease(id: $input) { + id + } +} \ No newline at end of file diff --git a/src/Artemis.WebClient.Workshop/Queries/GetSubmittedEntryById.graphql b/src/Artemis.WebClient.Workshop/Queries/GetSubmittedEntryById.graphql index 1bcd98fd6..6aece2ca4 100644 --- a/src/Artemis.WebClient.Workshop/Queries/GetSubmittedEntryById.graphql +++ b/src/Artemis.WebClient.Workshop/Queries/GetSubmittedEntryById.graphql @@ -14,5 +14,10 @@ query GetSubmittedEntryById($id: Long!) { images { ...image } + releases { + id + version + createdAt + } } } \ No newline at end of file diff --git a/src/Artemis.WebClient.Workshop/WorkshopConstants.cs b/src/Artemis.WebClient.Workshop/WorkshopConstants.cs index 10807064c..907ddb843 100644 --- a/src/Artemis.WebClient.Workshop/WorkshopConstants.cs +++ b/src/Artemis.WebClient.Workshop/WorkshopConstants.cs @@ -2,10 +2,10 @@ namespace Artemis.WebClient.Workshop; public static class WorkshopConstants { - // public const string AUTHORITY_URL = "https://localhost:5001"; - // public const string WORKSHOP_URL = "https://localhost:7281"; - public const string AUTHORITY_URL = "https://identity.artemis-rgb.com"; - public const string WORKSHOP_URL = "https://workshop.artemis-rgb.com"; + public const string AUTHORITY_URL = "https://localhost:5001"; + public const string WORKSHOP_URL = "https://localhost:7281"; + // public const string AUTHORITY_URL = "https://identity.artemis-rgb.com"; + // public const string WORKSHOP_URL = "https://workshop.artemis-rgb.com"; public const string IDENTITY_CLIENT_NAME = "IdentityApiClient"; public const string WORKSHOP_CLIENT_NAME = "WorkshopApiClient"; } \ No newline at end of file diff --git a/src/Artemis.WebClient.Workshop/graphql.config.yml b/src/Artemis.WebClient.Workshop/graphql.config.yml index 9662a514f..a8ba99703 100644 --- a/src/Artemis.WebClient.Workshop/graphql.config.yml +++ b/src/Artemis.WebClient.Workshop/graphql.config.yml @@ -2,7 +2,7 @@ schema: schema.graphql extensions: endpoints: Default GraphQL Endpoint: - url: https://workshop.artemis-rgb.com/graphql + url: https://localhost:7281/graphql headers: user-agent: JS GraphQL introspect: true diff --git a/src/Artemis.WebClient.Workshop/schema.graphql b/src/Artemis.WebClient.Workshop/schema.graphql index 57c872355..f26e43af8 100644 --- a/src/Artemis.WebClient.Workshop/schema.graphql +++ b/src/Artemis.WebClient.Workshop/schema.graphql @@ -100,6 +100,7 @@ type Mutation { addLayoutInfo(input: CreateLayoutInfoInput!): LayoutInfo removeEntry(id: Long!): Entry removeLayoutInfo(id: Long!): LayoutInfo! + removeRelease(id: Long!): Release! updateEntry(input: UpdateEntryInput!): Entry updateEntryImage(input: UpdateEntryImageInput!): Image updateRelease(input: UpdateReleaseInput!): Release