-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Admin UI: Initialize flutter setup (#547)
* chore: update settings.json with dart * chore: add readme * fix: git-un-ignore adminui packages * chore: add initial flutter setup * feat: add adminui boilerplate * feat: add types * feat: add sdk * feat: use client in the app * chore: move AdminUI to AdminUI folder * fix: allow internet access for the mac app * chore: add setup for configs * feat: async creation of client * chore: update mac icons * chore: change name from admin_ui to AdminUI * feat: add window_size plugin * fix: use empty baseurl for web * feat: add shared preferences * feat: add routing * feat: add packages * chore: move AdminUI to AdminUi * chore: add packages * chore: move stuff * chore: ignore again * chore: simplify logout * chore: make more readable * fix: check for api key validity * chore: do not copy code from go_router package * fix: use enmeshed logo as svg * chore: update default window size on macos * chore: yeet unused launch config * chore: update extensions * fix: obscure text in pw field * chore: add tier get and delete endpoints * feat: add quota types and endpoints * feat: add quota endpoint * chore format * wip * chore: wip * chore: update identity * chore: update, change method name and type * chore: remove unnecessary imports * feat: add relationships type and endpoint * ci: move runAdminUiChecks to aui folder and rename it to runChecks * ci: add and execute runFlutterChecks script * ci: rename flutter checks jobs * ci: use correct script folder and name * chore: simplify relationship type * chore: finalize identities odata * chore: add separate get and make result for odata * chore: comment now follows flutter style to-do * chore: simplify relationship endpoint * chore: show the results of getting the data * ci: trigger pipelines * chore: add some basic pagination * chore: add filtering for odata * chore: add filtering example * chore: export identity overview filter * fix: syntax * chore: bump melos * chore: use builtin melos analyze command * refactor: identities * chore: add types to dependencies * refactor: move enum * chore: rename parameters * feat: add identity overview * chore: display only identity overview * chore: add trailing comma and add named parameter * refactor: use port 8082 for local testing * chore: remove UI code * fix: make pagination usable * chore: remove comment * fix: early return * refactor: make pretty * chore: remove unused file --------- Co-authored-by: Vladimir Vuckovic <[email protected]> Co-authored-by: Timo Notheisen <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
3b712b5
commit c840c4d
Showing
125 changed files
with
5,576 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
cd AdminUi | ||
dart pub global activate melos | ||
melos bootstrap | ||
melos analyze | ||
melos format |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,18 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run Checks | ||
run: ./.ci/runAdminUiChecks.sh | ||
run: ./.ci/aui/runChecks.sh | ||
|
||
run-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 | ||
|
||
check-formatting: | ||
runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"recommendations": ["ms-azuretools.vscode-docker", "ms-dotnettools.csdevkit"] | ||
"recommendations": ["ms-azuretools.vscode-docker", "Dart-Code.flutter", "Dart-Code.dart-code"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
pubspec_overrides.yaml | ||
.dart_tool | ||
build | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.DS_Store | ||
|
||
# config.json for connecting to the admin api | ||
config.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Admin UI | ||
|
||
## Development Guide | ||
|
||
### Prerequisites | ||
|
||
- [Flutter](https://flutter.dev/docs/get-started/install) (we are using the `stable` channel) | ||
- [melos](https://melos.invertase.dev/getting-started) | ||
|
||
TLDR: `dart pub global activate melos` | ||
|
||
Make sure to [add the system cache bin directory to your path](https://dart.dev/tools/pub/cmd/pub-global#running-a-script-from-your-path) (`$HOME/.pub-cache/bin` for mac and linux and `%LOCALAPPDATA%\Pub\Cache\bin` for most Windows versions). | ||
|
||
### Getting Started | ||
|
||
Run `melos bootstrap` to [install and link dependencies](https://melos.invertase.dev/commands/bootstrap) in all packages and apps. | ||
|
||
### Melos scripts | ||
|
||
For an overview of all available melos scripts, run `melos run` or `melos run --help`. | ||
|
||
### Configuration | ||
|
||
Create a file `AdminUI/config.json` with the following content: | ||
|
||
```json | ||
{ | ||
"BASE_URL": "...", | ||
"API_KEY": "..." | ||
} | ||
``` | ||
|
||
This configuration is automatically used when using the VSCode tooling (run / debug buttons). | ||
|
||
For building and running the app from the command line, you can use the `--dart-define-from-file=<path-to-file>` flag. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
include: package:very_good_analysis/analysis_options.yaml | ||
|
||
linter: | ||
rules: | ||
lines_longer_than_80_chars: false | ||
sort_constructors_first: false | ||
public_member_api_docs: false | ||
always_use_package_imports: false | ||
avoid_setters_without_getters: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Miscellaneous | ||
*.class | ||
*.log | ||
*.pyc | ||
*.swp | ||
.DS_Store | ||
.atom/ | ||
.buildlog/ | ||
.history | ||
.svn/ | ||
migrate_working_dir/ | ||
|
||
# IntelliJ related | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.idea/ | ||
|
||
# The .vscode folder contains launch configuration and tasks you configure in | ||
# VS Code which you may wish to be included in version control, so this line | ||
# is commented out by default. | ||
#.vscode/ | ||
|
||
# Flutter/Dart/Pub related | ||
**/doc/api/ | ||
**/ios/Flutter/.last_build_id | ||
.dart_tool/ | ||
.flutter-plugins | ||
.flutter-plugins-dependencies | ||
.pub-cache/ | ||
.pub/ | ||
/build/ | ||
|
||
# Symbolication related | ||
app.*.symbols | ||
|
||
# Obfuscation related | ||
app.*.map.json | ||
|
||
# Android Studio will place build artifacts here | ||
/android/app/debug | ||
/android/app/profile | ||
/android/app/release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file tracks properties of this Flutter project. | ||
# Used by Flutter tool to assess capabilities and perform upgrades etc. | ||
# | ||
# This file should be version controlled and should not be manually edited. | ||
|
||
version: | ||
revision: "abb292a07e20d696c4568099f918f6c5f330e6b0" | ||
channel: "stable" | ||
|
||
project_type: app | ||
|
||
# Tracks metadata for the flutter migrate command | ||
migration: | ||
platforms: | ||
- platform: root | ||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 | ||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 | ||
- platform: macos | ||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 | ||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 | ||
- platform: web | ||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 | ||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 | ||
- platform: windows | ||
create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 | ||
base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 | ||
|
||
# User provided section | ||
|
||
# List of Local paths (relative to this file) that should be | ||
# ignored by the migrate tool. | ||
# | ||
# Files that are not part of the templates will be ignored by default. | ||
unmanaged_files: | ||
- 'lib/main.dart' | ||
- 'ios/Runner.xcodeproj/project.pbxproj' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# admin_ui | ||
|
||
The Enmeshed Backbone Admin UI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include: ../../analysis_options.yaml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class Dashboard extends StatefulWidget { | ||
const Dashboard({super.key}); | ||
|
||
@override | ||
State<Dashboard> createState() => _DashboardState(); | ||
} | ||
|
||
class _DashboardState extends State<Dashboard> { | ||
@override | ||
Widget build(BuildContext context) { | ||
return const Placeholder(); | ||
} | ||
} | ||
|
||
class Identities extends StatelessWidget { | ||
const Identities({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Placeholder(); | ||
} | ||
} | ||
|
||
class Tiers extends StatelessWidget { | ||
const Tiers({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Placeholder(); | ||
} | ||
} | ||
|
||
class Clients extends StatelessWidget { | ||
const Clients({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return const Placeholder(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:go_router/go_router.dart'; | ||
|
||
import 'home/home.dart'; | ||
import 'pages/pages.dart'; | ||
import 'setup/setup_desktop.dart' if (dart.library.html) 'setup/setup_web.dart'; | ||
|
||
void main() async { | ||
WidgetsFlutterBinding.ensureInitialized(); | ||
|
||
await setup(); | ||
|
||
runApp(const MainApp()); | ||
} | ||
|
||
final _rootNavigatorKey = GlobalKey<NavigatorState>(); | ||
final _shellNavigatorKey = GlobalKey<NavigatorState>(); | ||
|
||
final _router = GoRouter( | ||
initialLocation: '/splash', | ||
navigatorKey: _rootNavigatorKey, | ||
routes: [ | ||
GoRoute( | ||
parentNavigatorKey: _rootNavigatorKey, | ||
path: '/splash', | ||
builder: (context, state) => const SplashScreen(), | ||
), | ||
GoRoute( | ||
parentNavigatorKey: _rootNavigatorKey, | ||
path: '/login', | ||
builder: (context, state) => const LoginScreen(), | ||
), | ||
ShellRoute( | ||
navigatorKey: _shellNavigatorKey, | ||
parentNavigatorKey: _rootNavigatorKey, | ||
routes: [ | ||
GoRoute( | ||
parentNavigatorKey: _shellNavigatorKey, | ||
path: '/dashboard', | ||
pageBuilder: (context, state) => const NoTransitionPage(child: Dashboard()), | ||
), | ||
GoRoute( | ||
parentNavigatorKey: _shellNavigatorKey, | ||
path: '/identities', | ||
pageBuilder: (context, state) => const NoTransitionPage(child: Identities()), | ||
), | ||
GoRoute( | ||
parentNavigatorKey: _shellNavigatorKey, | ||
path: '/tiers', | ||
pageBuilder: (context, state) => const NoTransitionPage(child: Tiers()), | ||
), | ||
GoRoute( | ||
parentNavigatorKey: _shellNavigatorKey, | ||
path: '/clients', | ||
pageBuilder: (context, state) => const NoTransitionPage(child: Clients()), | ||
), | ||
], | ||
builder: (context, state, child) => HomeScreen( | ||
location: state.fullPath!, | ||
child: child, | ||
), | ||
), | ||
], | ||
); | ||
|
||
class MainApp extends StatelessWidget { | ||
const MainApp({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
const colorSchemeSeed = Color.fromARGB(255, 23, 66, 141); | ||
return MaterialApp.router( | ||
debugShowCheckedModeBanner: false, | ||
themeMode: ThemeMode.light, | ||
theme: ThemeData(colorSchemeSeed: colorSchemeSeed, useMaterial3: true), | ||
darkTheme: ThemeData(brightness: Brightness.dark, colorSchemeSeed: colorSchemeSeed, useMaterial3: true), | ||
routerConfig: _router, | ||
); | ||
} | ||
} |
Oops, something went wrong.