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