Skip to content

Commit

Permalink
Merge pull request #60 from bennetrr/main
Browse files Browse the repository at this point in the history
Release
  • Loading branch information
bennetrr authored Aug 11, 2024
2 parents be3fbdd + 9aeae6d commit c559b53
Show file tree
Hide file tree
Showing 87 changed files with 3,773 additions and 1,946 deletions.
4 changes: 0 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,3 @@ indent_size = 4
charset = unset
indent_size = unset
indent_style = unset

[src/backend/Bennetr.BrickInv.Api/Bennetr.BrickInv.Api/Services/Email/*.cs]
indent_size = unset
trim_trailing_whitespace = false
31 changes: 23 additions & 8 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,24 @@ jobs:
run: |
npx eclint check .
prettier:
name: Lint frontend with prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Run prettier
working-directory: src/frontend
run: |
npx prettier --check .
eslint:
name: Lint frontend with eslint
runs-on: ubuntu-latest
permissions:
security-events: write
pull-requests: write
checks: write
contents: read
steps:
- uses: actions/checkout@v4
Expand All @@ -36,18 +49,20 @@ jobs:
with:
node-version-file: src/frontend/package.json
cache-dependency-path: src/frontend/pnpm-lock.yaml
cache: 'pnpm'
cache: pnpm

- name: Install dependencies
working-directory: src/frontend
run: |
pnpm install
pnpm install --frozen-lockfile
- name: Run eslint
uses: sibiraj-s/action-eslint@v3.0.1
working-directory: src/frontend
run: |
pnpm lint --format json --output-file result.json
- name: Upload eslint results
if: always()
uses: ldiego73/eslint-report-action@v1.1
with:
working-directory: src/frontend
token: ${{ secrets.GITHUB_TOKEN }}
all-files: true
eslint-args: '--report-unused-disable-directives --max-warnings 0'
annotations: true
report: src/frontend/result.json
6 changes: 0 additions & 6 deletions .idea/GitLink.xml

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/brickinv.iml

This file was deleted.

36 changes: 1 addition & 35 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

5 changes: 1 addition & 4 deletions setup.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
CREATE
DATABASE IF NOT EXISTS identity;
CREATE
DATABASE IF NOT EXISTS brickinv;
CREATE DATABASE IF NOT EXISTS brickinv;
5 changes: 0 additions & 5 deletions src/backend/Bennetr.BrickInv.Api/.config/dotnet-tools.json

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using Bennetr.RebrickableDotNet.Models.Minifigs;
using Bennetr.RebrickableDotNet.Models.Parts;
using Bennetr.RebrickableDotNet.Models.Sets;
using Clerk.Net.Client;
using Mapster;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -128,7 +127,6 @@ public async Task<ActionResult<SetDto>> CreateSet([FromBody] CreateSetRequest re
SetName = rebrickableSet.Name,
ReleaseYear = rebrickableSet.Year,
ImageUri = new Uri(rebrickableSet.SetImgUrl),
TotalParts = rebrickableSet.NumParts,
PresentParts = 0,
Finished = false,
ForSale = request.ForSale,
Expand All @@ -149,20 +147,22 @@ public async Task<ActionResult<SetDto>> CreateSet([FromBody] CreateSetRequest re
ImageUri = x.Part.PartImgUrl is null ? null : new Uri(x.Part.PartImgUrl),
TotalCount = x.Quantity,
PresentCount = 0
}).Concat(
rebrickableMinifigs.Results
.Select(x => new Part
{
Id = Guid.NewGuid().ToString(),
Set = set,
Created = DateTime.Now,
Updated = DateTime.Now,
PartId = x.SetNum,
PartName = x.SetName,
ImageUri = new Uri(x.SetImgUrl),
TotalCount = x.Quantity,
PresentCount = 0
}));
})
.Concat(rebrickableMinifigs.Results.Select(x => new Part
{
Id = Guid.NewGuid().ToString(),
Set = set,
Created = DateTime.Now,
Updated = DateTime.Now,
PartId = x.SetNum,
PartName = x.SetName,
ImageUri = new Uri(x.SetImgUrl),
TotalCount = x.Quantity,
PresentCount = 0
}))
.ToList();

set.TotalParts = parts.Select(x => x.TotalCount).Sum();

context.Sets.Add(set);
context.Parts.AddRange(parts);
Expand Down
Loading

0 comments on commit c559b53

Please sign in to comment.