Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0f8b297
Get badge file from github api.
hootanht Mar 26, 2023
185d620
Re factor GetBadgeAsync method.
hootanht Mar 28, 2023
b7c1306
Implement GetBadgesAsync method.
hootanht Mar 28, 2023
8b70fd7
Re factor GetBadgesAsync.
hootanht Mar 29, 2023
4d679b1
Add some exception management to GitHubBadgeService
mehrandvd Mar 29, 2023
e1c306a
Add documentation description for ResourceNotFoundException
zahra219 Mar 29, 2023
1b78e23
Add FileContentIsNullException to AppStrings
zahra219 Mar 29, 2023
d8636aa
Add FileContentIsNullException type
zahra219 Mar 29, 2023
32f2a9a
Revert "Add FileContentIsNullException type"
zahra219 Mar 29, 2023
0c66788
Add FileContentIsNullException type
zahra219 Mar 29, 2023
99047d8
Refactor GetBadgesAsync
zahra219 Mar 29, 2023
97931d3
Remove unrelated validation in badge loading test
zahra-ahangari Mar 29, 2023
0d7759a
Added a new badge file.
BSeyfi Mar 30, 2023
b18446d
Specify the exception type
BSeyfi Mar 30, 2023
a0ce4e8
Improve GetBadgeAsync documentation
BSeyfi Mar 30, 2023
3b2209d
Add badge file
BSeyfi Mar 30, 2023
af8b10c
Fix repo auth with user name and fix request work with branch.
hootanht Mar 30, 2023
edb1f2f
Merge branch 'feature/initial-get-badge-system' of https://github.com…
BSeyfi Mar 30, 2023
2d3a55f
Improve `GetBranchNameFromUrl` method
BSeyfi Mar 30, 2023
559cec3
Throw exception when branch not found
BSeyfi Mar 30, 2023
9ad06ad
Add new json file
vahid-1992 Apr 1, 2023
0ecf987
Complete GetBadgeAsync test scenarios
vahid-1992 Apr 1, 2023
7c735fb
Add TestInitialize and configurationService to Test project.
hootanht Apr 1, 2023
68f04e9
Refactor GitHubService signatures
mehrandvd Apr 3, 2023
dfad82a
Refactor GitHubBadgeService after first review
zahra-ahangari Apr 4, 2023
f1f0f84
Refactor GetBadgeAsync
BSeyfi Apr 5, 2023
d20f211
Complete Test Methods
BSeyfi Apr 5, 2023
f70c45f
fix injection of GitHub client.
hootanht Apr 5, 2023
adc35d7
Fix conflict.
hootanht Apr 5, 2023
92efe59
Remove to dos we don't need that anymore.
hootanht Apr 6, 2023
4e5e52b
Complete GetBadgeAsync Tests
BSeyfi Apr 8, 2023
96e4856
Change property declaration.
hootanht Apr 9, 2023
1021893
Add BadgeTree Component.
hootanht Apr 9, 2023
9fba883
Add BitBasicList to BadgeTree.
hootanht Apr 10, 2023
72acaf0
Add GetLightBadgesAsync test methods
BSeyfi Apr 10, 2023
bcffb92
Add and implement BadgeContent component
zahra-ahangari Apr 12, 2023
c303e9d
Add documentation to IGitHubBadgeService and GitHubBadgeService
BSeyfi Apr 12, 2023
2b93a00
Add GitHubBadgeService private methods doc
vahid-1992 Apr 13, 2023
138456a
Fix rate limit exception.
hootanht Apr 22, 2023
f2a6f53
Add new token.
hootanht Apr 22, 2023
147beec
Add new token.
hootanht Apr 22, 2023
b2c3fe1
Add new token.
hootanht Apr 22, 2023
5c15c7e
Merge branch 'feature/initial-get-badge-system' into feature/intial-b…
hootanht Apr 22, 2023
27906a6
Merge branch 'feature/intial-badge-component' of https://github.com/h…
hootanht Apr 22, 2023
ef850a1
Update code documentation
BSeyfi Apr 22, 2023
4308a99
Add more styles to components
zahra-ahangari Apr 22, 2023
2057718
Merge branch 'feature/intial-badge-component' of https://github.com/h…
zahra-ahangari Apr 22, 2023
7a0c535
Merge branch 'feature/initial-get-badge-system' into feature/intial-b…
hootanht Apr 22, 2023
429351b
Fix small UI bug in Badge Tree.
hootanht Apr 22, 2023
f430ab0
Fix Badge click.
hootanht Apr 25, 2023
f9d9776
Set up CI with Azure Pipelines
afshinalizadeh Apr 28, 2023
88a9fe2
Update azure-pipelines.yml for Azure Pipelines
afshinalizadeh Apr 28, 2023
f6fca57
Update azure-pipelines.yml for Azure Pipelines
afshinalizadeh Apr 28, 2023
239745e
Update azure-pipelines.yml for Azure Pipelines
afshinalizadeh Apr 28, 2023
2756121
Update azure-pipelines.yml for Azure Pipelines
afshinalizadeh Apr 28, 2023
184f8e9
Update azure-pipelines.yml for Azure Pipelines
afshinalizadeh Apr 28, 2023
db3585a
Update azure-pipelines.yml for Azure Pipelines
afshinalizadeh Apr 28, 2023
6fb5e1f
Create Dockerfile
afshinalizadeh Apr 28, 2023
3b5139b
Update azure-pipelines.yml for Azure Pipelines
afshinalizadeh Apr 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0
WORKDIR /app
COPY publish ./
ENTRYPOINT ["dotnet", "CrystallineSociety.Server.Api.dll"]
92 changes: 92 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: $(version).$(Build.BuildId)

variables:
WEB_APP_DEPLOYMENT_TYPE: 'DefaultDeploymentType'

jobs:

- job: build_blazor_api_wasm
displayName: 'build blazor api + web assembly'

pool:
vmImage: 'ubuntu-latest'

steps:

- task: Assembly-Info-NetCore@3
displayName: 'Set Assembly Manifest Data'
inputs:
Company: Cs Internship
Product: Cs System
VersionNumber: '$(Build.BuildNumber)'
FileVersionNumber: '$(Build.BuildNumber)'
InformationalVersion: '$(Build.BuildNumber)'
PackageVersion: '$(Build.BuildNumber)'

- task: UseDotNet@2
displayName: 'Setup .NET'
inputs:
useGlobalJson: true
workingDirectory: 'src'

- task: UseDotNet@2
displayName: 'Use dotnet sdk 6.x for LibSassBuilder'
inputs:
version: 6.x

- task: Bash@3
displayName: 'Restore workloads'
inputs:
targetType: 'inline'
script: 'dotnet workload restore src/CrystallineSociety/Client/Web/CrystallineSociety.Client.Web.csproj -p:BlazorMode=BlazorWebAssembly'

- task: Bash@3
displayName: 'Switch to blazor web assembly'
inputs:
targetType: 'inline'
script: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/CrystallineSociety/Client/Web/CrystallineSociety.Client.Web.csproj
- task: Bash@3
displayName: 'Build migrations bundle'
inputs:
targetType: 'inline'
script: |
dotnet tool install --global dotnet-ef --version 7.0.0
dotnet ef migrations bundle --self-contained -r linux-x64 --project src/CrystallineSociety/Server/Api/CrystallineSociety.Server.Api.csproj
failOnStderr: true
- task: Bash@3
displayName: 'Install wasm-tools'
inputs:
targetType: 'inline'
script: dotnet workload install wasm-tools

- task: Bash@3
displayName: 'Build (To generate CSS/JS files)'
inputs:
targetType: 'inline'
script: 'dotnet build src/CrystallineSociety/Client/Web/CrystallineSociety.Client.Web.csproj -p:Configuration=Release -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ variables.WEB_APP_DEPLOYMENT_TYPE }}"'

- task: Bash@3
displayName: 'Publish'
inputs:
targetType: 'inline'
script: 'dotnet publish src/CrystallineSociety/Server/Api/CrystallineSociety.Server.Api.csproj -p:BlazorMode=BlazorWebAssembly -p:WebAppDeploymentType="${{ variables.WEB_APP_DEPLOYMENT_TYPE }}" -p:Configuration=Release -o api-web'

- task: PublishPipelineArtifact@1
displayName: Upload api-web artifact
inputs:
targetPath: 'api-web'
artifact: 'api-web-bundle'
publishLocation: 'pipeline'

- task: PublishPipelineArtifact@1
displayName: Upload ef migrations bundle
inputs:
targetPath: 'efbundle'
artifact: 'migrations-bundle'
publishLocation: 'pipeline'
- task: PublishPipelineArtifact@1
inputs:
targetPath: 'Dockerfile'
artifact: 'Docker'
publishLocation: 'pipeline'

15 changes: 15 additions & 0 deletions src/CrystallineSociety/Client/Shared/Components/BadgeContent.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@using CrystallineSociety.Shared.Dtos.BadgeSystem
@inherits AppComponentBase

@if (Badge != null)
{
<div style="background-color: lightskyblue; width: 50%; border-radius: 10px; padding: 5px;">
<h3 style="margin: 0 0 5px; padding: 0px;">Badge Content</h3>
<p>Badge Code : @Badge.Code</p>
<br />
<p>Badge Level : @Badge.Level</p>
<br />
<p>Badge Description : @Badge.Description</p>
</div>
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using CrystallineSociety.Shared.Dtos.BadgeSystem;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CrystallineSociety.Client.Shared.Components
{
public partial class BadgeContent
{
[Parameter] public BadgeDto? Badge { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div>
Tada from Badge System
@using CrystallineSociety.Shared.Dtos.BadgeSystem
@inherits AppComponentBase

<div style="display: flex; gap: 15px;align-items: center;">
<BadgeTree BadgeBundleDto="Bundle" BadgeDtoCallBack=@GetBadge></BadgeTree>
<BadgeContent Badge="BadgeDto"></BadgeContent>
</div>
<pre>
@GetBundleText(Bundle)
</pre>
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ public partial class BadgeSystem
[AutoInject] private IBadgeSystemService BadgeSystemService { get; set; } = default!;
[AutoInject] private IBadgeUtilService BadgeUtilService { get; set; } = default!;
[Parameter] public BadgeBundleDto? Bundle { get; set; }
private BadgeDto? BadgeDto {get; set;}


protected override Task OnInitializedAsync()
{
return base.OnInitializedAsync();
}

private string? GetBundleText(BadgeBundleDto bundle)
{
var builder = new StringBuilder();
Expand All @@ -35,5 +31,10 @@ protected override Task OnInitializedAsync()

return builder.ToString();
}

private void GetBadge(BadgeDto badgeDto)
{
BadgeDto = badgeDto;
}
}
}
16 changes: 16 additions & 0 deletions src/CrystallineSociety/Client/Shared/Components/BadgeTree.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@using CrystallineSociety.Shared.Dtos.BadgeSystem
@inherits AppComponentBase

@if (Badges != null)
{
<BitBasicList TItem="BadgeDto"
ItemSize="4"
Items="Badges"
Style="border: 1px #a19f9d solid; border-radius: 10px; height: auto; width: 50%">
<RowTemplate Context="badge">
<div style="border-bottom: 1px #8a8886 solid; padding: 5px 20px;" class="badge-row" @onclick="() => OnBadgeClick(badge)">
<div class="badge-name-color">Name: <strong>@badge.Code</strong></div>
</div>
</RowTemplate>
</BitBasicList>
}
32 changes: 32 additions & 0 deletions src/CrystallineSociety/Client/Shared/Components/BadgeTree.razor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using CrystallineSociety.Shared.Dtos.BadgeSystem;

namespace CrystallineSociety.Client.Shared.Components
{
public partial class BadgeTree
{
[Parameter] public BadgeBundleDto? BadgeBundleDto { get; set; }
[Parameter] public EventCallback<BadgeDto> BadgeDtoCallBack { get; set; }

private List<BadgeDto>? Badges { get; set; }

protected override Task OnParamsSetAsync()
{
if (BadgeBundleDto != null)
{
Badges = BadgeBundleDto.Badges.ToList();
}
return base.OnParamsSetAsync();
}

private async Task OnBadgeClick(BadgeDto badgeDto)
{
await BadgeDtoCallBack.InvokeAsync(badgeDto);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.list {
border: 1px #a19f9d solid;
border-radius: 3px;
height: auto;
}

.badge-row {

&:hover {
cursor: pointer;
background-color: lightskyblue;

div {
color: black;
}
}

.badge-name-color {
color: white;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
@using CrystallineSociety.Shared.Dtos.BadgeSystem
@inherits AppComponentBase

<div>
<BitLabel>GitHub URL:</BitLabel>
<BitTextField @bind-Value="GitHubUrl"/>
<BitButton OnClick="LoadBadgeSystem">Load Badge System</BitButton>
<BitLabel>@GitHubUrl</BitLabel>
<div style="padding: 50px; width: 100%;">
<div style="width: 100%;">
<BitLabel Style="color: white;">GitHub URL:</BitLabel>
<div style="display: flex;">
<BitTextField Style="width: 100%" @bind-Value="GitHubUrl" />
<BitIconButton Style="color:white; background-color: transparent;" IconName="BitIconName.Search" OnClick="LoadBadgeSystem" />
</div>
</div>
<BitLabel Style="color: white; margin: 20px 0;">@GitHubUrl</BitLabel>
<BadgeSystem Bundle="Bundle"></BadgeSystem>
</div>
Loading