From c0dc1104445f6dbe3d22aa0510426cc2d39b6a5f Mon Sep 17 00:00:00 2001 From: Maicol Battistini Date: Sun, 7 May 2023 14:07:09 +0200 Subject: [PATCH] chore: Sostituito `~` con `@osm` --- composer.json | 12 +++++++- .../ts/Components/DataTable/DataTable.tsx | 4 +-- .../Components/DataTable/DataTableColumn.tsx | 4 +-- .../ts/Components/DataTable/RecordsTable.tsx | 14 +++++----- .../DataTable/RecordsTableColumn.tsx | 3 +- .../Dialogs/AddEditRecordDialog.tsx | 18 ++++++------ .../Components/Dialogs/DeleteRecordDialog.tsx | 5 ++-- .../ts/Components/Dialogs/RecordDialog.tsx | 8 +++--- resources/ts/Components/Page.tsx | 4 +-- resources/ts/Components/Pages/RecordPage.tsx | 8 +++--- resources/ts/Components/Pages/RecordsPage.tsx | 16 +++++------ resources/ts/Components/extend/utils.ts | 7 ++--- resources/ts/Components/layout/Drawer.tsx | 8 +++--- .../ts/Components/layout/DrawerEntry.tsx | 4 +-- resources/ts/Components/layout/TopAppBar.tsx | 28 +++++++++---------- .../topappbar_actions/NotificationsAction.ts | 2 +- .../topappbar_actions/PeriodSwitcherAction.ts | 2 +- .../topappbar_actions/TopAppBarAction.tsx | 3 +- .../topappbar_actions/UserInfoAction.tsx | 6 ++-- .../Models/Http/RequestHttpClientPromise.ts | 3 +- resources/ts/Models/Model.ts | 3 +- resources/ts/Models/User.ts | 2 +- resources/ts/Views/Dashboard.tsx | 2 +- resources/ts/Views/LoginPage.tsx | 12 ++++---- resources/ts/Views/ResetPasswordPage.tsx | 12 ++++---- resources/ts/Views/Setup/SetupPage.tsx | 12 ++++---- .../ts/Views/Setup/Steps/AdminUserStep.tsx | 18 ++++++------ .../ts/Views/Setup/Steps/DatabaseStep.tsx | 10 +++---- .../ts/Views/Setup/Steps/RegionalSettings.tsx | 6 ++-- resources/ts/Views/Setup/Steps/SetupStep.tsx | 4 +-- .../ts/Views/Setup/Steps/WelcomeStep.tsx | 19 ++++++------- resources/ts/Views/Users/UserRecord.tsx | 5 ++-- .../ts/Views/Users/UsersRecordDialog.tsx | 14 +++++----- resources/ts/Views/Users/UsersRecords.tsx | 9 +++--- resources/ts/app.ts | 6 ++-- tsconfig.json | 2 +- vite.config.ts | 1 - 37 files changed, 148 insertions(+), 148 deletions(-) diff --git a/composer.json b/composer.json index e896cac6c..3b05ddaf0 100644 --- a/composer.json +++ b/composer.json @@ -63,7 +63,8 @@ "rector/rector": "^0", "roave/security-advisories": "dev-latest", "spatie/laravel-ignition": "^2", - "thiagocordeiro/laravel-translator": "^1" + "thiagocordeiro/laravel-translator": "^1", + "openstamanager/attivita.tipi": "dev-main" }, "autoload": { "psr-4": { @@ -83,6 +84,15 @@ "@php artisan key:generate --ansi" ] }, + "repositories": { + "attivita.tipi": { + "type": "path", + "url": "../osm_module_attivita_tipi", + "options": { + "symlink": false + } + } + }, "config": { "optimize-autoloader": true, "preferred-install": "dist", diff --git a/resources/ts/Components/DataTable/DataTable.tsx b/resources/ts/Components/DataTable/DataTable.tsx index 6dccc6b6e..8bccc1c51 100644 --- a/resources/ts/Components/DataTable/DataTable.tsx +++ b/resources/ts/Components/DataTable/DataTable.tsx @@ -6,6 +6,8 @@ import { mdiPageFirst, mdiPageLast } from '@mdi/js'; + +import MdIcon from '@osm/Components/MdIcon'; import { Children, Vnode @@ -15,8 +17,6 @@ import { Component } from 'mithril-utilities'; -import MdIcon from '~/Components/MdIcon'; - export interface DataTableAttributes extends Attributes { inProgress?: boolean; paginated?: boolean; diff --git a/resources/ts/Components/DataTable/DataTableColumn.tsx b/resources/ts/Components/DataTable/DataTableColumn.tsx index 1b52c78cf..556435a65 100644 --- a/resources/ts/Components/DataTable/DataTableColumn.tsx +++ b/resources/ts/Components/DataTable/DataTableColumn.tsx @@ -5,14 +5,14 @@ import { mdiArrowDown, mdiArrowUp } from '@mdi/js'; + +import MdIcon from '@osm/Components/MdIcon'; import {Vnode} from 'mithril'; import { Attributes, Component } from 'mithril-utilities'; -import MdIcon from '~/Components/MdIcon'; - export interface DataTableColumnAttributes extends Attributes, Partial { } diff --git a/resources/ts/Components/DataTable/RecordsTable.tsx b/resources/ts/Components/DataTable/RecordsTable.tsx index b1ea7d9bc..75c1b6654 100644 --- a/resources/ts/Components/DataTable/RecordsTable.tsx +++ b/resources/ts/Components/DataTable/RecordsTable.tsx @@ -9,6 +9,13 @@ import { } from '@maicol07/material-web-additions/data-table/lib/data-table'; import {DataTableCell} from '@maicol07/material-web-additions/data-table/lib/data-table-cell'; import {mdiDeleteOutline} from '@mdi/js'; + +import DataTable, {DataTableAttributes} from '@osm/Components/DataTable/DataTable'; +import DataTableColumn, {DataTableColumnAttributes} from '@osm/Components/DataTable/DataTableColumn'; +import RecordsTableColumn from '@osm/Components/DataTable/RecordsTableColumn'; +import MdIcon from '@osm/Components/MdIcon'; +import Model from '@osm/Models/Model'; +import {isVnode} from '@osm/utils/misc'; import collect, {Collection} from 'collect.js'; import { ToManyRelation, @@ -21,13 +28,6 @@ import { } from 'mithril'; import {Class} from 'type-fest'; -import DataTable, {DataTableAttributes} from '~/Components/DataTable/DataTable'; -import DataTableColumn, {DataTableColumnAttributes} from '~/Components/DataTable/DataTableColumn'; -import RecordsTableColumn from '~/Components/DataTable/RecordsTableColumn'; -import MdIcon from '~/Components/MdIcon'; -import Model from '~/Models/Model'; -import {isVnode} from '~/utils/misc'; - export interface RecordsTableColumnAttributes extends DataTableColumnAttributes { label?: string; } diff --git a/resources/ts/Components/DataTable/RecordsTableColumn.tsx b/resources/ts/Components/DataTable/RecordsTableColumn.tsx index b97b6663e..850766453 100644 --- a/resources/ts/Components/DataTable/RecordsTableColumn.tsx +++ b/resources/ts/Components/DataTable/RecordsTableColumn.tsx @@ -1,7 +1,6 @@ +import DataTableColumn, {DataTableColumnAttributes} from '@osm/Components/DataTable/DataTableColumn'; import {Vnode} from 'mithril'; -import DataTableColumn, {DataTableColumnAttributes} from '~/Components/DataTable/DataTableColumn'; - export interface RecordsTableColumnAttributes extends DataTableColumnAttributes { } diff --git a/resources/ts/Components/Dialogs/AddEditRecordDialog.tsx b/resources/ts/Components/Dialogs/AddEditRecordDialog.tsx index ae5ee66ff..4ddcaec37 100644 --- a/resources/ts/Components/Dialogs/AddEditRecordDialog.tsx +++ b/resources/ts/Components/Dialogs/AddEditRecordDialog.tsx @@ -1,4 +1,13 @@ import {mdiFloppy} from '@mdi/js'; + +import RecordDialog, {RecordDialogAttributes} from '@osm/Components/Dialogs/RecordDialog'; +import MdIcon from '@osm/Components/MdIcon'; +import Model from '@osm/Models/Model'; +import { + VnodeCollection, + VnodeCollectionItem +} from '@osm/typings/jsx'; +import {isFormValid} from '@osm/utils/misc'; import collect, {Collection} from 'collect.js'; import { Children, @@ -9,15 +18,6 @@ import {Form} from 'mithril-utilities'; import Stream from 'mithril/stream'; import {Class} from 'type-fest'; -import RecordDialog, {RecordDialogAttributes} from '~/Components/Dialogs/RecordDialog'; -import MdIcon from '~/Components/MdIcon'; -import Model from '~/Models/Model'; -import { - VnodeCollection, - VnodeCollectionItem -} from '~/typings/jsx'; -import {isFormValid} from '~/utils/misc'; - export default abstract class AddEditRecordDialog> extends RecordDialog { // eslint-disable-next-line unicorn/no-null protected formElement: HTMLFormElement | null = null; diff --git a/resources/ts/Components/Dialogs/DeleteRecordDialog.tsx b/resources/ts/Components/Dialogs/DeleteRecordDialog.tsx index 253de16d9..aa7a321e9 100644 --- a/resources/ts/Components/Dialogs/DeleteRecordDialog.tsx +++ b/resources/ts/Components/Dialogs/DeleteRecordDialog.tsx @@ -1,12 +1,11 @@ +import Model from '@osm/Models/Model'; +import {showSnackbar} from '@osm/utils/misc'; import { Children, Vnode } from 'mithril'; import {RequestError} from 'mithril-utilities'; -import Model from '~/Models/Model'; -import {showSnackbar} from '~/utils/misc'; - import RecordDialog, {RecordDialogAttributes} from './RecordDialog'; export interface DeleteRecordDialogAttributes> extends RecordDialogAttributes { diff --git a/resources/ts/Components/Dialogs/RecordDialog.tsx b/resources/ts/Components/Dialogs/RecordDialog.tsx index a89030d01..ad23a6bed 100644 --- a/resources/ts/Components/Dialogs/RecordDialog.tsx +++ b/resources/ts/Components/Dialogs/RecordDialog.tsx @@ -1,11 +1,11 @@ -import '@material/web/button/text-button.js'; import '@maicol07/material-web-additions/layout-grid/layout-grid.js'; +import '@material/web/button/text-button.js'; + +import Dialog, {DialogAttributes} from '@osm/Components/Dialogs/Dialog'; +import Model from '@osm/Models/Model'; import {Vnode} from 'mithril'; -import Dialog, {DialogAttributes} from '~/Components/Dialogs/Dialog'; -import Model from '~/Models/Model'; - export interface RecordDialogAttributes> extends DialogAttributes { record?: M; } diff --git a/resources/ts/Components/Page.tsx b/resources/ts/Components/Page.tsx index c9c6ec3da..1e4a652d5 100644 --- a/resources/ts/Components/Page.tsx +++ b/resources/ts/Components/Page.tsx @@ -1,5 +1,7 @@ import autoAnimate from '@formkit/auto-animate'; import {ComponentAttributes} from '@maicol07/inertia-mithril'; + +import Footer from '@osm/Components/layout/Footer'; import {Collection} from 'collect.js'; import { Children, @@ -11,8 +13,6 @@ import { Component } from 'mithril-utilities'; -import Footer from '~/Components/layout/Footer'; - import logoUrl from '../../images/logo_completo.png'; import TopAppBar from './layout/TopAppBar'; diff --git a/resources/ts/Components/Pages/RecordPage.tsx b/resources/ts/Components/Pages/RecordPage.tsx index fa7aa079f..592a9b194 100644 --- a/resources/ts/Components/Pages/RecordPage.tsx +++ b/resources/ts/Components/Pages/RecordPage.tsx @@ -1,6 +1,10 @@ import '@material/web/button/outlined-button.js'; import {mdiChevronLeft} from '@mdi/js'; + +import MdIcon from '@osm/Components/MdIcon'; +import Page, {PageAttributes} from '@osm/Components/Page'; +import Model from '@osm/Models/Model'; import { Children, Vnode, @@ -8,10 +12,6 @@ import { } from 'mithril'; import {Class} from 'type-fest'; -import MdIcon from '~/Components/MdIcon'; -import Page, {PageAttributes} from '~/Components/Page'; -import Model from '~/Models/Model'; - export interface RecordPageAttributes> extends PageAttributes { record: M; } diff --git a/resources/ts/Components/Pages/RecordsPage.tsx b/resources/ts/Components/Pages/RecordsPage.tsx index 06d3a1b3f..dcd5e4baf 100644 --- a/resources/ts/Components/Pages/RecordsPage.tsx +++ b/resources/ts/Components/Pages/RecordsPage.tsx @@ -9,6 +9,14 @@ import '@material/web/dialog/dialog.js'; import '@material/web/fab/branded-fab.js'; import '@material/web/iconbutton/standard-icon-button.js'; import {mdiPlus} from '@mdi/js'; + +import RecordsTable, {RecordsTableColumnAttributes} from '@osm/Components/DataTable/RecordsTable'; +import AddEditRecordDialog from '@osm/Components/Dialogs/AddEditRecordDialog'; +import DeleteRecordDialog, {DeleteRecordDialogAttributes} from '@osm/Components/Dialogs/DeleteRecordDialog'; +import RecordDialog, {RecordDialogAttributes} from '@osm/Components/Dialogs/RecordDialog'; +import MdIcon from '@osm/Components/MdIcon'; +import Page, {PageAttributes} from '@osm/Components/Page'; +import Model from '@osm/Models/Model'; import collect, {type Collection} from 'collect.js'; import {SortDirection} from 'coloquent'; import dayjs from 'dayjs'; @@ -21,14 +29,6 @@ import Stream from 'mithril/stream'; import {match} from 'ts-pattern'; import type {Class} from 'type-fest'; -import RecordsTable, {RecordsTableColumnAttributes} from '~/Components/DataTable/RecordsTable'; -import AddEditRecordDialog from '~/Components/Dialogs/AddEditRecordDialog'; -import DeleteRecordDialog, {DeleteRecordDialogAttributes} from '~/Components/Dialogs/DeleteRecordDialog'; -import RecordDialog, {RecordDialogAttributes} from '~/Components/Dialogs/RecordDialog'; -import MdIcon from '~/Components/MdIcon'; -import Page, {PageAttributes} from '~/Components/Page'; -import Model from '~/Models/Model'; - type RecordDialogVnode, D extends RecordDialog> = Vnode, D>; type DeleteRecordDialogVnode, D extends DeleteRecordDialog> = Vnode, D>; diff --git a/resources/ts/Components/extend/utils.ts b/resources/ts/Components/extend/utils.ts index 85e016858..370bd9431 100644 --- a/resources/ts/Components/extend/utils.ts +++ b/resources/ts/Components/extend/utils.ts @@ -1,9 +1,8 @@ +import {extend} from '@osm/Components/extend/extend'; +import Drawer, {DrawerAttributes} from '@osm/Components/layout/Drawer'; +import {VnodeCollectionItem} from '@osm/typings/jsx'; import {Collection} from 'collect.js'; -import {extend} from '~/Components/extend/extend'; -import Drawer, {DrawerAttributes} from '~/Components/layout/Drawer'; -import {VnodeCollectionItem} from '~/typings/jsx'; - // eslint-disable-next-line import/prefer-default-export export function manageDrawerEntries(callback: (this: Drawer, value: Collection) => Collection): void { extend(Drawer.prototype as Drawer, 'entries', callback); diff --git a/resources/ts/Components/layout/Drawer.tsx b/resources/ts/Components/layout/Drawer.tsx index 8d8cf912a..1dd713847 100644 --- a/resources/ts/Components/layout/Drawer.tsx +++ b/resources/ts/Components/layout/Drawer.tsx @@ -5,6 +5,10 @@ import { mdiMenuOpen, mdiViewDashboardOutline } from '@mdi/js'; + +import MdIcon from '@osm/Components/MdIcon'; +import {VnodeCollectionItem} from '@osm/typings/jsx'; +import {isMobile} from '@osm/utils/misc'; import {collect} from 'collect.js'; import { Children, @@ -15,10 +19,6 @@ import { Component } from 'mithril-utilities'; import Stream from 'mithril/stream'; - -import MdIcon from '~/Components/MdIcon'; -import {VnodeCollectionItem} from '~/typings/jsx'; -import {isMobile} from '~/utils/misc'; import '../m3/NavigationDrawer'; import '../m3/NavigationDrawerModal'; diff --git a/resources/ts/Components/layout/DrawerEntry.tsx b/resources/ts/Components/layout/DrawerEntry.tsx index f900d8139..84d885482 100644 --- a/resources/ts/Components/layout/DrawerEntry.tsx +++ b/resources/ts/Components/layout/DrawerEntry.tsx @@ -3,6 +3,8 @@ import '@material/web/icon/icon.js'; import {ListItemLink} from '@material/web/list/lib/listitemlink/list-item-link'; import '@material/web/list/list-item-link.js'; import type * as MaterialIcons from '@mdi/js'; + +import MdIcon from '@osm/Components/MdIcon'; import {Vnode} from 'mithril'; import { Attributes, @@ -10,8 +12,6 @@ import { } from 'mithril-utilities'; import {ValueOf} from 'type-fest'; -import MdIcon from '~/Components/MdIcon'; - type Icons = ValueOf; export interface DrawerEntryAttributes extends Attributes { diff --git a/resources/ts/Components/layout/TopAppBar.tsx b/resources/ts/Components/layout/TopAppBar.tsx index 8f40e8396..3797d1cad 100644 --- a/resources/ts/Components/layout/TopAppBar.tsx +++ b/resources/ts/Components/layout/TopAppBar.tsx @@ -4,6 +4,20 @@ import { mdiMenu, mdiMenuOpen } from '@mdi/js'; + +import logo from '@osm/../images/logo.png'; +import Drawer from '@osm/Components/layout/Drawer'; +import NotificationsAction from '@osm/Components/layout/topappbar_actions/NotificationsAction'; +import PeriodSwitcherAction from '@osm/Components/layout/topappbar_actions/PeriodSwitcherAction'; +import PrintAction from '@osm/Components/layout/topappbar_actions/PrintAction'; +import UserInfoAction from '@osm/Components/layout/topappbar_actions/UserInfoAction'; +import MdIcon from '@osm/Components/MdIcon'; +import {VnodeCollectionItem} from '@osm/typings/jsx'; +import { + isMobile, + mobileMediaQuery +} from '@osm/utils/misc'; +import '@osm/WebComponents/TopAppBar'; import {collect} from 'collect.js'; import { Vnode, @@ -15,20 +29,6 @@ import { } from 'mithril-utilities'; import Stream from 'mithril/stream'; -import logo from '~/../images/logo.png'; -import Drawer from '~/Components/layout/Drawer'; -import NotificationsAction from '~/Components/layout/topappbar_actions/NotificationsAction'; -import PeriodSwitcherAction from '~/Components/layout/topappbar_actions/PeriodSwitcherAction'; -import PrintAction from '~/Components/layout/topappbar_actions/PrintAction'; -import UserInfoAction from '~/Components/layout/topappbar_actions/UserInfoAction'; -import MdIcon from '~/Components/MdIcon'; -import {VnodeCollectionItem} from '~/typings/jsx'; -import { - isMobile, - mobileMediaQuery -} from '~/utils/misc'; -import '~/WebComponents/TopAppBar'; - export default class TopAppBar extends Component { drawerOpenState = Stream(!isMobile()); diff --git a/resources/ts/Components/layout/topappbar_actions/NotificationsAction.ts b/resources/ts/Components/layout/topappbar_actions/NotificationsAction.ts index 15ecad2cf..0a677eaf8 100644 --- a/resources/ts/Components/layout/topappbar_actions/NotificationsAction.ts +++ b/resources/ts/Components/layout/topappbar_actions/NotificationsAction.ts @@ -1,6 +1,6 @@ import {mdiBellOutline} from '@mdi/js'; -import TopAppBarAction from '~/Components/layout/topappbar_actions/TopAppBarAction'; +import TopAppBarAction from '@osm/Components/layout/topappbar_actions/TopAppBarAction'; export default class NotificationsAction extends TopAppBarAction { ariaLabel = __('Notifiche'); diff --git a/resources/ts/Components/layout/topappbar_actions/PeriodSwitcherAction.ts b/resources/ts/Components/layout/topappbar_actions/PeriodSwitcherAction.ts index f4b9327dc..cf89e6d21 100644 --- a/resources/ts/Components/layout/topappbar_actions/PeriodSwitcherAction.ts +++ b/resources/ts/Components/layout/topappbar_actions/PeriodSwitcherAction.ts @@ -1,6 +1,6 @@ import {mdiCalendarRangeOutline} from '@mdi/js'; -import TopAppBarAction from '~/Components/layout/topappbar_actions/TopAppBarAction'; +import TopAppBarAction from '@osm/Components/layout/topappbar_actions/TopAppBarAction'; export default class PeriodSwitcherAction extends TopAppBarAction { ariaLabel = __('Cambia periodo'); diff --git a/resources/ts/Components/layout/topappbar_actions/TopAppBarAction.tsx b/resources/ts/Components/layout/topappbar_actions/TopAppBarAction.tsx index 19d019860..1347370e9 100644 --- a/resources/ts/Components/layout/topappbar_actions/TopAppBarAction.tsx +++ b/resources/ts/Components/layout/topappbar_actions/TopAppBarAction.tsx @@ -1,11 +1,10 @@ +import MdIcon, {Attributes as MdIconAttributes} from '@osm/Components/MdIcon'; import { Children, Vnode } from 'mithril'; import {Component} from 'mithril-utilities'; -import MdIcon, {Attributes as MdIconAttributes} from '~/Components/MdIcon'; - export default abstract class TopAppBarAction extends Component { abstract ariaLabel: string; abstract icon: MdIconAttributes['icon']; diff --git a/resources/ts/Components/layout/topappbar_actions/UserInfoAction.tsx b/resources/ts/Components/layout/topappbar_actions/UserInfoAction.tsx index 8bbe64dc8..fcf518d4a 100644 --- a/resources/ts/Components/layout/topappbar_actions/UserInfoAction.tsx +++ b/resources/ts/Components/layout/topappbar_actions/UserInfoAction.tsx @@ -6,13 +6,13 @@ import { mdiAccountOutline, mdiLogoutVariant } from '@mdi/js'; + +import Dialog from '@osm/Components/Dialogs/Dialog'; +import MdIcon from '@osm/Components/MdIcon'; import {Vnode} from 'mithril'; import {Request} from 'mithril-utilities'; import Stream from 'mithril/stream'; -import Dialog from '~/Components/Dialogs/Dialog'; -import MdIcon from '~/Components/MdIcon'; - import TopAppBarAction from './TopAppBarAction'; export default class UserInfoAction extends TopAppBarAction { diff --git a/resources/ts/Models/Http/RequestHttpClientPromise.ts b/resources/ts/Models/Http/RequestHttpClientPromise.ts index 9effbb485..8c8551900 100644 --- a/resources/ts/Models/Http/RequestHttpClientPromise.ts +++ b/resources/ts/Models/Http/RequestHttpClientPromise.ts @@ -1,11 +1,10 @@ +import RequestHttpClientResponse from '@osm/Models/Http/RequestHttpClientResponse'; import type { HttpClientPromise, HttpClientResponse } from 'coloquent'; import type {Thenable} from 'coloquent/dist/httpclient/Types'; -import RequestHttpClientResponse from '~/Models/Http/RequestHttpClientResponse'; - export default class RequestHttpClientPromise implements HttpClientPromise { constructor(private response: Promise) {} diff --git a/resources/ts/Models/Model.ts b/resources/ts/Models/Model.ts index 7608a9800..ed4ebe394 100644 --- a/resources/ts/Models/Model.ts +++ b/resources/ts/Models/Model.ts @@ -1,3 +1,4 @@ +import RequestHttpClient from '@osm/Models/Http/RequestHttpClient'; import { Model as BaseModel, PaginationStrategy, @@ -5,8 +6,6 @@ import { } from 'coloquent'; import type {ValueOf} from 'type-fest'; -import RequestHttpClient from '~/Models/Http/RequestHttpClient'; - export interface ModelAttributes { id: number; createdAt: Date; diff --git a/resources/ts/Models/User.ts b/resources/ts/Models/User.ts index 78dac78bc..d712f7c73 100644 --- a/resources/ts/Models/User.ts +++ b/resources/ts/Models/User.ts @@ -1,7 +1,7 @@ import Model, { ModelAttributes, ModelRelations -} from '~/Models/Model'; +} from '@osm/Models/Model'; export interface UserAttributes extends ModelAttributes { username: string; diff --git a/resources/ts/Views/Dashboard.tsx b/resources/ts/Views/Dashboard.tsx index 7eca02447..dd6f8e986 100644 --- a/resources/ts/Views/Dashboard.tsx +++ b/resources/ts/Views/Dashboard.tsx @@ -1,4 +1,4 @@ -import Page from '~/Components/Page'; +import Page from '@osm/Components/Page'; export default class Dashboard extends Page { title = __('Dashboard'); diff --git a/resources/ts/Views/LoginPage.tsx b/resources/ts/Views/LoginPage.tsx index dabe496b5..6d72c1069 100644 --- a/resources/ts/Views/LoginPage.tsx +++ b/resources/ts/Views/LoginPage.tsx @@ -12,6 +12,12 @@ import { mdiLockQuestion, mdiLoginVariant } from '@mdi/js'; +import '@osm/Components/m3/FilledTextField'; + +import MdIcon from '@osm/Components/MdIcon'; +import Page, {PageAttributes} from '@osm/Components/Page'; +import {VnodeCollectionItem} from '@osm/typings/jsx'; +import {showSnackbar} from '@osm/utils/misc'; import collect from 'collect.js'; import type { Vnode, @@ -24,12 +30,6 @@ import { RequestError } from 'mithril-utilities'; import Stream from 'mithril/stream'; -import '~/Components/m3/FilledTextField'; - -import MdIcon from '~/Components/MdIcon'; -import Page, {PageAttributes} from '~/Components/Page'; -import {VnodeCollectionItem} from '~/typings/jsx'; -import {showSnackbar} from '~/utils/misc'; export default class LoginPage extends Page { form = { diff --git a/resources/ts/Views/ResetPasswordPage.tsx b/resources/ts/Views/ResetPasswordPage.tsx index 465e8364e..ca1b481dc 100644 --- a/resources/ts/Views/ResetPasswordPage.tsx +++ b/resources/ts/Views/ResetPasswordPage.tsx @@ -6,6 +6,12 @@ import { mdiLockCheckOutline, mdiLockOutline } from '@mdi/js'; +import '@osm/Components/m3/FilledTextField'; + +import MdIcon from '@osm/Components/MdIcon'; +import Page, {PageAttributes} from '@osm/Components/Page'; +import {VnodeCollectionItem} from '@osm/typings/jsx'; +import {showSnackbar} from '@osm/utils/misc'; import collect from 'collect.js'; import type {Vnode} from 'mithril'; import { @@ -15,12 +21,6 @@ import { RequestError } from 'mithril-utilities'; import Stream from 'mithril/stream'; -import '~/Components/m3/FilledTextField'; - -import MdIcon from '~/Components/MdIcon'; -import Page, {PageAttributes} from '~/Components/Page'; -import {VnodeCollectionItem} from '~/typings/jsx'; -import {showSnackbar} from '~/utils/misc'; export default class ResetPasswordPage extends Page { form = { diff --git a/resources/ts/Views/Setup/SetupPage.tsx b/resources/ts/Views/Setup/SetupPage.tsx index 68b8d476a..c77c01445 100644 --- a/resources/ts/Views/Setup/SetupPage.tsx +++ b/resources/ts/Views/Setup/SetupPage.tsx @@ -1,5 +1,11 @@ import {router} from '@maicol07/inertia-mithril'; import '@maicol07/material-web-additions/card/elevated-card.js'; + +import Page, {PageAttributes} from '@osm/Components/Page'; +import {showSnackbar} from '@osm/utils/misc'; +import AdminUserStep from '@osm/Views/Setup/Steps/AdminUserStep'; +import DatabaseStep from '@osm/Views/Setup/Steps/DatabaseStep'; +import RegionalSettings from '@osm/Views/Setup/Steps/RegionalSettings'; import type {Vnode} from 'mithril'; import { Request, @@ -7,12 +13,6 @@ import { } from 'mithril-utilities'; import Stream from 'mithril/stream'; -import Page, {PageAttributes} from '~/Components/Page'; -import {showSnackbar} from '~/utils/misc'; -import AdminUserStep from '~/Views/Setup/Steps/AdminUserStep'; -import DatabaseStep from '~/Views/Setup/Steps/DatabaseStep'; -import RegionalSettings from '~/Views/Setup/Steps/RegionalSettings'; - import { SetupStep, SetupSteps diff --git a/resources/ts/Views/Setup/Steps/AdminUserStep.tsx b/resources/ts/Views/Setup/Steps/AdminUserStep.tsx index c10d8428d..ae2a0336d 100644 --- a/resources/ts/Views/Setup/Steps/AdminUserStep.tsx +++ b/resources/ts/Views/Setup/Steps/AdminUserStep.tsx @@ -7,6 +7,15 @@ import { mdiLockCheckOutline, mdiLockOutline } from '@mdi/js'; +import '@osm/Components/m3/FilledTextField'; + +import MdIcon from '@osm/Components/MdIcon'; +import {VnodeCollectionItem} from '@osm/typings/jsx'; +import { + SetupStep, + SetupStepAttributes, + SetupSteps +} from '@osm/Views/Setup/Steps/SetupStep'; import collect from 'collect.js'; import {Vnode} from 'mithril'; import { @@ -14,15 +23,6 @@ import { FormSubmitEvent } from 'mithril-utilities'; import Stream from 'mithril/stream'; -import '~/Components/m3/FilledTextField'; - -import MdIcon from '~/Components/MdIcon'; -import {VnodeCollectionItem} from '~/typings/jsx'; -import { - SetupStep, - SetupStepAttributes, - SetupSteps -} from '~/Views/Setup/Steps/SetupStep'; interface AdminUserStepAttributes extends SetupStepAttributes { onSaveInstall: (event: FormSubmitEvent) => void; diff --git a/resources/ts/Views/Setup/Steps/DatabaseStep.tsx b/resources/ts/Views/Setup/Steps/DatabaseStep.tsx index 983a8b9ef..aef5bfefa 100644 --- a/resources/ts/Views/Setup/Steps/DatabaseStep.tsx +++ b/resources/ts/Views/Setup/Steps/DatabaseStep.tsx @@ -8,6 +8,11 @@ import { mdiServerNetwork, mdiTestTube } from '@mdi/js'; +import '@osm/Components/m3/FilledTextField'; + +import MdIcon from '@osm/Components/MdIcon'; +import {VnodeCollectionItem} from '@osm/typings/jsx'; +import {showSnackbar} from '@osm/utils/misc'; import collect from 'collect.js'; import { Children, @@ -19,11 +24,6 @@ import { RequestError } from 'mithril-utilities'; import Stream from 'mithril/stream'; -import '~/Components/m3/FilledTextField'; - -import MdIcon from '~/Components/MdIcon'; -import {VnodeCollectionItem} from '~/typings/jsx'; -import {showSnackbar} from '~/utils/misc'; import { SetupStep, diff --git a/resources/ts/Views/Setup/Steps/RegionalSettings.tsx b/resources/ts/Views/Setup/Steps/RegionalSettings.tsx index b86f0ce8b..bd37acc5c 100644 --- a/resources/ts/Views/Setup/Steps/RegionalSettings.tsx +++ b/resources/ts/Views/Setup/Steps/RegionalSettings.tsx @@ -3,14 +3,14 @@ import { mdiCalendarMonthOutline, mdiClockOutline } from '@mdi/js'; + +import MdIcon from '@osm/Components/MdIcon'; +import {VnodeCollectionItem} from '@osm/typings/jsx'; import collect from 'collect.js'; import dayjs from 'dayjs'; import {Form} from 'mithril-utilities'; import Stream from 'mithril/stream'; -import MdIcon from '~/Components/MdIcon'; -import {VnodeCollectionItem} from '~/typings/jsx'; - import { SetupStep, SetupSteps diff --git a/resources/ts/Views/Setup/Steps/SetupStep.tsx b/resources/ts/Views/Setup/Steps/SetupStep.tsx index 9ba8c316b..6e2a79463 100644 --- a/resources/ts/Views/Setup/Steps/SetupStep.tsx +++ b/resources/ts/Views/Setup/Steps/SetupStep.tsx @@ -4,6 +4,8 @@ import { mdiChevronLeft, mdiChevronRight } from '@mdi/js'; + +import MdIcon from '@osm/Components/MdIcon'; import { Children, Vnode @@ -13,8 +15,6 @@ import { Component } from 'mithril-utilities'; -import MdIcon from '~/Components/MdIcon'; - export enum SetupSteps { Welcome = 'welcome', diff --git a/resources/ts/Views/Setup/Steps/WelcomeStep.tsx b/resources/ts/Views/Setup/Steps/WelcomeStep.tsx index c9849f9a4..b15c004c6 100644 --- a/resources/ts/Views/Setup/Steps/WelcomeStep.tsx +++ b/resources/ts/Views/Setup/Steps/WelcomeStep.tsx @@ -5,6 +5,15 @@ import '@material/web/select/filled-select.js'; import {Select} from '@material/web/select/lib/select'; import '@material/web/select/select-option.js'; import {mdiLicense} from '@mdi/js'; +import MdIcon from '@osm/Components/MdIcon'; +import { + getFlag, + getLocaleDisplayName +} from '@osm/utils/i18n'; +import { + capitalize, + showSnackbar +} from '@osm/utils/misc'; import {Vnode} from 'mithril'; import { Request, @@ -12,16 +21,6 @@ import { } from 'mithril-utilities'; import Stream from 'mithril/stream'; -import MdIcon from '~/Components/MdIcon'; -import { - getFlag, - getLocaleDisplayName -} from '~/utils/i18n'; -import { - capitalize, - showSnackbar -} from '~/utils/misc'; - import { SetupStep, SetupStepAttributes, diff --git a/resources/ts/Views/Users/UserRecord.tsx b/resources/ts/Views/Users/UserRecord.tsx index fd11fbd28..e9b18f936 100644 --- a/resources/ts/Views/Users/UserRecord.tsx +++ b/resources/ts/Views/Users/UserRecord.tsx @@ -1,11 +1,10 @@ +import RecordPage, {RecordPageAttributes} from '@osm/Components/Pages/RecordPage'; +import User from '@osm/Models/User'; import { Children, Vnode } from 'mithril'; -import RecordPage, {RecordPageAttributes} from '~/Components/Pages/RecordPage'; -import User from '~/Models/User'; - export default class UserRecord extends RecordPage { recordType = User; diff --git a/resources/ts/Views/Users/UsersRecordDialog.tsx b/resources/ts/Views/Users/UsersRecordDialog.tsx index 63c200990..3c920b08f 100644 --- a/resources/ts/Views/Users/UsersRecordDialog.tsx +++ b/resources/ts/Views/Users/UsersRecordDialog.tsx @@ -2,17 +2,17 @@ import { mdiAccountOutline, mdiEmailOutline } from '@mdi/js'; + +import AddEditRecordDialog from '@osm/Components/Dialogs/AddEditRecordDialog'; +import '@osm/Components/m3/FilledTextField'; +import MdIcon from '@osm/Components/MdIcon'; +import User, {UserAttributes} from '@osm/Models/User'; +import {JSONAPI} from '@osm/typings/request'; +import {showSnackbar} from '@osm/utils/misc'; import collect, {Collection} from 'collect.js'; import {Children} from 'mithril'; import Stream from 'mithril/stream'; -import AddEditRecordDialog from '~/Components/Dialogs/AddEditRecordDialog'; -import '~/Components/m3/FilledTextField'; -import MdIcon from '~/Components/MdIcon'; -import User, {UserAttributes} from '~/Models/User'; -import {JSONAPI} from '~/typings/request'; -import {showSnackbar} from '~/utils/misc'; - export default class UsersRecordDialog extends AddEditRecordDialog { modelType = User; numberOfColumns = 2; diff --git a/resources/ts/Views/Users/UsersRecords.tsx b/resources/ts/Views/Users/UsersRecords.tsx index 3afa80a82..305277eef 100644 --- a/resources/ts/Views/Users/UsersRecords.tsx +++ b/resources/ts/Views/Users/UsersRecords.tsx @@ -1,11 +1,10 @@ +import RecordsTableColumn from '@osm/Components/DataTable/RecordsTableColumn'; +import RecordsPage from '@osm/Components/Pages/RecordsPage'; +import User from '@osm/Models/User'; +import UsersRecordDialog from '@osm/Views/Users/UsersRecordDialog'; import collect from 'collect.js'; import {Children} from 'mithril'; -import RecordsTableColumn from '~/Components/DataTable/RecordsTableColumn'; -import RecordsPage from '~/Components/Pages/RecordsPage'; -import User from '~/Models/User'; -import UsersRecordDialog from '~/Views/Users/UsersRecordDialog'; - export default class UsersRecords extends RecordsPage { modelType = User; recordDialogType = UsersRecordDialog; diff --git a/resources/ts/app.ts b/resources/ts/app.ts index beffaa2d6..0950649bf 100644 --- a/resources/ts/app.ts +++ b/resources/ts/app.ts @@ -1,12 +1,12 @@ import {createInertiaApp} from '@maicol07/inertia-mithril'; +import '@osm/../scss/app.scss'; + +import {showSnackbar} from '@osm/utils/misc'; import 'inertia-plugin/client'; import Mithril from 'mithril'; import {registerSW} from 'virtual:pwa-register'; import 'vite-plugin-pwa/client'; import 'vite/client'; -import '~/../scss/app.scss'; - -import {showSnackbar} from '~/utils/misc'; import {resolvePage} from '~inertia'; import {OpenSTAManager} from './typings/modules'; diff --git a/tsconfig.json b/tsconfig.json index 35f4fd11a..6d6cff09e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,7 +20,7 @@ ], "baseUrl": ".", "paths": { - "~/*": [ + "@osm/*": [ "resources/ts/*" ] }, diff --git a/vite.config.ts b/vite.config.ts index 2237561ac..33c3b7200 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -22,7 +22,6 @@ export default defineConfig(async () => { }, resolve: { alias: { - '~': '/resources/ts', '@osm': '/resources/ts' } },