MOBILE-3592 user: Adapt user feature to new folder structure
parent
537846e1cf
commit
fa294d7135
|
@ -1,24 +0,0 @@
|
||||||
// (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 { CoreUserRoutingModule } from './user-routing.module';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
CoreUserRoutingModule,
|
|
||||||
],
|
|
||||||
})
|
|
||||||
export class CoreUserModule {}
|
|
|
@ -21,7 +21,7 @@ import { CoreSites } from '@services/sites';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import { CoreObject } from '@singletons/object';
|
import { CoreObject } from '@singletons/object';
|
||||||
import { CoreUserProvider, CoreUserBasicData, CoreUserProfilePictureUpdatedData } from '@core/user/services/user';
|
import { CoreUserProvider, CoreUserBasicData, CoreUserProfilePictureUpdatedData } from '@features/user/services/user';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component to display a "user avatar".
|
* Component to display a "user avatar".
|
|
@ -23,6 +23,7 @@ import { CoreMainMenuModule } from './mainmenu/mainmenu.module';
|
||||||
import { CoreSettingsModule } from './settings/settings.module';
|
import { CoreSettingsModule } from './settings/settings.module';
|
||||||
import { CoreSiteHomeModule } from './sitehome/sitehome.module';
|
import { CoreSiteHomeModule } from './sitehome/sitehome.module';
|
||||||
import { CoreTagModule } from './tag/tag.module';
|
import { CoreTagModule } from './tag/tag.module';
|
||||||
|
import { CoreUserModule } from './user/user.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -35,6 +36,7 @@ import { CoreTagModule } from './tag/tag.module';
|
||||||
CoreSettingsModule,
|
CoreSettingsModule,
|
||||||
CoreSiteHomeModule,
|
CoreSiteHomeModule,
|
||||||
CoreTagModule,
|
CoreTagModule,
|
||||||
|
CoreUserModule,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class CoreFeaturesModule {}
|
export class CoreFeaturesModule {}
|
||||||
|
|
|
@ -22,8 +22,8 @@ import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreTextUtils } from '@services/utils/text';
|
import { CoreTextUtils } from '@services/utils/text';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreEvents } from '@singletons/events';
|
import { CoreEvents } from '@singletons/events';
|
||||||
import { CoreUser, CoreUserProfile, CoreUserProfileRefreshedData, CoreUserProvider } from '@core/user/services/user';
|
import { CoreUser, CoreUserProfile, CoreUserProfileRefreshedData, CoreUserProvider } from '@features/user/services/user';
|
||||||
import { CoreUserHelper } from '@core/user/services/user.helper';
|
import { CoreUserHelper } from '@features/user/services/user-helper';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page that displays info about a user.
|
* Page that displays info about a user.
|
|
@ -21,7 +21,7 @@ import { CoreSite } from '@classes/site';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreDomUtils } from '@services/utils/dom';
|
import { CoreDomUtils } from '@services/utils/dom';
|
||||||
import { CoreMimetypeUtils } from '@services/utils/mimetype';
|
import { CoreMimetypeUtils } from '@services/utils/mimetype';
|
||||||
import { Translate } from '@singletons/core.singletons';
|
import { Translate } from '@singletons';
|
||||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||||
import {
|
import {
|
||||||
CoreUser,
|
CoreUser,
|
||||||
|
@ -29,12 +29,12 @@ import {
|
||||||
CoreUserProfilePictureUpdatedData,
|
CoreUserProfilePictureUpdatedData,
|
||||||
CoreUserProfileRefreshedData,
|
CoreUserProfileRefreshedData,
|
||||||
CoreUserProvider,
|
CoreUserProvider,
|
||||||
} from '@core/user/services/user';
|
} from '@features/user/services/user';
|
||||||
import { CoreUserHelper } from '@core/user/services/user.helper';
|
import { CoreUserHelper } from '@features/user/services/user-helper';
|
||||||
import { CoreUserDelegate, CoreUserProfileHandlerData } from '@core/user/services/user.delegate';
|
import { CoreUserDelegate, CoreUserProfileHandlerData } from '@features/user/services/user-delegate';
|
||||||
import { CoreFileUploaderHelper } from '@core/fileuploader/services/fileuploader.helper';
|
import { CoreFileUploaderHelper } from '@features/fileuploader/services/fileuploader-helper';
|
||||||
import { CoreIonLoadingElement } from '@classes/ion-loading';
|
import { CoreIonLoadingElement } from '@classes/ion-loading';
|
||||||
import { CoreUtils } from '@/app/services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'page-core-user-profile',
|
selector: 'page-core-user-profile',
|
|
@ -12,8 +12,8 @@
|
||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
import { CoreSiteSchema, registerSiteSchema } from '@services/sites';
|
import { CoreSiteSchema } from '@services/sites';
|
||||||
import { CoreUserBasicData } from './user';
|
import { CoreUserBasicData } from '../user';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Database variables for CoreUser service.
|
* Database variables for CoreUser service.
|
||||||
|
@ -88,8 +88,3 @@ export type CoreUserPreferenceDBRecord = {
|
||||||
value: string;
|
value: string;
|
||||||
onlinevalue: string;
|
onlinevalue: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const initCoreUserDB = (): void => {
|
|
||||||
registerSiteSchema(SITE_SCHEMA);
|
|
||||||
registerSiteSchema(OFFLINE_SITE_SCHEMA);
|
|
||||||
};
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { makeSingleton, Translate } from '@singletons/core.singletons';
|
import { makeSingleton, Translate } from '@singletons';
|
||||||
import { CoreUserRole } from './user';
|
import { CoreUserRole } from './user';
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -15,8 +15,8 @@
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
|
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { makeSingleton } from '@singletons/core.singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { PREFERENCES_TABLE_NAME, CoreUserPreferenceDBRecord } from './user.db';
|
import { PREFERENCES_TABLE_NAME, CoreUserPreferenceDBRecord } from './db/user';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Service to handle offline user preferences.
|
* Service to handle offline user preferences.
|
|
@ -18,14 +18,14 @@ import { CoreApp } from '@services/app';
|
||||||
import { CoreFilepool } from '@services/filepool';
|
import { CoreFilepool } from '@services/filepool';
|
||||||
import { CoreSites } from '@services/sites';
|
import { CoreSites } from '@services/sites';
|
||||||
import { CoreUtils } from '@services/utils/utils';
|
import { CoreUtils } from '@services/utils/utils';
|
||||||
import { CoreUserOffline } from './user.offline';
|
import { CoreUserOffline } from './user-offline';
|
||||||
import { CoreLogger } from '@singletons/logger';
|
import { CoreLogger } from '@singletons/logger';
|
||||||
import { CoreSite, CoreSiteWSPreSets } from '@classes/site';
|
import { CoreSite, CoreSiteWSPreSets } from '@classes/site';
|
||||||
import { makeSingleton, Translate } from '@singletons/core.singletons';
|
import { makeSingleton } from '@singletons';
|
||||||
import { CoreEvents, CoreEventUserDeletedData } from '@singletons/events';
|
import { CoreEvents, CoreEventUserDeletedData } from '@singletons/events';
|
||||||
import { CoreStatusWithWarningsWSResponse, CoreWSExternalWarning } from '@services/ws';
|
import { CoreStatusWithWarningsWSResponse, CoreWSExternalWarning } from '@services/ws';
|
||||||
import { CoreError } from '@classes/errors/error';
|
import { CoreError } from '@classes/errors/error';
|
||||||
import { USERS_TABLE_NAME, CoreUserDBRecord } from './user.db';
|
import { USERS_TABLE_NAME, CoreUserDBRecord } from './db/user';
|
||||||
|
|
||||||
const ROOT_CACHE_KEY = 'mmUser:';
|
const ROOT_CACHE_KEY = 'mmUser:';
|
||||||
|
|
|
@ -23,16 +23,15 @@ const routes: Routes = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'profile',
|
path: 'profile',
|
||||||
loadChildren: () => import('./pages/profile/profile.page.module').then( m => m.CoreUserProfilePageModule),
|
loadChildren: () => import('./pages/profile/profile.module').then( m => m.CoreUserProfilePageModule),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'about',
|
path: 'about',
|
||||||
loadChildren: () => import('./pages/about/about.page.module').then( m => m.CoreUserAboutPageModule),
|
loadChildren: () => import('./pages/about/about.module').then( m => m.CoreUserAboutPageModule),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule],
|
|
||||||
})
|
})
|
||||||
export class CoreUserRoutingModule {}
|
export class CoreUserLazyModule {}
|
|
@ -15,23 +15,30 @@
|
||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
|
|
||||||
import { CoreMainMenuRoutingModule } from '@core/mainmenu/mainmenu-routing.module';
|
import { CoreMainMenuMoreRoutingModule } from '@features/mainmenu/pages/more/more-routing.module';
|
||||||
|
import { CORE_SITE_SCHEMAS } from '@services/sites';
|
||||||
|
import { SITE_SCHEMA, OFFLINE_SITE_SCHEMA } from './services/db/user';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: 'user',
|
path: 'user',
|
||||||
loadChildren: () => import('@core/user/user.module').then(m => m.CoreUserModule),
|
loadChildren: () => import('@features/user/user-lazy.module').then(m => m.CoreUserLazyModule),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
CoreMainMenuRoutingModule.forChild(routes),
|
CoreMainMenuMoreRoutingModule.forChild({ siblings: routes }),
|
||||||
],
|
|
||||||
exports: [
|
|
||||||
CoreMainMenuRoutingModule,
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
{
|
||||||
|
provide: CORE_SITE_SCHEMAS,
|
||||||
|
useValue: [
|
||||||
|
SITE_SCHEMA,
|
||||||
|
OFFLINE_SITE_SCHEMA,
|
||||||
|
],
|
||||||
|
multi: true,
|
||||||
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class CoreUserInitModule {}
|
export class CoreUserModule {}
|
Loading…
Reference in New Issue