Skip to content

Commit

Permalink
Merge pull request #386 from NielsPilgaard/feature/membership
Browse files Browse the repository at this point in the history
Feature/membership
  • Loading branch information
NielsPilgaard authored Jun 26, 2024
2 parents 0692e96 + 82197c8 commit 37937cf
Show file tree
Hide file tree
Showing 95 changed files with 1,837 additions and 1,105 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: NillerMedDild
github: NielsPilgaard
2 changes: 1 addition & 1 deletion .github/workflows/website_frontend_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright/dotnet:v1.43.0-jammy
image: mcr.microsoft.com/playwright/dotnet:v1.44.0-jammy
options: --user 1001
steps:
- name: Checkout
Expand Down
7 changes: 0 additions & 7 deletions Jordnaer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jordnaer.Tests", "tests\web
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jordnaer.Benchmarks", "benchmarks\Jordnaer.Benchmarks\Jordnaer.Benchmarks.csproj", "{3C1DA78A-722B-485E-9D60-CC19ACFDA892}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jordnaer.AppHost", "src\shared\Jordnaer.AppHost\Jordnaer.AppHost.csproj", "{70C4F1A4-E46E-4D02-AE97-DF5E2C485C7F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -104,10 +102,6 @@ Global
{3C1DA78A-722B-485E-9D60-CC19ACFDA892}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C1DA78A-722B-485E-9D60-CC19ACFDA892}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C1DA78A-722B-485E-9D60-CC19ACFDA892}.Release|Any CPU.Build.0 = Release|Any CPU
{70C4F1A4-E46E-4D02-AE97-DF5E2C485C7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{70C4F1A4-E46E-4D02-AE97-DF5E2C485C7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{70C4F1A4-E46E-4D02-AE97-DF5E2C485C7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{70C4F1A4-E46E-4D02-AE97-DF5E2C485C7F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -127,7 +121,6 @@ Global
{06B65FD2-ABF3-4D58-9655-375C0C57B3C3} = {7326F14D-ADB6-4CB0-9AE4-2717133CED27}
{26821232-1D4D-4CA8-AA41-7605C42C373A} = {B4EAF579-8327-4B92-8357-8FF12C21755F}
{3C1DA78A-722B-485E-9D60-CC19ACFDA892} = {B7172579-75AE-4D50-9328-3B0D80252384}
{70C4F1A4-E46E-4D02-AE97-DF5E2C485C7F} = {659DB215-49CE-4C57-8823-56AFAE2DED72}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D91EE91A-4939-4C1D-830D-E09B985FBC2C}
Expand Down
1 change: 1 addition & 0 deletions Jordnaer.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=a9227dce_002D05ab_002D46a4_002D95ad_002Deec518412ed8/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Private, Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="constant_fields_should_be_upper_case"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Azurite/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Forsyningen/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=grafana/@EntryIndexedValue">True</s:Boolean>

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/Jordnaer.Benchmarks/Jordnaer.Benchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="Bogus" Version="35.5.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.6" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/container_apps/Jordnaer.Chat/Jordnaer.Chat.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand All @@ -11,12 +11,12 @@
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.1" />

<PackageReference Include="MassTransit.AspNetCore" Version="7.3.1" />
<PackageReference Include="MassTransit.Azure.ServiceBus.Core" Version="8.2.2" />
<PackageReference Include="MassTransit.Azure.ServiceBus.Core" Version="8.2.3" />

<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="7.2.0" />

<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.4">
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
18 changes: 0 additions & 18 deletions src/shared/Jordnaer.AppHost/Jordnaer.AppHost.csproj

This file was deleted.

10 changes: 0 additions & 10 deletions src/shared/Jordnaer.AppHost/Program.cs

This file was deleted.

16 changes: 0 additions & 16 deletions src/shared/Jordnaer.AppHost/Properties/launchSettings.json

This file was deleted.

9 changes: 0 additions & 9 deletions src/shared/Jordnaer.AppHost/appsettings.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Serilog.Exceptions" Version="8.4.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Serilog.Sinks.ElmahIo" Version="5.0.38" />
<PackageReference Include="Serilog.Sinks.ElmahIo" Version="5.1.43" />
<PackageReference Include="Serilog.Sinks.Grafana.Loki" Version="8.3.0" />
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="3.3.0" />
<PackageReference Include="Microsoft.FeatureManagement.AspNetCore" Version="3.3.1" />
<PackageReference Include="Microsoft.Azure.AppConfiguration.AspNetCore" Version="7.2.0" />
</ItemGroup>
</Project>
16 changes: 8 additions & 8 deletions src/shared/Jordnaer.Shared/Database/Enums/MembershipStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ namespace Jordnaer.Shared;
[EnumExtensions]
public enum MembershipStatus
{
[Display(Name = "Aktivt")]
Active = 0,
[Display(Name = "Aktivt")]
Active = 0,

[Display(Name = "Afventer svar")]
PendingApprovalFromGroup = 1,
[Display(Name = "Afventer svar fra gruppen")]
PendingApprovalFromGroup = 1,

[Display(Name = "Afventer svar")]
PendingApprovalFromUser = 2,
[Display(Name = "Afventer svar fra brugeren")]
PendingApprovalFromUser = 2,

[Display(Name = "Afvist")]
Rejected = 3
[Display(Name = "Afvist")]
Rejected = 3
}
13 changes: 9 additions & 4 deletions src/shared/Jordnaer.Shared/Database/Enums/OwnershipLevel.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
using System.ComponentModel.DataAnnotations;
using NetEscapades.EnumGenerators;

namespace Jordnaer.Shared;

[EnumExtensions]
public enum OwnershipLevel
{
None = 0,
Member = 1,
InheritsOwnership = 2,
Owner = 3
[Display(Name = "Ingen")]
None = 0,
[Display(Name = "Medlem")]
Member = 1,
[Display(Name = "Arver Ejerskab")]
InheritsOwnership = 2,
[Display(Name = "Ejer")]
Owner = 3
}
13 changes: 7 additions & 6 deletions src/shared/Jordnaer.Shared/Database/Enums/PermissionLevel.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
using NetEscapades.EnumGenerators;
using System.ComponentModel.DataAnnotations;

namespace Jordnaer.Shared;

[EnumExtensions]
[Flags]
public enum PermissionLevel
{
None = 1,
Read = 2,
Write = 4,
Moderator = 8,
Admin = 16
[Display(Name = "Ingen")]
None = 0,
[Display(Name = "Medlem")]
Write = 1,
[Display(Name = "Administrator")]
Admin = 2
}
4 changes: 2 additions & 2 deletions src/shared/Jordnaer.Shared/Groups/GroupSearchResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace Jordnaer.Shared;

public class GroupSearchResult
{
public List<GroupSlim> Groups { get; set; } = new();
public int TotalCount { get; set; }
public List<GroupSlim> Groups { get; set; } = [];
public int TotalCount { get; set; }
}
17 changes: 9 additions & 8 deletions src/shared/Jordnaer.Shared/Groups/GroupSlim.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ namespace Jordnaer.Shared;

public class GroupSlim
{
public Guid Id { get; set; }
public Guid Id { get; set; }

public required string Name { get; set; }
public required string Name { get; set; }

public string? ProfilePictureUrl { get; set; }
public string? ProfilePictureUrl { get; set; }

public required string ShortDescription { get; set; }
public required string ShortDescription { get; set; }
public required string? Description { get; set; }

public int? ZipCode { get; set; }
public string? City { get; set; }
public int? ZipCode { get; set; }
public string? City { get; set; }

public int MemberCount { get; set; }
public int MemberCount { get; set; }

public required string[] Categories { get; set; }
public required string[] Categories { get; set; }
}
9 changes: 5 additions & 4 deletions src/shared/Jordnaer.Shared/Jordnaer.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.4" />
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Abstractions" Version="8.0.6" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.5.0" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.6.0" />
<PackageReference Include="NetEscapades.EnumGenerators" Version="1.0.0-beta09" />
<PackageReference Include="Refit.HttpClientFactory" Version="7.0.0" />
<PackageReference Include="MassTransit.Abstractions" Version="8.2.2" />
<PackageReference Include="Refit.HttpClientFactory" Version="7.1.0" />
<PackageReference Include="MassTransit.Abstractions" Version="8.2.3" />
</ItemGroup>

<ItemGroup>
Expand Down
83 changes: 48 additions & 35 deletions src/shared/Jordnaer.Shared/UserSearch/DataForsyningenResponses.cs
Original file line number Diff line number Diff line change
@@ -1,49 +1,62 @@
// ReSharper disable All
namespace Jordnaer.Shared;

// ReSharper disable InconsistentNaming
public readonly record struct AddressAutoCompleteResponse(string? Tekst, Adresse? Adresse)
{
public override string ToString() => Tekst ?? string.Empty;
public override string ToString() => Tekst ?? string.Empty;
}

public readonly record struct Adresse(
string? Id,
int Status,
int Darstatus,
string? Vejkode,
string? Vejnavn,
string? Adresseringsvejnavn,
string? Husnr,
object? Etage,
object? Dør,
object? Supplerendebynavn,
string? Postnr,
string? Postnrnavn,
object? Stormodtagerpostnr,
object? Stormodtagerpostnrnavn,
string? Kommunekode,
string? Adgangsadresseid,
float X,
float Y,
string? Href
string? Id,
int Status,
int Darstatus,
string? Vejkode,
string? Vejnavn,
string? Adresseringsvejnavn,
string? Husnr,
object? Etage,
object? Dør,
object? Supplerendebynavn,
string? Postnr,
string? Postnrnavn,
object? Stormodtagerpostnr,
object? Stormodtagerpostnrnavn,
string? Kommunekode,
string? Adgangsadresseid,
float X,
float Y,
string? Href
);

public readonly record struct ZipCodeSearchResponse(
string? Href,
string? Nr,
string? Navn,
object? Stormodtageradresser,
float[]? Bbox,
float[]? Visueltcenter,
Kommuner[]? Kommuner,
DateTime Ændret,
DateTime Geo_Ændret,
int Geo_Version,
string? Dagi_Id
string? Href,
string? Nr,
string? Navn,
object? Stormodtageradresser,
float[]? Bbox,
float[]? Visueltcenter,
Kommuner[]? Kommuner,
DateTime Ændret,
DateTime Geo_Ændret,
int Geo_Version,
string? Dagi_Id
);

public readonly record struct Kommuner(
string? Href,
string? Kode,
string? Navn
string? Href,
string? Kode,
string? Navn
);

public readonly record struct ZipCodeAutoCompleteResponse(string? Tekst, Postnummer? Postnummer)
{
public override string ToString() => Tekst ?? string.Empty;
}

public readonly record struct Postnummer(
string? Nr,
string? Navn,
bool Stormodtager,
float Visueltcenter_x,
float Visueltcenter_y,
string? Href);
Loading

0 comments on commit 37937cf

Please sign in to comment.