mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Router - Added reload
Workshop - Added image management to existing entries Workshop - Fixed pagination in layouts page
This commit is contained in:
1 parent
19082481c3
commit
78b96deeab
25 files changed
+328
-100
No files matched your search
@@ -39,7 +39,10 @@
|
||||
<GraphQL Update="Queries\RemoveEntry.graphql">
|
||||
<Generator>MSBuild:GenerateGraphQLCode</Generator>
|
||||
</GraphQL>
|
||||
<GraphQL Update="Queries\UpdateEntry.graphql">
|
||||
<GraphQL Update="Mutations\UpdateEntry.graphql">
|
||||
<Generator>MSBuild:GenerateGraphQLCode</Generator>
|
||||
</GraphQL>
|
||||
<GraphQL Update="Mutations\UpdateEntryImage.graphql">
|
||||
<Generator>MSBuild:GenerateGraphQLCode</Generator>
|
||||
</GraphQL>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
public class ImageUploadRequest
|
||||
{
|
||||
public const long MAX_FILE_SIZE = 10 * 1024 * 1024; // 10 MB
|
||||
|
||||
public ImageUploadRequest(Stream file, string name, string? description)
|
||||
{
|
||||
File = file;
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1,5 @@
|
||||
mutation UpdateEntryImage ($id: UUID! $name: String! $description: String!) {
|
||||
updateEntryImage(input: {id: $id, name: $name description: $description}) {
|
||||
id
|
||||
}
|
||||
}
|
||||
@@ -11,5 +11,8 @@ query GetSubmittedEntryById($id: Long!) {
|
||||
layoutInfo {
|
||||
...layoutInfo
|
||||
}
|
||||
images {
|
||||
...image
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ public interface IWorkshopService
|
||||
Task<Stream?> GetEntryIcon(long entryId, CancellationToken cancellationToken);
|
||||
Task<ImageUploadResult> SetEntryIcon(long entryId, Stream icon, CancellationToken cancellationToken);
|
||||
Task<ImageUploadResult> UploadEntryImage(long entryId, ImageUploadRequest request, CancellationToken cancellationToken);
|
||||
Task DeleteEntryImage(Guid id, CancellationToken cancellationToken);
|
||||
Task<WorkshopStatus> GetWorkshopStatus(CancellationToken cancellationToken);
|
||||
Task<bool> ValidateWorkshopStatus(CancellationToken cancellationToken);
|
||||
Task NavigateToEntry(long entryId, EntryType entryType);
|
||||
|
||||
@@ -80,6 +80,14 @@ public class WorkshopService : IWorkshopService
|
||||
return ImageUploadResult.FromSuccess();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task DeleteEntryImage(Guid id, CancellationToken cancellationToken)
|
||||
{
|
||||
HttpClient client = _httpClientFactory.CreateClient(WorkshopConstants.WORKSHOP_CLIENT_NAME);
|
||||
HttpResponseMessage response = await client.DeleteAsync($"images/{id}", cancellationToken);
|
||||
response.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<IWorkshopService.WorkshopStatus> GetWorkshopStatus(CancellationToken cancellationToken)
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@ 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 WORKSHOP_CLIENT_NAME = "WorkshopApiClient";
|
||||
}
|
||||
@@ -53,6 +53,8 @@ type Entry {
|
||||
|
||||
type Image {
|
||||
description: String
|
||||
entry: Entry
|
||||
entryId: Long
|
||||
height: Int!
|
||||
id: UUID!
|
||||
mimeType: String!
|
||||
@@ -79,6 +81,7 @@ type Mutation {
|
||||
removeEntry(id: Long!): Entry
|
||||
removeLayoutInfo(id: Long!): LayoutInfo!
|
||||
updateEntry(input: UpdateEntryInput!): Entry
|
||||
updateEntryImage(input: UpdateEntryImageInput!): Image
|
||||
}
|
||||
|
||||
type Query {
|
||||
@@ -260,6 +263,8 @@ input EntryTypeOperationFilterInput {
|
||||
input ImageFilterInput {
|
||||
and: [ImageFilterInput!]
|
||||
description: StringOperationFilterInput
|
||||
entry: EntryFilterInput
|
||||
entryId: LongOperationFilterInput
|
||||
height: IntOperationFilterInput
|
||||
id: UuidOperationFilterInput
|
||||
mimeType: StringOperationFilterInput
|
||||
@@ -271,6 +276,8 @@ input ImageFilterInput {
|
||||
|
||||
input ImageSortInput {
|
||||
description: SortEnumType
|
||||
entry: EntrySortInput
|
||||
entryId: SortEnumType
|
||||
height: SortEnumType
|
||||
id: SortEnumType
|
||||
mimeType: SortEnumType
|
||||
@@ -418,6 +425,12 @@ input TagFilterInput {
|
||||
or: [TagFilterInput!]
|
||||
}
|
||||
|
||||
input UpdateEntryImageInput {
|
||||
description: String!
|
||||
id: UUID!
|
||||
name: String!
|
||||
}
|
||||
|
||||
input UpdateEntryInput {
|
||||
categories: [Long!]!
|
||||
description: String!
|
||||
|
||||
Reference in new issue
Block a user