Skip to content

Commit

Permalink
Profile page needs to support theme, currently commented out.
Browse files Browse the repository at this point in the history
me/tokens action is redundant when using Jetstream
Send available locales and the current theme with every Inertia request.
Going back to using the Jetstream built in profile components.
Delete me/tokens js, because we can just use the Jetstream API key management.
Slow and arduous conversion of Jetstream components from tailwind styling into bootstrap styling (INCOMPLETE)
Experimental vue/codemirror6 editor for GraphQL
Changed inertia layout to support dynamic title
Changed inertia layout to include current page component (assume i was trying to modularise the inertia support)
Ignore xdebug and phpinfo files for debugging
Add codegen for client side TypeScript typing of GQL API
Minor update dependencies, include TS support for Vue3
  • Loading branch information
mosen committed Dec 11, 2023
1 parent 9489f47 commit 662ff18
Show file tree
Hide file tree
Showing 27 changed files with 757 additions and 413 deletions.
15 changes: 11 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,21 @@ storage/oauth-public.key
storage/*.index
storage/public/app/*

# Lighthouse-PHP Generated Helper Definitions
programmatic-types.graphql
schema-directives.graphql
_lighthouse_ide_helper.php


# Laravel mix / Webpack output
public/js/*.js
public/css/*.css

# Azure Deployment Parameters
parameters.json

# Local Development Only
public/phpinfo.php
public/xdebug.php
public/hot

# Lighthouse-PHP Generated Helper Definitions
programmatic-types.graphql
schema-directives.graphql
_lighthouse_ide_helper.php
6 changes: 5 additions & 1 deletion app/Actions/Fortify/UpdateUserProfileInformation.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ public function update(User $user, array $input): void
$user->forceFill([
'name' => $input['name'],
'email' => $input['email'],
'locale' => $input['locale'],
'locale' => $input['locale'] ?? 'en',
])->save();
}

// TODO:
// 'locale' => $request->getLocale(),
// 'current_theme' => $request->session()->get('theme', config('_munkireport.default_theme')),
}

/**
Expand Down
10 changes: 0 additions & 10 deletions app/Http/Controllers/MeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ public function index(Request $request) {
return view('me.index', ['user' => $request->user()]);
}

/**
* Display a list of API Tokens (From Laravel Sanctum) and allow the user to create or delete those tokens.
*
* @param Request $request
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Foundation\Application|\Illuminate\View\View|void
*/
public function tokens(Request $request) {
return view('me.tokens');
}

/**
* Display the user profile including personal settings.
*
Expand Down
13 changes: 11 additions & 2 deletions app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class HandleInertiaRequests extends Middleware
* @see https://inertiajs.com/server-side-setup#root-template
* @var string
*/
protected $rootView = 'app';
protected $rootView = 'inertia';

/**
* Determines the current asset version.
Expand Down Expand Up @@ -57,6 +57,13 @@ public function share(Request $request): array

$admin_pages_v5 = $modules->getDropdownData('admin_pages', 'module', '');

$locales = [];
foreach(scandir(public_path('assets/locales')) as $list_url) {
if (strpos($list_url, 'json')) {
$locales[] = strtok($list_url, '.');
}
}

return array_merge(parent::share($request), [
//
'appName' => config('app.name'),
Expand All @@ -66,7 +73,9 @@ public function share(Request $request): array
'admin' => $admin_pages_legacy + $admin_pages_v5,
'user' => $request->user(),
'csrf_token' => csrf_token(), // Needed if doing XHR/Ajax outside of InertiaJS client.
'graphql_url' => route('graphql')
'graphql_url' => route('graphql'),
'current_theme' => $request->session()->get('theme', config('_munkireport.default_theme')),
'locales' => $locales
]);
}
}
1 change: 1 addition & 0 deletions app/Providers/JetstreamServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function boot(): void
$this->configurePermissions();

Jetstream::deleteUsersUsing(DeleteUser::class);
//Jetstream::ignoreRoutes();

Fortify::loginView(function () {
return view('auth.login');
Expand Down
19 changes: 19 additions & 0 deletions codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import type { CodegenConfig } from '@graphql-codegen/cli';


const config: CodegenConfig = {
schema: './graphql/*.graphql',
documents: ['resources/js/**/*.vue'],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
'./resources/js/gql/': {
preset: 'client',
config: {
useTypeImports: true,
},
plugins: [],
},
},
};

export default config;
Loading

0 comments on commit 662ff18

Please sign in to comment.