diff --git a/Flawless-Version-Control.sln.DotSettings.user b/Flawless-Version-Control.sln.DotSettings.user index 43be6a0..a45a8f4 100644 --- a/Flawless-Version-Control.sln.DotSettings.user +++ b/Flawless-Version-Control.sln.DotSettings.user @@ -19,6 +19,7 @@ ForceIncluded ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded ForceIncluded diff --git a/Flawless.Client/Flawless.Client.csproj b/Flawless.Client/Flawless.Client.csproj index ff3668f..31e24f5 100644 --- a/Flawless.Client/Flawless.Client.csproj +++ b/Flawless.Client/Flawless.Client.csproj @@ -26,6 +26,7 @@ + diff --git a/Flawless.Client/Service/Remote_Generated.cs b/Flawless.Client/Service/Remote_Generated.cs index 4d2356b..5aa48ed 100644 --- a/Flawless.Client/Service/Remote_Generated.cs +++ b/Flawless.Client/Service/Remote_Generated.cs @@ -202,24 +202,24 @@ namespace Flawless.Client.Remote /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. [Headers("Content-Type: application/json")] - [Post("/api/repo/{userName}/{repositoryName}/create_webhook")] - Task CreateWebhook(string userName, string repositoryName, [Body] WebhookCreateRequest body, CancellationToken cancellationToken = default); + [Post("/api/repo/{userName}/{repositoryName}/webhooks/create")] + Task Create(string userName, string repositoryName, [Body] WebhookCreateRequest body, CancellationToken cancellationToken = default); /// OK /// Thrown when the request returns a non-success status code. [Headers("Accept: text/plain, application/json, text/json")] - [Get("/api/repo/{userName}/{repositoryName}")] - Task> RepoGet(string userName, string repositoryName, CancellationToken cancellationToken = default); + [Get("/api/repo/{userName}/{repositoryName}/webhooks")] + Task> WebhooksGet(string userName, string repositoryName, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. - [Post("/api/repo/{userName}/{repositoryName}/{webhookId}/toggle")] + [Post("/api/repo/{userName}/{repositoryName}/webhooks/{webhookId}/toggle")] Task Toggle(string userName, string repositoryName, int webhookId, [Query] bool? activate, CancellationToken cancellationToken = default); /// A that completes when the request is finished. /// Thrown when the request returns a non-success status code. - [Delete("/api/repo/{userName}/{repositoryName}/{webhookId}")] - Task RepoDelete(string userName, string repositoryName, int webhookId, CancellationToken cancellationToken = default); + [Delete("/api/repo/{userName}/{repositoryName}/webhooks/{webhookId}")] + Task WebhooksDelete(string userName, string repositoryName, int webhookId, CancellationToken cancellationToken = default); /// OK /// Thrown when the request returns a non-success status code. @@ -855,16 +855,16 @@ namespace Flawless.Client.Remote [JsonPropertyName("publicEmail")] public bool? PublicEmail { get; set; } - - [JsonPropertyName("isActive")] - public bool IsActive { get; set; } - - [JsonPropertyName("isAdmin")] - public bool IsAdmin { get; set; } [JsonPropertyName("createdAt")] public System.DateTimeOffset? CreatedAt { get; set; } + [JsonPropertyName("isAdmin")] + public bool? IsAdmin { get; set; } + + [JsonPropertyName("isActive")] + public bool IsActive { get; set; } + } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.3.0.0 (NJsonSchema v11.2.0.0 (Newtonsoft.Json v13.0.0.0))")] diff --git a/Flawless.Client/Service/UserService.cs b/Flawless.Client/Service/UserService.cs index 73e70d3..733de43 100644 --- a/Flawless.Client/Service/UserService.cs +++ b/Flawless.Client/Service/UserService.cs @@ -45,7 +45,7 @@ public partial class UserService : BaseService user.CanEdit = info.Authorized; user.PhoneNumber = info.Phone; user.Email = info.Email; - user.IsAdmin = info.IsAdmin; + user.IsAdmin = info.IsAdmin ?? false; user.IsActive = info.IsActive; user.JoinDate = info.CreatedAt!.Value.LocalDateTime; @@ -81,7 +81,7 @@ public partial class UserService : BaseService user.CanEdit = info.Authorized; user.PhoneNumber = info.Phone; user.Email = info.Email; - user.IsAdmin = info.IsAdmin; + user.IsAdmin = info.IsAdmin ?? false; user.IsActive = info.IsActive; user.JoinDate = info.CreatedAt!.Value.LocalDateTime; } diff --git a/Flawless.Client/ViewModels/RepositoryViewModel.cs b/Flawless.Client/ViewModels/RepositoryViewModel.cs index dd1cf67..bb03ff4 100644 --- a/Flawless.Client/ViewModels/RepositoryViewModel.cs +++ b/Flawless.Client/ViewModels/RepositoryViewModel.cs @@ -12,13 +12,14 @@ using DynamicData; using DynamicData.Binding; using Flawless.Abstraction; using Flawless.Client.Models; +using Flawless.Client.Remote; using Flawless.Client.Service; using Flawless.Client.ViewModels.ModalBox; using Flawless.Client.Views.ModalBox; -using Flawless.Core.Modal; using ReactiveUI; using ReactiveUI.SourceGenerators; using Ursa.Controls; +using WorkspaceFile = Flawless.Core.Modal.WorkspaceFile; namespace Flawless.Client.ViewModels; @@ -136,6 +137,8 @@ public partial class RepositoryViewModel : RoutableViewModelBase public UserModel User { get; } + public ServerStatusResponse ServerStatus => Api.C.Status.Value!; + [Reactive] private bool _autoDetectChanges = true; [Reactive] private bool _isOwnerRole, _isDeveloperRole, _isReporterRole, _isGuestRole; diff --git a/Flawless.Client/Views/RepositoryPage/RepoSettingPageView.axaml b/Flawless.Client/Views/RepositoryPage/RepoSettingPageView.axaml index 80ef347..0e289eb 100644 --- a/Flawless.Client/Views/RepositoryPage/RepoSettingPageView.axaml +++ b/Flawless.Client/Views/RepositoryPage/RepoSettingPageView.axaml @@ -56,18 +56,16 @@