From 300f017036973faa9f6dcbc5c436a098e9c33c73 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Mon, 5 Oct 2020 16:50:23 +0200 Subject: [PATCH] MOBILE-3565 core: Add init page of the app --- src/app/app-routing.module.ts | 9 ++++++ src/app/core/login/login-routing.module.ts | 30 +++++++++++++++++++ src/app/core/login/login.module.ts | 34 ++++++++++++++++++++++ src/app/core/login/pages/init/init.html | 5 ++++ src/app/core/login/pages/init/init.page.ts | 25 ++++++++++++++++ src/app/core/login/pages/init/init.scss | 2 ++ 6 files changed, 105 insertions(+) create mode 100644 src/app/core/login/login-routing.module.ts create mode 100644 src/app/core/login/login.module.ts create mode 100644 src/app/core/login/pages/init/init.html create mode 100644 src/app/core/login/pages/init/init.page.ts create mode 100644 src/app/core/login/pages/init/init.scss diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 7621f9003..024498f24 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -16,6 +16,15 @@ import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; const routes: Routes = [ + { + path: '', + redirectTo: 'login', + pathMatch: 'full', + }, + { + path: 'login', + loadChildren: () => import('./core/login/login.module').then( m => m.CoreLoginModule), + }, ]; @NgModule({ diff --git a/src/app/core/login/login-routing.module.ts b/src/app/core/login/login-routing.module.ts new file mode 100644 index 000000000..858df6bb3 --- /dev/null +++ b/src/app/core/login/login-routing.module.ts @@ -0,0 +1,30 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { CoreLoginInitPage } from './pages/init/init.page'; + +const routes: Routes = [ + { + path: '', + component: CoreLoginInitPage, + }, +]; + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], +}) +export class CoreLoginRoutingModule {} diff --git a/src/app/core/login/login.module.ts b/src/app/core/login/login.module.ts new file mode 100644 index 000000000..e459f38ba --- /dev/null +++ b/src/app/core/login/login.module.ts @@ -0,0 +1,34 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { IonicModule } from '@ionic/angular'; + +import { CoreLoginRoutingModule } from './login-routing.module'; +import { CoreLoginInitPage } from './pages/init/init.page'; + + +@NgModule({ + imports: [ + CommonModule, + IonicModule, + CoreLoginRoutingModule, + ], + declarations: [ + CoreLoginInitPage, + ], +}) +export class CoreLoginModule {} diff --git a/src/app/core/login/pages/init/init.html b/src/app/core/login/pages/init/init.html new file mode 100644 index 000000000..a76c49166 --- /dev/null +++ b/src/app/core/login/pages/init/init.html @@ -0,0 +1,5 @@ + + + diff --git a/src/app/core/login/pages/init/init.page.ts b/src/app/core/login/pages/init/init.page.ts new file mode 100644 index 000000000..8286ea762 --- /dev/null +++ b/src/app/core/login/pages/init/init.page.ts @@ -0,0 +1,25 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import { Component } from '@angular/core'; + +/** + * Page that displays a "splash screen" while the app is being initialized. + */ +@Component({ + selector: 'page-core-login-init', + templateUrl: 'init.html', + styleUrls: ['init.scss'], +}) +export class CoreLoginInitPage { } diff --git a/src/app/core/login/pages/init/init.scss b/src/app/core/login/pages/init/init.scss new file mode 100644 index 000000000..b61725a0d --- /dev/null +++ b/src/app/core/login/pages/init/init.scss @@ -0,0 +1,2 @@ +app-root page-core-login-init { +}