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

Commit 17c8de8

Browse files
author
Travis CI
committed
Merge branch 'release/0.0.3'
2 parents d046140 + 1e9b22e commit 17c8de8

16 files changed

+72
-48
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## [0.0.3](https://github.com/rucken/ionic/compare/0.0.2...0.0.3) (2019-01-11)
2+
3+
4+
### Bug Fixes
5+
6+
* Add show errors if remove users or groups is fail ([3a22b65](https://github.com/rucken/ionic/commit/3a22b65))
7+
* Load permissions and groups if current user entered ([a4b3c6a](https://github.com/rucken/ionic/commit/a4b3c6a))
8+
9+
10+
111
## [0.0.2](https://github.com/rucken/ionic/compare/0.0.1...0.0.2) (2019-01-10)
212

313

angular.json

+16-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"$schema": "./node_modules/@angular-devkit/core/src/workspace/workspace-schema.json",
33
"version": 1,
4-
"defaultProject": "demo",
4+
"defaultProject": "app",
55
"newProjectRoot": "libs",
66
"projects": {
7-
"demo": {
7+
"app": {
88
"root": "",
99
"sourceRoot": "src",
1010
"projectType": "application",
@@ -86,21 +86,21 @@
8686
"serve": {
8787
"builder": "@angular-devkit/build-angular:dev-server",
8888
"options": {
89-
"browserTarget": "demo:build"
89+
"browserTarget": "app:build"
9090
},
9191
"configurations": {
9292
"dev": {
93-
"browserTarget": "demo:build:dev"
93+
"browserTarget": "app:build:dev"
9494
},
9595
"production": {
96-
"browserTarget": "demo:build:production"
96+
"browserTarget": "app:build:production"
9797
}
9898
}
9999
},
100100
"extract-i18n": {
101101
"builder": "@angular-devkit/build-angular:extract-i18n",
102102
"options": {
103-
"browserTarget": "demo:build"
103+
"browserTarget": "app:build"
104104
}
105105
},
106106
"test": {
@@ -110,9 +110,6 @@
110110
"polyfills": "src/polyfills.ts",
111111
"tsConfig": "src/tsconfig.spec.json",
112112
"karmaConfig": "src/karma.conf.js",
113-
"styles": [
114-
"styles.css"
115-
],
116113
"scripts": [],
117114
"assets": [
118115
{
@@ -143,45 +140,45 @@
143140
"ionic-cordova-build": {
144141
"builder": "@ionic/ng-toolkit:cordova-build",
145142
"options": {
146-
"browserTarget": "demo:build"
143+
"browserTarget": "app:build"
147144
},
148145
"configurations": {
149146
"production": {
150-
"browserTarget": "demo:build:production"
147+
"browserTarget": "app:build:production"
151148
}
152149
}
153150
},
154151
"ionic-cordova-serve": {
155152
"builder": "@ionic/ng-toolkit:cordova-serve",
156153
"options": {
157-
"cordovaBuildTarget": "demo:ionic-cordova-build",
158-
"devServerTarget": "demo:serve"
154+
"cordovaBuildTarget": "app:ionic-cordova-build",
155+
"devServerTarget": "app:serve"
159156
},
160157
"configurations": {
161158
"production": {
162-
"cordovaBuildTarget": "demo:ionic-cordova-build:production",
163-
"devServerTarget": "demo:serve:production"
159+
"cordovaBuildTarget": "app:ionic-cordova-build:production",
160+
"devServerTarget": "app:serve:production"
164161
}
165162
}
166163
}
167164
}
168165
},
169-
"demo-e2e": {
166+
"app-e2e": {
170167
"root": "e2e/",
171168
"projectType": "application",
172169
"architect": {
173170
"e2e": {
174171
"builder": "@angular-devkit/build-angular:protractor",
175172
"options": {
176173
"protractorConfig": "e2e/protractor.conf.js",
177-
"devServerTarget": "demo:serve"
174+
"devServerTarget": "app:serve"
178175
},
179176
"configurations": {
180177
"dev": {
181-
"devServerTarget": "demo:serve:dev"
178+
"devServerTarget": "app:serve:dev"
182179
},
183180
"production": {
184-
"devServerTarget": "demo:serve:production"
181+
"devServerTarget": "app:serve:production"
185182
}
186183
}
187184
},

capacitor.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"appId": "ru.site15.ionic.rucken",
2+
"appId": "io.rucken.android.ionic",
33
"appName": "rucken-ionic",
44
"bundledWebRuntime": false,
55
"webDir": "dist/demo"

config.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version='1.0' encoding='utf-8'?>
2-
<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">
3-
<name>MyApp</name>
4-
<description>An awesome Ionic/Cordova app.</description>
5-
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
2+
<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">
3+
<name>RuckenIonic</name>
4+
<description>Admin UI for Ionic4 with Angular7+ mobile application</description>
5+
<author email="[email protected]" href="http://rucken.io/">EndyKaufman</author>
66
<content src="index.html" />
77
<access origin="*" />
88
<allow-intent href="http://*/*" />
@@ -76,14 +76,14 @@
7676
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
7777
<splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
7878
</platform>
79-
<engine name="android" spec="7.1.4" />
8079
<plugin name="cordova-plugin-device" spec="^2.0.2" />
8180
<plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
8281
<plugin name="cordova-plugin-ionic-webview" spec="^3.0.0">
83-
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
82+
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="21.+" />
8483
</plugin>
8584
<plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.3" />
8685
<plugin name="cordova-sqlite-storage" spec="2.6.0" />
8786
<plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
8887
<plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
88+
<engine name="android" spec="7.1.4" />
8989
</widget>

greenkeeper.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"groups": {
3+
"default": {
4+
"packages": [
5+
"libs/rucken/ionic/package.json",
6+
"package.json"
7+
]
8+
}
9+
}
10+
}

libs/rucken/ionic/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rucken/ionic",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"engines": {
55
"node": ">=10",
66
"npm": ">=6.4.0"

libs/rucken/ionic/src/lib/entities/groups/groups-list/groups-list.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import { DynamicRepository, IRestProviderOptions } from 'ngx-repository';
55
import { EntityListComponent } from '../../../components/entity-list/entity-list.component';
66
import { IonicModalsService } from '../../../modules/modals/modals.service';
77
import { GroupModalComponent } from '../group-modal/group-modal.component';
8-
import { GroupsListFiltersModalService } from './groups-list-filters-modal/groups-list-filters-modal.service';
98
import { GroupsListFiltersModal } from './groups-list-filters-modal/groups-list-filters-modal';
109
import { GroupsListFiltersModalComponent } from './groups-list-filters-modal/groups-list-filters-modal.component';
10+
import { GroupsListFiltersModalService } from './groups-list-filters-modal/groups-list-filters-modal.service';
1111

1212
@Component({
1313
selector: 'groups-list',
@@ -88,7 +88,7 @@ export class GroupsListComponent extends BaseEntityListComponent<Group> implemen
8888
this.mockedItemsChange.emit(this.mockedItems);
8989
}
9090
},
91-
error => this.onDeleteError(undefined, error)
91+
error => this.onError(error)
9292
);
9393
}
9494
} catch (error) {

libs/rucken/ionic/src/lib/entities/users/profile-panel/profile-panel.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export class ProfilePanelComponent extends BasePromptPanelComponent<CustomUser>
6868
}
6969
onSave(user: CustomUser, saveData?: any) {
7070
this.processing = false;
71-
console.log(this._translateService);
7271
this.form.clearExternalErrorsAsync().then(() =>
7372
this.showSaveToastAsync().then(() => {
7473
this.data = user;

libs/rucken/ionic/src/lib/entities/users/user-modal/user-modal.component.ts

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class UserModalComponent extends BasePromptFormModalComponent<CustomUser>
2020
) {
2121
super();
2222
this.group(CustomUser);
23-
console.log(this);
2423
this.groups$ = this._groupsService.items$;
2524
}
2625
}

libs/rucken/ionic/src/lib/entities/users/users-list/users-list.component.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ export class UsersListComponent extends BaseEntityListComponent<CustomUser> impl
5151
super(dynamicRepository.fork<CustomUser>(CustomUser), modalsService, CustomUser);
5252
}
5353
ngOnInit() {
54-
console.log(
55-
this.usersConfig
56-
);
5754
if (!this.mockedItems) {
5855
this.useRest({
5956
infinity: true,
@@ -92,7 +89,7 @@ export class UsersListComponent extends BaseEntityListComponent<CustomUser> impl
9289
this.mockedItemsChange.emit(this.mockedItems);
9390
}
9491
},
95-
error => this.onDeleteError(undefined, error)
92+
error => this.onError(error)
9693
);
9794
}
9895
} catch (error) {

libs/rucken/ionic/src/lib/modules/modals/modals.service.ts

-5
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,18 @@ export class IonicModalsService extends ModalsService {
2828
let bsModalRef: TComponent | HTMLIonModalElement | any;
2929
const instance = { ...options, yes: new EventEmitter(), no: new EventEmitter() };
3030
instance.yes.subscribe((modal: TComponent) => {
31-
console.log(modal);
3231
this._onTopIsActive = false;
3332
});
3433
instance.no.subscribe((modal: TComponent) => {
35-
console.log(modal);
3634
this._onTopIsActive = false;
3735
});
3836
instance.group = () => { };
3937
const modalRef: IModalRef<TComponent> = {
4038
instance: instance,
4139
hide: () => {
42-
console.log(this);
4340
this._modalController.dismiss();
4441
}
4542
};
46-
console.log(modalRef);
4743
try {
4844
bsModalRef = await this._modalController.create({
4945
component: component as any,
@@ -57,7 +53,6 @@ export class IonicModalsService extends ModalsService {
5753
} catch (error) {
5854
throw error;
5955
}
60-
console.log(modalRef);
6156
return modalRef;
6257
}
6358
async infoAsync(options: { message: string | any; title?: string; class?: string; onTop?: boolean }) {

libs/rucken/ionic/src/lib/services/groups.service.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class GroupsService {
1717
this.repository.useRest({
1818
infinity: true,
1919
...this.groupsConfig,
20+
autoload: false,
2021
paginationMeta: {
2122
perPage: 10000
2223
}

libs/rucken/ionic/src/lib/services/permissions.service.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class PermissionsService {
1717
this.repository.useRest({
1818
infinity: true,
1919
...this.groupsConfig,
20+
autoload: false,
2021
paginationMeta: {
2122
perPage: 10000
2223
}

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rucken-ionic",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"engines": {
55
"node": ">=10",
66
"npm": ">=6.4.0"
@@ -40,8 +40,8 @@
4040
"prepare:prod": "rucken prepare -m prod",
4141
"lib:build-ionic": "ng build @rucken/ionic",
4242
"lib:build": "run-s prepare:prod lib:build-ionic",
43-
"app:prebuild": "ng build demo --prod -c=production",
44-
"app:prebuild:dev": "ng build demo --prod -c=dev",
43+
"app:prebuild": "ng build app --prod -c=production",
44+
"app:prebuild:dev": "ng build app --prod -c=dev",
4545
"app:build": "run-s prepare:mono app:prebuild",
4646
"app:build:dev": "run-s prepare:mono app:prebuild:dev",
4747
"ng": "ng",
@@ -51,13 +51,13 @@
5151
"start:dev": "run-s prepare:mono serve:dev",
5252
"build": "run-s clean config:mono app:build",
5353
"build:dev": "run-s clean config:mono app:build:dev",
54-
"test": "ng test",
54+
"test": "run-s build",
5555
"lint": "ng lint",
5656
"clean": "./node_modules/.bin/del-cli dist",
5757
"e2e": "ng e2e",
5858
"android:build": "ionic cordova build android --prod",
5959
"postinstall": "node ./scripts/patch.js",
60-
"github:prebuild": "ng build demo --base-href /ionic/ --prod",
60+
"github:prebuild": "ng build app --base-href /ionic/ --prod",
6161
"github:postbuild": "./node_modules/.bin/cp-cli ./dist/demo/index.html ./dist/demo/404.html",
6262
"github:build": "run-s lib:build config:prod github:prebuild github:postbuild doc",
6363
"github:deploy": "gh-pages -d dist/demo",
@@ -153,7 +153,7 @@
153153
"cordova-plugin-device": {},
154154
"cordova-plugin-splashscreen": {},
155155
"cordova-plugin-ionic-webview": {
156-
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
156+
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "21.+"
157157
},
158158
"cordova-plugin-ionic-keyboard": {},
159159
"cordova-sqlite-storage": {}
@@ -169,4 +169,4 @@
169169
"zone.js"
170170
]
171171
}
172-
}
172+
}

src/app/app.component.ts

+15
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { AlertInput } from '@ionic/core';
77
import { MetaService } from '@ngx-meta/core';
88
import { TranslateService } from '@ngx-translate/core';
99
import { AuthModalComponent, AuthModalService, AuthService, ILanguagesItem, LangService, RedirectUrlDto, TokenService, User, UserTokenDto } from '@rucken/core';
10+
import { GroupsService, PermissionsService } from '@rucken/ionic';
1011
import { BehaviorSubject, Observable, Subject } from 'rxjs';
1112
import { takeUntil } from 'rxjs/operators';
1213
import { AuthModalSignInInfoMessage, AuthModalSignUpInfoMessage } from './app.config';
@@ -39,6 +40,8 @@ export class AppComponent implements OnInit, OnDestroy {
3940
private _translateService: TranslateService,
4041
private _metaService: MetaService,
4142
private _tokenService: TokenService,
43+
private _groupsService: GroupsService,
44+
private _permissionsService: PermissionsService,
4245
@Inject(PLATFORM_ID) private _platformId: Object
4346
) {
4447
this._authModalService.signInInfoMessage = AuthModalSignInInfoMessage;
@@ -59,6 +62,18 @@ export class AppComponent implements OnInit, OnDestroy {
5962
this._metaService.loader.settings.applicationName
6063
);
6164
});
65+
this.currentUser$
66+
.pipe(takeUntil(this._destroyed$))
67+
.subscribe(user => {
68+
if (user) {
69+
if (user.permissionNames.includes('read_group')) {
70+
this._groupsService.repository.reloadAll();
71+
}
72+
if (user.permissionNames.includes('read_permission')) {
73+
this._permissionsService.repository.reloadAll();
74+
}
75+
}
76+
});
6277
if (isPlatformBrowser(this._platformId)) {
6378
this._tokenService.tokenHasExpired$.pipe(takeUntil(this._destroyed$)).subscribe(result => {
6479
if (result === true) {

0 commit comments

Comments
 (0)