Skip to content
This repository has been archived by the owner on Nov 21, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/0.0.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis CI committed Jan 11, 2019
2 parents d046140 + 1e9b22e commit 17c8de8
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 48 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## [0.0.3](https://github.com/rucken/ionic/compare/0.0.2...0.0.3) (2019-01-11)


### Bug Fixes

* Add show errors if remove users or groups is fail ([3a22b65](https://github.com/rucken/ionic/commit/3a22b65))
* Load permissions and groups if current user entered ([a4b3c6a](https://github.com/rucken/ionic/commit/a4b3c6a))



## [0.0.2](https://github.com/rucken/ionic/compare/0.0.1...0.0.2) (2019-01-10)


Expand Down
35 changes: 16 additions & 19 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
"version": 1,
"defaultProject": "demo",
"defaultProject": "app",
"newProjectRoot": "libs",
"projects": {
"demo": {
"app": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
Expand Down Expand Up @@ -86,21 +86,21 @@
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "demo:build"
"browserTarget": "app:build"
},
"configurations": {
"dev": {
"browserTarget": "demo:build:dev"
"browserTarget": "app:build:dev"
},
"production": {
"browserTarget": "demo:build:production"
"browserTarget": "app:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "demo:build"
"browserTarget": "app:build"
}
},
"test": {
Expand All @@ -110,9 +110,6 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"styles": [
"styles.css"
],
"scripts": [],
"assets": [
{
Expand Down Expand Up @@ -143,45 +140,45 @@
"ionic-cordova-build": {
"builder": "@ionic/ng-toolkit:cordova-build",
"options": {
"browserTarget": "demo:build"
"browserTarget": "app:build"
},
"configurations": {
"production": {
"browserTarget": "demo:build:production"
"browserTarget": "app:build:production"
}
}
},
"ionic-cordova-serve": {
"builder": "@ionic/ng-toolkit:cordova-serve",
"options": {
"cordovaBuildTarget": "demo:ionic-cordova-build",
"devServerTarget": "demo:serve"
"cordovaBuildTarget": "app:ionic-cordova-build",
"devServerTarget": "app:serve"
},
"configurations": {
"production": {
"cordovaBuildTarget": "demo:ionic-cordova-build:production",
"devServerTarget": "demo:serve:production"
"cordovaBuildTarget": "app:ionic-cordova-build:production",
"devServerTarget": "app:serve:production"
}
}
}
}
},
"demo-e2e": {
"app-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "demo:serve"
"devServerTarget": "app:serve"
},
"configurations": {
"dev": {
"devServerTarget": "demo:serve:dev"
"devServerTarget": "app:serve:dev"
},
"production": {
"devServerTarget": "demo:serve:production"
"devServerTarget": "app:serve:production"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion capacitor.config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"appId": "ru.site15.ionic.rucken",
"appId": "io.rucken.android.ionic",
"appName": "rucken-ionic",
"bundledWebRuntime": false,
"webDir": "dist/demo"
Expand Down
12 changes: 6 additions & 6 deletions config.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.starter" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>MyApp</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<widget id="io.rucken.android.ionic" version="0.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>RuckenIonic</name>
<description>Admin UI for Ionic4 with Angular7+ mobile application</description>
<author email="[email protected]" href="http://rucken.io/">EndyKaufman</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
Expand Down Expand Up @@ -76,14 +76,14 @@
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
</platform>
<engine name="android" spec="7.1.4" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
<plugin name="cordova-plugin-ionic-webview" spec="^3.0.0">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="21.+" />
</plugin>
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" />
<plugin name="cordova-sqlite-storage" spec="2.6.0" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
<engine name="android" spec="7.1.4" />
</widget>
10 changes: 10 additions & 0 deletions greenkeeper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"groups": {
"default": {
"packages": [
"libs/rucken/ionic/package.json",
"package.json"
]
}
}
}
2 changes: 1 addition & 1 deletion libs/rucken/ionic/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rucken/ionic",
"version": "0.0.2",
"version": "0.0.3",
"engines": {
"node": ">=10",
"npm": ">=6.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { DynamicRepository, IRestProviderOptions } from 'ngx-repository';
import { EntityListComponent } from '../../../components/entity-list/entity-list.component';
import { IonicModalsService } from '../../../modules/modals/modals.service';
import { GroupModalComponent } from '../group-modal/group-modal.component';
import { GroupsListFiltersModalService } from './groups-list-filters-modal/groups-list-filters-modal.service';
import { GroupsListFiltersModal } from './groups-list-filters-modal/groups-list-filters-modal';
import { GroupsListFiltersModalComponent } from './groups-list-filters-modal/groups-list-filters-modal.component';
import { GroupsListFiltersModalService } from './groups-list-filters-modal/groups-list-filters-modal.service';

@Component({
selector: 'groups-list',
Expand Down Expand Up @@ -88,7 +88,7 @@ export class GroupsListComponent extends BaseEntityListComponent<Group> implemen
this.mockedItemsChange.emit(this.mockedItems);
}
},
error => this.onDeleteError(undefined, error)
error => this.onError(error)
);
}
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export class ProfilePanelComponent extends BasePromptPanelComponent<CustomUser>
}
onSave(user: CustomUser, saveData?: any) {
this.processing = false;
console.log(this._translateService);
this.form.clearExternalErrorsAsync().then(() =>
this.showSaveToastAsync().then(() => {
this.data = user;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class UserModalComponent extends BasePromptFormModalComponent<CustomUser>
) {
super();
this.group(CustomUser);
console.log(this);
this.groups$ = this._groupsService.items$;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ export class UsersListComponent extends BaseEntityListComponent<CustomUser> impl
super(dynamicRepository.fork<CustomUser>(CustomUser), modalsService, CustomUser);
}
ngOnInit() {
console.log(
this.usersConfig
);
if (!this.mockedItems) {
this.useRest({
infinity: true,
Expand Down Expand Up @@ -92,7 +89,7 @@ export class UsersListComponent extends BaseEntityListComponent<CustomUser> impl
this.mockedItemsChange.emit(this.mockedItems);
}
},
error => this.onDeleteError(undefined, error)
error => this.onError(error)
);
}
} catch (error) {
Expand Down
5 changes: 0 additions & 5 deletions libs/rucken/ionic/src/lib/modules/modals/modals.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,18 @@ export class IonicModalsService extends ModalsService {
let bsModalRef: TComponent | HTMLIonModalElement | any;
const instance = { ...options, yes: new EventEmitter(), no: new EventEmitter() };
instance.yes.subscribe((modal: TComponent) => {
console.log(modal);
this._onTopIsActive = false;
});
instance.no.subscribe((modal: TComponent) => {
console.log(modal);
this._onTopIsActive = false;
});
instance.group = () => { };
const modalRef: IModalRef<TComponent> = {
instance: instance,
hide: () => {
console.log(this);
this._modalController.dismiss();
}
};
console.log(modalRef);
try {
bsModalRef = await this._modalController.create({
component: component as any,
Expand All @@ -57,7 +53,6 @@ export class IonicModalsService extends ModalsService {
} catch (error) {
throw error;
}
console.log(modalRef);
return modalRef;
}
async infoAsync(options: { message: string | any; title?: string; class?: string; onTop?: boolean }) {
Expand Down
1 change: 1 addition & 0 deletions libs/rucken/ionic/src/lib/services/groups.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class GroupsService {
this.repository.useRest({
infinity: true,
...this.groupsConfig,
autoload: false,
paginationMeta: {
perPage: 10000
}
Expand Down
1 change: 1 addition & 0 deletions libs/rucken/ionic/src/lib/services/permissions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class PermissionsService {
this.repository.useRest({
infinity: true,
...this.groupsConfig,
autoload: false,
paginationMeta: {
perPage: 10000
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rucken-ionic",
"version": "0.0.2",
"version": "0.0.3",
"engines": {
"node": ">=10",
"npm": ">=6.4.0"
Expand Down Expand Up @@ -40,8 +40,8 @@
"prepare:prod": "rucken prepare -m prod",
"lib:build-ionic": "ng build @rucken/ionic",
"lib:build": "run-s prepare:prod lib:build-ionic",
"app:prebuild": "ng build demo --prod -c=production",
"app:prebuild:dev": "ng build demo --prod -c=dev",
"app:prebuild": "ng build app --prod -c=production",
"app:prebuild:dev": "ng build app --prod -c=dev",
"app:build": "run-s prepare:mono app:prebuild",
"app:build:dev": "run-s prepare:mono app:prebuild:dev",
"ng": "ng",
Expand All @@ -51,13 +51,13 @@
"start:dev": "run-s prepare:mono serve:dev",
"build": "run-s clean config:mono app:build",
"build:dev": "run-s clean config:mono app:build:dev",
"test": "ng test",
"test": "run-s build",
"lint": "ng lint",
"clean": "./node_modules/.bin/del-cli dist",
"e2e": "ng e2e",
"android:build": "ionic cordova build android --prod",
"postinstall": "node ./scripts/patch.js",
"github:prebuild": "ng build demo --base-href /ionic/ --prod",
"github:prebuild": "ng build app --base-href /ionic/ --prod",
"github:postbuild": "./node_modules/.bin/cp-cli ./dist/demo/index.html ./dist/demo/404.html",
"github:build": "run-s lib:build config:prod github:prebuild github:postbuild doc",
"github:deploy": "gh-pages -d dist/demo",
Expand Down Expand Up @@ -153,7 +153,7 @@
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "21.+"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-sqlite-storage": {}
Expand All @@ -169,4 +169,4 @@
"zone.js"
]
}
}
}
15 changes: 15 additions & 0 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { AlertInput } from '@ionic/core';
import { MetaService } from '@ngx-meta/core';
import { TranslateService } from '@ngx-translate/core';
import { AuthModalComponent, AuthModalService, AuthService, ILanguagesItem, LangService, RedirectUrlDto, TokenService, User, UserTokenDto } from '@rucken/core';
import { GroupsService, PermissionsService } from '@rucken/ionic';
import { BehaviorSubject, Observable, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { AuthModalSignInInfoMessage, AuthModalSignUpInfoMessage } from './app.config';
Expand Down Expand Up @@ -39,6 +40,8 @@ export class AppComponent implements OnInit, OnDestroy {
private _translateService: TranslateService,
private _metaService: MetaService,
private _tokenService: TokenService,
private _groupsService: GroupsService,
private _permissionsService: PermissionsService,
@Inject(PLATFORM_ID) private _platformId: Object
) {
this._authModalService.signInInfoMessage = AuthModalSignInInfoMessage;
Expand All @@ -59,6 +62,18 @@ export class AppComponent implements OnInit, OnDestroy {
this._metaService.loader.settings.applicationName
);
});
this.currentUser$
.pipe(takeUntil(this._destroyed$))
.subscribe(user => {
if (user) {
if (user.permissionNames.includes('read_group')) {
this._groupsService.repository.reloadAll();
}
if (user.permissionNames.includes('read_permission')) {
this._permissionsService.repository.reloadAll();
}
}
});
if (isPlatformBrowser(this._platformId)) {
this._tokenService.tokenHasExpired$.pipe(takeUntil(this._destroyed$)).subscribe(result => {
if (result === true) {
Expand Down

0 comments on commit 17c8de8

Please sign in to comment.