Skip to content

Commit

Permalink
Admin UI: Switch from angular to flutter (#750)
Browse files Browse the repository at this point in the history
* feat: add Dockerfile

* chore: update path

* chore: remove cat

* fix: do not access platform in web

* fix: use kIsDesktop

* chore: remove release

* feat: add wasm headers

* fix: add wasm headers correctly

* chore: bump libs

* ci: add pub to dependabot config

* chore: bump transitive dependencies

* fix: better conditional import

* chore: do not build wasm

* chore: delete ClientApp

* ci: do not test / build ng app

* chore: remove node from Dockerfile

* chore: remove angular app from configs

* chore: use PathUrlStrategy

* fix: rewrite index.html to /splash

* fix: set the title for the MaterialApp

* chore: delete redundant .dockerignore file

* chore: update .dockerignore to exclude flutter-related files and config.json

* refactor: restructure Admin UI Dockerfile

* chore: add explaining comment for wasm headers

* chore: remove reviewers from dependabot.yml

---------

Co-authored-by: Julian König <[email protected]>
  • Loading branch information
tnotheis and jkoenig134 authored Jul 24, 2024
1 parent e896160 commit 3c913cb
Show file tree
Hide file tree
Showing 198 changed files with 124 additions and 26,615 deletions.
13 changes: 5 additions & 8 deletions .ci/aui/runChecks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
set -e
set -x

INITIAL_DIR=$(pwd)
cd AdminApi/src/AdminApi/ClientApp
npm ci
npx eslint --ext ts ./src
npx prettier --check .
npx license-check --ignorePackages [email protected]
npx better-npm-audit audit --exclude 1098115
cd $INITIAL_DIR
cd AdminUi
dart pub global activate melos
melos bootstrap
melos analyze
melos format
9 changes: 0 additions & 9 deletions .ci/aui/runFlutterChecks.sh

This file was deleted.

14 changes: 13 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,16 @@
**/appsettings.override.json
**/appsettings.override.*.json
LICENSE
README.md
README.md

# flutter
**/pubspec_overrides.yaml
**/.dart_tool
**/build
**/.flutter-plugins
**/.flutter-plugins-dependencies
**/.DS_Store

## config.json for connecting to the admin api
**/config.json
**/config.local.json
22 changes: 7 additions & 15 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ updates:
update-nuget-dependencies:
patterns:
- "*"
reviewers:
- "tnotheis"
labels:
- "dependencies"

Expand All @@ -23,8 +21,6 @@ updates:
update-github-actions-dependencies:
patterns:
- "*"
reviewers:
- "tnotheis"
labels:
- "dependencies"

Expand All @@ -37,26 +33,24 @@ updates:
update-npm-dependencies:
patterns:
- "*"
reviewers:
- "tnotheis"
ignore:
- dependency-name: "eslint"
update-types: ["version-update:semver-major"] # Ignore this until https://github.com/typescript-eslint/typescript-eslint/issues/8211 is fixed
labels:
- "dependencies"

##### Admin UI Angular App #####
- package-ecosystem: "npm"
directory: "/AdminApi/src/AdminApi/ClientApp"
##### Admin UI Flutter App#####
- package-ecosystem: "pub"
directories:
- "/AdminUi/apps/admin_ui"
- "/AdminUi/packages/admin_api_sdk"
- "/AdminUi/packages/admin_api_types"
schedule:
interval: "weekly"
groups:
update-npm-dependencies:
update-pub-dependencies:
patterns:
- "*"
reviewers:
- "tnotheis"
- "daniel-almeida-konkconsulting"
labels:
- "dependencies"

Expand All @@ -75,7 +69,5 @@ updates:
update-docker-dependencies:
patterns:
- "*"
reviewers:
- "tnotheis"
labels:
- "dependencies"
11 changes: 1 addition & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,13 @@ jobs:
adminui-checks:
runs-on: ubuntu-latest
name: Run Admin UI Checks
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Checks
run: ./.ci/aui/runChecks.sh

adminui-flutter-checks:
runs-on: ubuntu-latest
name: Run Admin UI Flutter Checks
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/[email protected]
- name: Run checks
run: ./.ci/aui/runFlutterChecks.sh
run: ./.ci/aui/runChecks.sh

check-formatting:
runs-on: ubuntu-latest
Expand Down
39 changes: 0 additions & 39 deletions AdminApi/src/AdminApi/AdminApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@

<PropertyGroup>
<IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot>
<SpaProxyServerUrl>http://localhost:8080</SpaProxyServerUrl>
<SpaProxyLaunchCommand>npm start</SpaProxyLaunchCommand>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OData" Version="8.2.5"/>
<PackageReference Include="Microsoft.AspNetCore.SpaProxy" Version="8.0.7"/>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.7">
<PrivateAssets>all</PrivateAssets>
Expand Down Expand Up @@ -47,41 +43,6 @@
<ProjectReference Include="..\AdminApi.Infrastructure.Database.SqlServer\AdminApi.Infrastructure.Database.SqlServer.csproj"/>
<ProjectReference Include="..\AdminApi.Infrastructure\AdminApi.Infrastructure.csproj"/>
</ItemGroup>
<ItemGroup>
<!-- Don't publish the SPA source files, but do show them in the project files list -->
<Content Remove="$(SpaRoot)**"/>
<None Remove="$(SpaRoot)**"/>
<None Include="$(SpaRoot)**" Exclude="$(SpaRoot)node_modules\**"/>
</ItemGroup>
<ItemGroup>
<Folder Include="ClientApp\src\"/>
</ItemGroup>

<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
<!-- Ensure Node.js is installed -->
<Exec Command="node --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode"/>
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE."/>
<Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..."/>
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install"/>
</Target>

<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install"/>
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build -- --configuration production"/>

<!-- Include the newly-built files in the publish output -->
<ItemGroup>
<DistFiles Include="$(SpaRoot)dist\**; $(SpaRoot)dist-server\**"/>
<ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" Exclude="@(ResolvedFileToPublish)">
<RelativePath>wwwroot\%(RecursiveDir)%(FileName)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
</ResolvedFileToPublish>
</ItemGroup>
</Target>

<Target Name="PreBuild" BeforeTargets="Build" Condition="$(Configuration) == Debug">
<Delete Files="$(ProjectDir)appsettings.override.json"/>
Expand Down
1 change: 0 additions & 1 deletion AdminApi/src/AdminApi/ClientApp/.dockerignore

This file was deleted.

7 changes: 0 additions & 7 deletions AdminApi/src/AdminApi/ClientApp/.eslintrc

This file was deleted.

41 changes: 0 additions & 41 deletions AdminApi/src/AdminApi/ClientApp/.gitignore

This file was deleted.

7 changes: 0 additions & 7 deletions AdminApi/src/AdminApi/ClientApp/LICENSE

This file was deleted.

27 changes: 0 additions & 27 deletions AdminApi/src/AdminApi/ClientApp/README.md

This file was deleted.

Loading

0 comments on commit 3c913cb

Please sign in to comment.