From 662ff18fa60eb012a6854ee293989449dda765b0 Mon Sep 17 00:00:00 2001 From: Mosen Date: Mon, 11 Dec 2023 21:38:49 +1100 Subject: [PATCH] Profile page needs to support theme, currently commented out. 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 --- .gitignore | 15 +- .../Fortify/UpdateUserProfileInformation.php | 6 +- app/Http/Controllers/MeController.php | 10 - app/Http/Middleware/HandleInertiaRequests.php | 13 +- app/Providers/JetstreamServiceProvider.php | 1 + codegen.ts | 19 ++ package-lock.json | 225 +++++++++++- package.json | 14 +- public/assets/js/me/tokens.js | 51 --- resources/js/Components/ActionMessage.vue | 8 +- resources/js/Components/ActionSection.vue | 8 +- resources/js/Components/DangerButton.vue | 6 +- resources/js/Components/FormSection.vue | 21 +- resources/js/Components/PrimaryButton.vue | 2 +- resources/js/Components/SectionBorder.vue | 6 +- resources/js/Components/SectionTitle.vue | 22 +- .../LogoutOtherBrowserSessionsForm.vue | 33 +- .../Profile/Partials/UpdatePasswordForm.vue | 72 ++-- .../Partials/UpdateProfileInformationForm.vue | 84 +---- resources/js/Pages/Profile/Show.vue | 50 ++- resources/js/Pages/Query/Editor.vue | 61 +++- resources/js/Pages/Query/Index.vue | 25 +- .../Query/codemirror6-bootstrap-theme.ts | 319 ++++++++++++++++++ resources/views/inertia.blade.php | 1 + resources/views/layouts/inertia.blade.php | 6 +- resources/views/layouts/mr.blade.php | 2 +- resources/views/me/tokens.blade.php | 90 ----- 27 files changed, 757 insertions(+), 413 deletions(-) create mode 100644 codegen.ts delete mode 100644 public/assets/js/me/tokens.js create mode 100644 resources/js/Pages/Query/codemirror6-bootstrap-theme.ts create mode 100644 resources/views/inertia.blade.php delete mode 100644 resources/views/me/tokens.blade.php diff --git a/.gitignore b/.gitignore index b7910518d..96f2208b4 100644 --- a/.gitignore +++ b/.gitignore @@ -37,10 +37,7 @@ 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 @@ -48,3 +45,13 @@ 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 diff --git a/app/Actions/Fortify/UpdateUserProfileInformation.php b/app/Actions/Fortify/UpdateUserProfileInformation.php index 3a0f19978..6e2a5f0ab 100644 --- a/app/Actions/Fortify/UpdateUserProfileInformation.php +++ b/app/Actions/Fortify/UpdateUserProfileInformation.php @@ -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')), } /** diff --git a/app/Http/Controllers/MeController.php b/app/Http/Controllers/MeController.php index fa73095fa..99581c47c 100644 --- a/app/Http/Controllers/MeController.php +++ b/app/Http/Controllers/MeController.php @@ -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. * diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index 4ca507f43..67adcf0fd 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -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. @@ -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'), @@ -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 ]); } } diff --git a/app/Providers/JetstreamServiceProvider.php b/app/Providers/JetstreamServiceProvider.php index d9a2082a7..bbdf98166 100644 --- a/app/Providers/JetstreamServiceProvider.php +++ b/app/Providers/JetstreamServiceProvider.php @@ -25,6 +25,7 @@ public function boot(): void $this->configurePermissions(); Jetstream::deleteUsersUsing(DeleteUser::class); + //Jetstream::ignoreRoutes(); Fortify::loginView(function () { return view('auth.login'); diff --git a/codegen.ts b/codegen.ts new file mode 100644 index 000000000..d06b592b6 --- /dev/null +++ b/codegen.ts @@ -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; diff --git a/package-lock.json b/package-lock.json index e4f3dd009..47b55f970 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,8 +26,9 @@ "codemirror": "^6.0.1", "codemirror6-bootstrap-theme": "^0.0.1", "d3": "^3.5.17", - "datatables.net-bs4": "^1.11.3", + "datatables.net-bs4": "^1.13.6", "datatables.net-buttons-bs4": "^1.7.1", + "datatables.net-vue3": "^2.1.3", "date-fns": "^2.28.0", "i18next": "^23.5.1", "i18next-fetch-backend": "^3.0.0", @@ -48,7 +49,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "^4.0.1", - "@graphql-codegen/client-preset": "^4.0.1", + "@graphql-codegen/client-preset": "^4.1.0", "@tailwindcss/forms": "^0.5.2", "@tailwindcss/typography": "^0.5.2", "@types/ziggy-js": "^1.3.3", @@ -57,6 +58,7 @@ "@vue/tsconfig": "^0.4.0", "autoprefixer": "^10.4.7", "axios": "^0.27", + "css-convert-json": "^1.1.0", "graphql": "^16.7.1", "laravel-vite-plugin": "^0.8.1", "lodash": "^4.17.19", @@ -66,7 +68,8 @@ "typescript": "^5.1.6", "vite": "^4.4.0", "vite-plugin-simple-gql": "^0.5.0", - "vite-plugin-static-copy": "^0.17.0" + "vite-plugin-static-copy": "^0.17.0", + "vue-tsc": "^1.8.19" } }, "node_modules/@0no-co/graphql.web": { @@ -3303,6 +3306,33 @@ "vue": "^3.2.25" } }, + "node_modules/@volar/language-core": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.10.4.tgz", + "integrity": "sha512-Na69qA6uwVIdA0rHuOc2W3pHtVQQO8hCNim7FOaKNpRJh0oAFnu5r9i7Oopo5C4cnELZkPNjTrbmpcCTiW+CMQ==", + "dev": true, + "dependencies": { + "@volar/source-map": "1.10.4" + } + }, + "node_modules/@volar/source-map": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.10.4.tgz", + "integrity": "sha512-RxZdUEL+pV8p+SMqnhVjzy5zpb1QRZTlcwSk4bdcBO7yOu4rtEWqDGahVCEj4CcXour+0yJUMrMczfSCpP9Uxg==", + "dev": true, + "dependencies": { + "muggle-string": "^0.3.1" + } + }, + "node_modules/@volar/typescript": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.10.4.tgz", + "integrity": "sha512-BCCUEBASBEMCrz7qmNSi2hBEWYsXD0doaktRKpmmhvb6XntM2sAWYu6gbyK/MluLDgluGLFiFRpWgobgzUqolg==", + "dev": true, + "dependencies": { + "@volar/language-core": "1.10.4" + } + }, "node_modules/@vue/compiler-core": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.3.4.tgz", @@ -3359,6 +3389,54 @@ "@vue/shared": "3.3.4" } }, + "node_modules/@vue/language-core": { + "version": "1.8.19", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.19.tgz", + "integrity": "sha512-nt3dodGs97UM6fnxeQBazO50yYCKBK53waFWB3qMbLmR6eL3aUryZgQtZoBe1pye17Wl8fs9HysV3si6xMgndQ==", + "dev": true, + "dependencies": { + "@volar/language-core": "~1.10.4", + "@volar/source-map": "~1.10.4", + "@vue/compiler-dom": "^3.3.0", + "@vue/reactivity": "^3.3.0", + "@vue/shared": "^3.3.0", + "minimatch": "^9.0.3", + "muggle-string": "^0.3.1", + "vue-template-compiler": "^2.7.14" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@vue/language-core/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@vue/language-core/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@vue/reactivity": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.3.4.tgz", @@ -3426,6 +3504,16 @@ "integrity": "sha512-CPuIReonid9+zOG/CGTT05FXrPYATEqoDGNrEaqS4hwcw5BUNM2FguC0mOwJD4Jr16UpRVl9N0pY3P+srIbqmg==", "dev": true }, + "node_modules/@vue/typescript": { + "version": "1.8.19", + "resolved": "https://registry.npmjs.org/@vue/typescript/-/typescript-1.8.19.tgz", + "integrity": "sha512-k/SHeeQROUgqsxyHQ8Cs3Zz5TnX57p7BcBDVYR2E0c61QL2DJ2G8CsaBremmNGuGE6o1R5D50IHIxFmroMz8iw==", + "dev": true, + "dependencies": { + "@volar/typescript": "~1.10.4", + "@vue/language-core": "1.8.19" + } + }, "node_modules/@whatwg-node/events": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/@whatwg-node/events/-/events-0.0.3.tgz", @@ -4430,6 +4518,12 @@ "node-fetch": "^2.6.12" } }, + "node_modules/css-convert-json": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/css-convert-json/-/css-convert-json-1.1.0.tgz", + "integrity": "sha512-aq00Qs8SsXBBPkOAnIcQgCvGbFYIC2mKmncjJBikcX3g11JGJ1AEz67l8q+5rel9MsvncyXCvPZ9M49GQcmN2Q==", + "dev": true + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -4494,6 +4588,50 @@ "jquery": ">=1.7" } }, + "node_modules/datatables.net-dt": { + "version": "1.13.6", + "resolved": "https://registry.npmjs.org/datatables.net-dt/-/datatables.net-dt-1.13.6.tgz", + "integrity": "sha512-0fBsUi8k5e+x5e+xA/Eb5stFr2PIkHgDnbhZs8ZDLvzzL975lCm6sqBAcsTsXKvF7yuBvaDTVBTF4wOMw7PrYw==", + "dependencies": { + "datatables.net": ">=1.13.4", + "jquery": ">=1.7" + } + }, + "node_modules/datatables.net-responsive": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/datatables.net-responsive/-/datatables.net-responsive-2.5.0.tgz", + "integrity": "sha512-GL7DFiRl5qqrp5ql54Psz92xTGPR0rMcrO3hzNxMfvcfpRGL5zFNTvMpTUh59Erm6u1+KoX+j+Ig1ZD3r0iFsA==", + "dependencies": { + "datatables.net": ">=1.13.4", + "jquery": ">=1.7" + } + }, + "node_modules/datatables.net-responsive-dt": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/datatables.net-responsive-dt/-/datatables.net-responsive-dt-2.5.0.tgz", + "integrity": "sha512-u0oHqG1LLrFj+cBVYpyOO03nECUJJim4EovKhdQtB2g8X0fbH7jWvLAOdDFvyIzktCYWScObqR8uUEtm6J9O6Q==", + "dependencies": { + "datatables.net-dt": ">=1.13.4", + "datatables.net-responsive": ">=2.4.1", + "jquery": ">=1.7" + } + }, + "node_modules/datatables.net-vue3": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/datatables.net-vue3/-/datatables.net-vue3-2.1.3.tgz", + "integrity": "sha512-9A81RiszsaH5sia01+E8tusagXbzeYVMSD0I+tzqx7V2iqVVZJgVVZM+4hwGa5skSJiHOUCRl3kp2TLF9uLf9A==", + "dependencies": { + "datatables.net-responsive-dt": "^2.4.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "datatables.net": "^1.13.1", + "jquery": "^3.6.0", + "vue": "^3.0.5" + } + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", @@ -4509,6 +4647,12 @@ "url": "https://opencollective.com/date-fns" } }, + "node_modules/de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", + "dev": true + }, "node_modules/debounce": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.1.tgz", @@ -5205,6 +5349,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, "node_modules/header-case": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", @@ -6087,6 +6240,12 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/muggle-string": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.3.1.tgz", + "integrity": "sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==", + "dev": true + }, "node_modules/mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", @@ -7746,6 +7905,66 @@ "resolved": "https://registry.npmjs.org/vue-functional-data-merge/-/vue-functional-data-merge-3.1.0.tgz", "integrity": "sha512-leT4kdJVQyeZNY1kmnS1xiUlQ9z1B/kdBFCILIjYYQDqZgLqCLa0UhjSSeRX6c3mUe6U5qYeM8LrEqkHJ1B4LA==" }, + "node_modules/vue-template-compiler": { + "version": "2.7.14", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.14.tgz", + "integrity": "sha512-zyA5Y3ArvVG0NacJDkkzJuPQDF8RFeRlzV2vLeSnhSpieO6LK2OVbdLPi5MPPs09Ii+gMO8nY4S3iKQxBxDmWQ==", + "dev": true, + "dependencies": { + "de-indent": "^1.0.2", + "he": "^1.2.0" + } + }, + "node_modules/vue-tsc": { + "version": "1.8.19", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.19.tgz", + "integrity": "sha512-tacMQLQ0CXAfbhRycCL5sWIy1qujXaIEtP1hIQpzHWOUuICbtTj9gJyFf91PvzG5KCNIkA5Eg7k2Fmgt28l5DQ==", + "dev": true, + "dependencies": { + "@vue/language-core": "1.8.19", + "@vue/typescript": "1.8.19", + "semver": "^7.5.4" + }, + "bin": { + "vue-tsc": "bin/vue-tsc.js" + }, + "peerDependencies": { + "typescript": "*" + } + }, + "node_modules/vue-tsc/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/vue-tsc/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/vue-tsc/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", diff --git a/package.json b/package.json index 0bac02780..f91ad238a 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,9 @@ "private": true, "scripts": { "dev": "vite", - "build": "vite build", - "preview": "vite preview" + "build": "vue-tsc && vite build", + "preview": "vite preview", + "codegen": "graphql-codegen" }, "dependencies": { "@codemirror/lang-javascript": "^6.1.9", @@ -27,8 +28,9 @@ "codemirror": "^6.0.1", "codemirror6-bootstrap-theme": "^0.0.1", "d3": "^3.5.17", - "datatables.net-bs4": "^1.11.3", + "datatables.net-bs4": "^1.13.6", "datatables.net-buttons-bs4": "^1.7.1", + "datatables.net-vue3": "^2.1.3", "date-fns": "^2.28.0", "i18next": "^23.5.1", "i18next-fetch-backend": "^3.0.0", @@ -49,7 +51,7 @@ }, "devDependencies": { "@graphql-codegen/cli": "^4.0.1", - "@graphql-codegen/client-preset": "^4.0.1", + "@graphql-codegen/client-preset": "^4.1.0", "@tailwindcss/forms": "^0.5.2", "@tailwindcss/typography": "^0.5.2", "@types/ziggy-js": "^1.3.3", @@ -58,6 +60,7 @@ "@vue/tsconfig": "^0.4.0", "autoprefixer": "^10.4.7", "axios": "^0.27", + "css-convert-json": "^1.1.0", "graphql": "^16.7.1", "laravel-vite-plugin": "^0.8.1", "lodash": "^4.17.19", @@ -67,6 +70,7 @@ "typescript": "^5.1.6", "vite": "^4.4.0", "vite-plugin-simple-gql": "^0.5.0", - "vite-plugin-static-copy": "^0.17.0" + "vite-plugin-static-copy": "^0.17.0", + "vue-tsc": "^1.8.19" } } diff --git a/public/assets/js/me/tokens.js b/public/assets/js/me/tokens.js deleted file mode 100644 index 5598d6e28..000000000 --- a/public/assets/js/me/tokens.js +++ /dev/null @@ -1,51 +0,0 @@ -$(document).ready(function() { - $('#tokens').DataTable({ - "ajax": "/api/v6/me/tokens", - "columns": [ - { "data": "name" }, - { "data": "created_at", "render": function(data, type, row, meta) { - return moment(data).format(); - } }, - { "data": "last_used_at", "render": function(data) { - if (data) { - return moment(data).fromNow(); - } else { - return "Never"; - } - } }, - ] - }); - - var $modal = $('#createTokenModal'); - - $modal.on('show.bs.modal', function (event) { - $('#createTokenForm').trigger('reset'); - }); - - $modal.on('shown.bs.modal', function (event) { - $('#createTokenForm').find("input[name='token_name']").focus(); - }) - - $modal.on('hidden.bs.modal', function (event) { - $('#token').val(''); - $('#createTokenResult').hide(); - }); - - $('#createTokenForm').submit(function (event) { - event.preventDefault(); - event.stopPropagation(); - - var $form = $(this), - tokenName = $form.find("input[name='token_name']").val(); - - var xhr = $.post("/api/v6/me/tokens", { token_name: tokenName, }); - - xhr.done((function (data) { - console.log('request done'); - if (data.token) { - $('#token').val(data.token); - $('#createTokenResult').show(); - } - })); - }) -}); diff --git a/resources/js/Components/ActionMessage.vue b/resources/js/Components/ActionMessage.vue index 597414857..cad9865f1 100644 --- a/resources/js/Components/ActionMessage.vue +++ b/resources/js/Components/ActionMessage.vue @@ -6,10 +6,8 @@ defineProps({ diff --git a/resources/js/Components/ActionSection.vue b/resources/js/Components/ActionSection.vue index 02acc0385..5117829e2 100644 --- a/resources/js/Components/ActionSection.vue +++ b/resources/js/Components/ActionSection.vue @@ -3,7 +3,7 @@ import SectionTitle from './SectionTitle.vue'; diff --git a/resources/js/Components/DangerButton.vue b/resources/js/Components/DangerButton.vue index e9ef25e1e..2ed92c8eb 100644 --- a/resources/js/Components/DangerButton.vue +++ b/resources/js/Components/DangerButton.vue @@ -8,7 +8,7 @@ defineProps({ diff --git a/resources/js/Components/FormSection.vue b/resources/js/Components/FormSection.vue index 93912cc79..58b559897 100644 --- a/resources/js/Components/FormSection.vue +++ b/resources/js/Components/FormSection.vue @@ -18,21 +18,14 @@ const hasActions = computed(() => !! useSlots().actions); - -
-
-
-
- -
-
-
- -
+ +
+ +
+
+ +
diff --git a/resources/js/Components/PrimaryButton.vue b/resources/js/Components/PrimaryButton.vue index 6b8749a21..88871f754 100644 --- a/resources/js/Components/PrimaryButton.vue +++ b/resources/js/Components/PrimaryButton.vue @@ -8,7 +8,7 @@ defineProps({ diff --git a/resources/js/Components/SectionBorder.vue b/resources/js/Components/SectionBorder.vue index 707f56664..aa745b281 100644 --- a/resources/js/Components/SectionBorder.vue +++ b/resources/js/Components/SectionBorder.vue @@ -1,7 +1,3 @@ diff --git a/resources/js/Components/SectionTitle.vue b/resources/js/Components/SectionTitle.vue index 273116e14..52d106cc1 100644 --- a/resources/js/Components/SectionTitle.vue +++ b/resources/js/Components/SectionTitle.vue @@ -1,17 +1,11 @@ diff --git a/resources/js/Pages/Profile/Partials/LogoutOtherBrowserSessionsForm.vue b/resources/js/Pages/Profile/Partials/LogoutOtherBrowserSessionsForm.vue index 1db2f7aaf..243501d9d 100644 --- a/resources/js/Pages/Profile/Partials/LogoutOtherBrowserSessionsForm.vue +++ b/resources/js/Pages/Profile/Partials/LogoutOtherBrowserSessionsForm.vue @@ -8,6 +8,11 @@ import InputError from '@/Components/InputError.vue'; import PrimaryButton from '@/Components/PrimaryButton.vue'; import SecondaryButton from '@/Components/SecondaryButton.vue'; import TextInput from '@/Components/TextInput.vue'; +import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome' +import { + faDesktop +} from '@fortawesome/free-solid-svg-icons' + defineProps({ sessions: Array, @@ -53,33 +58,31 @@ const closeModal = () => {