Skip to content

Commit 6f87535

Browse files
committed
updates
1 parent 15cd53a commit 6f87535

File tree

100 files changed

+1599
-373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1599
-373
lines changed

eform-client/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"private": true,
1515
"dependencies": {
1616
"@angular/animations": "^6.0.3",
17+
"@angular/cdk": "^6.4.6",
1718
"@angular/common": "^6.0.3",
1819
"@angular/compiler": "^6.0.3",
1920
"@angular/core": "^6.0.3",
@@ -23,7 +24,9 @@
2324
"@angular/platform-browser-dynamic": "^6.0.3",
2425
"@angular/router": "^6.0.3",
2526
"@ng-select/ng-select": "^2.3.3",
26-
"@ngx-gallery/core": "^3.1.0-beta.0",
27+
"@ngx-gallery/core": "^3.1.0",
28+
"@ngx-gallery/gallerize": "^3.1.0",
29+
"@ngx-gallery/lightbox": "^3.1.0",
2730
"@ngx-translate/core": "^10.0.2",
2831
"@ngx-translate/http-loader": "^3.0.1",
2932
"angular2-uuid": "^1.1.1",

eform-client/src/app/app.declarations.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from 'src/app/common/services/advanced';
1212
import {AppSettingsService} from 'src/app/common/services/app-settings';
1313
import {AuthService, LocaleService, UserSettingsService} from 'src/app/common/services/auth';
14-
import {CasesService} from 'src/app/common/services/cases';
14+
import {CasesService, ImageService} from 'src/app/common/services/cases';
1515
import {DeviceUserService} from 'src/app/common/services/device-users';
1616
import {EFormService, EFormTagService} from 'src/app/common/services/eform';
1717
import {AdminService} from 'src/app/common/services/users';
@@ -37,6 +37,7 @@ export let providers = [
3737
EFormService,
3838
EFormTagService,
3939
CasesService,
40+
ImageService,
4041
// Helpers
4142
EventBrokerService,
4243
DatePipe,

eform-client/src/app/app.module.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import {HttpClientModule} from '@angular/common/http';
22
import {BrowserModule} from '@angular/platform-browser';
33
import {NgModule, NO_ERRORS_SCHEMA} from '@angular/core';
44
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
5+
import {GalleryModule} from '@ngx-gallery/core';
6+
import {GallerizeModule} from '@ngx-gallery/gallerize';
57
import {TranslateModule} from '@ngx-translate/core';
8+
import { LightboxModule } from '@ngx-gallery/lightbox';
69
import {DragulaModule} from 'ng2-dragula';
710
import {ToastrModule} from 'ngx-toastr';
811

@@ -63,6 +66,9 @@ import {
6366
BrowserAnimationsModule,
6467
ToastrModule.forRoot(),
6568
DragulaModule.forRoot(),
69+
GalleryModule.forRoot(),
70+
LightboxModule.forRoot(),
71+
GallerizeModule,
6672
// Modules
6773
PluginsModule
6874
],

eform-client/src/app/app.routing.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ export const routes: Routes = [
4545
canActivate: [AuthGuard],
4646
loadChildren: './modules/account-management/account-management.module#AccountManagementModule'
4747
},
48-
// {
49-
// path: 'plugins',
50-
// canActivate: [AuthGuard],
51-
// loadChildren: './plugins/plugins.module#PluginsModule',
52-
// data: { preload: true }
53-
// },
48+
{
49+
path: 'plugins',
50+
canActivate: [AuthGuard],
51+
loadChildren: './plugins/plugins.module#PluginsModule'
52+
},
5453
]
5554
},
5655
{

eform-client/src/app/common/modules/eform-imported/ng-datepicker/component/ng-datepicker.component.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<div class="ngx-datepicker-container">
22
<div class="md-form">
3-
<i class="material-icons prefix" (click)="toggle()">
3+
<i class="material-icons prefix text-black-50" (click)="toggle()">
44
date_range
55
</i>
66
<input mdbInputDirective type="text" *ngIf="!headless" class="form-control"
77
[(ngModel)]="displayValue" readonly [placeholder]="placeholder"
88
[ngClass]="addClass" [ngStyle]="addStyle" [id]="fieldId" [disabled]="disabled" (click)="toggle()"/>
9+
<label style="
10+
font-size: 13px;
11+
margin-top: -23px;" for="{{fieldId}}" *ngIf="placeholder && innerValue">{{placeholder}}</label>
912
</div>
1013

1114
<ng-content></ng-content>

eform-client/src/app/common/modules/eform-imported/ng-datepicker/component/ng-datepicker.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ export class NgDatepickerComponent implements ControlValueAccessor, OnInit, OnCh
130130
}
131131

132132
set value(val: Date) {
133-
this.innerValue = val;
133+
val = new Date(val.setHours(val.getHours() + 4));
134+
this.innerValue = val;
134135
this.onChangeCallback(this.innerValue);
135136
}
136137

@@ -277,7 +278,6 @@ export class NgDatepickerComponent implements ControlValueAccessor, OnInit, OnCh
277278
isSelectable: this.isDateSelectable(date)
278279
});
279280
}
280-
281281
if (this.innerValue) {
282282
this.displayValue = format(this.innerValue, this.displayFormat, this.locale);
283283
this.barTitle = format(start, this.barTitleFormat, this.locale);
@@ -339,6 +339,9 @@ export class NgDatepickerComponent implements ControlValueAccessor, OnInit, OnCh
339339
this.init();
340340
this.displayValue = format(this.innerValue, this.displayFormat, this.locale);
341341
this.barTitle = format(startOfMonth(val), this.barTitleFormat, this.locale);
342+
} else {
343+
this.innerValue = null;
344+
this.displayValue = null;
342345
}
343346
}
344347

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
<div #pell>
2-
<div [class]="actionBarClass">
3-
<button *ngFor="let action of actions" [class]="actionButtonClass" [title]="action.title"
4-
(click)="action.result()" [innerHTML]="action.icon">
5-
</button>
6-
</div>
7-
<div contenteditable="true" [class]="contentClass" (input)="onInput($event)"></div>
8-
</div>
1+
<div #wysiwyg></div>
Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,61 @@
1-
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
1+
import { Component, OnInit, OnChanges, AfterViewInit, Input, Output, EventEmitter } from '@angular/core';
2+
import { ElementRef, Renderer2, ViewChild, ViewEncapsulation } from '@angular/core';
23
import * as pell from './pell';
34

45

56
@Component({
67
selector: 'pell-editor',
7-
templateUrl: './pell.component.html'
8+
templateUrl: './pell.component.html',
9+
encapsulation: ViewEncapsulation.None
810
})
9-
export class PellComponent implements OnInit {
10-
actions = Object.keys(pell.actions).map(action => pell.actions[action]);
11-
actionBarClass = 'pell-actionbar';
12-
actionButtonClass = 'pell-button';
13-
contentClass = 'pell-content';
11+
export class PellComponent implements OnInit, AfterViewInit, OnChanges {
12+
@Input() actions: Array<Object> = [];
13+
@Input() value: String = '';
14+
@Output() valueChange = new EventEmitter();
15+
pell = pell;
16+
html;
17+
editor;
1418

15-
@Output()
16-
onChange = new EventEmitter<string>()
17-
constructor() { }
19+
constructor(
20+
private rd: Renderer2
21+
22+
) { }
1823

1924
ngOnInit() {
2025
}
2126

22-
onInput(event: any) {
23-
this.onChange.emit(event.target.innerHTML);
27+
@ViewChild('wysiwyg') wysiwyg: ElementRef;
28+
29+
ngAfterViewInit() {
30+
this.wysiwygInit(this.wysiwyg.nativeElement, this.actions);
31+
this.editor.content.innerHTML = this.value;
32+
}
33+
34+
ngOnChanges(changes: any) {
35+
try {
36+
if (this.editor.content.innerHTML != this.value) {
37+
this.editor.content.innerHTML = this.value;
38+
}
39+
} catch (err) {
40+
41+
}
42+
}
43+
44+
wysiwygInit(elm, actions) {
45+
this.editor = pell.init({
46+
element: elm,
47+
onChange: html => {
48+
this.html = html;
49+
this.valueChange.emit(this.html);
50+
},
51+
styleWithCSS: true,
52+
actions: [
53+
'bold',
54+
'underline',
55+
'italic',
56+
'strikethrough',
57+
].concat(actions),
58+
classes: {}
59+
});
2460
}
2561
}
Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const actions = {
1+
const actions = {
22
bold: {
33
icon: '<b>B</b>',
44
title: 'Bold',
@@ -14,56 +14,61 @@ export const actions = {
1414
title: 'Underline',
1515
result: () => exec('underline')
1616
},
17+
strikethrough: {
18+
icon: '<strike>S</strike>',
19+
title: 'Strike-through',
20+
result: () => exec('strikeThrough')
21+
}
1722
};
1823

1924
const classes = {
2025
actionbar: 'pell-actionbar',
2126
button: 'pell-button',
2227
content: 'pell-content'
23-
}
28+
};
2429

2530
export const exec = (command, value = null) => {
26-
document.execCommand(command, false, value)
27-
}
31+
document.execCommand(command, false, value);
32+
};
2833

2934
const preventTab = event => {
30-
if (event.which === 9) event.preventDefault()
31-
}
35+
if (event.which === 9) { event.preventDefault(); }
36+
};
3237

3338
export const init = settings => {
3439
settings.actions = settings.actions
3540
? settings.actions.map(action => {
36-
if (typeof action === 'string') return actions[action]
37-
else if (actions[action.name]) return { ...actions[action.name], ...action }
38-
return action
41+
if (typeof action === 'string') { return actions[action]; }
42+
else if (actions[action.name]) { return { ...actions[action.name], ...action }; }
43+
return action;
3944
})
40-
: Object.keys(actions).map(action => actions[action])
45+
: Object.keys(actions).map(action => actions[action]);
4146

42-
settings.classes = { ...classes, ...settings.classes }
47+
settings.classes = { ...classes, ...settings.classes };
4348

44-
const actionbar = document.createElement('div')
45-
actionbar.className = settings.classes.actionbar
46-
settings.element.appendChild(actionbar)
49+
const actionbar = document.createElement('div');
50+
actionbar.className = settings.classes.actionbar;
51+
settings.element.appendChild(actionbar);
4752

48-
settings.element.content = document.createElement('div')
49-
settings.element.content.contentEditable = true
50-
settings.element.content.className = settings.classes.content
51-
settings.element.content.oninput = event => settings.onChange(event.target.innerHTML)
52-
settings.element.content.onkeydown = preventTab
53-
settings.element.appendChild(settings.element.content)
53+
settings.element.content = document.createElement('div');
54+
settings.element.content.contentEditable = true;
55+
settings.element.content.className = settings.classes.content;
56+
settings.element.content.oninput = event => settings.onChange(event.target.innerHTML);
57+
settings.element.content.onkeydown = preventTab;
58+
settings.element.appendChild(settings.element.content);
5459

5560
settings.actions.forEach(action => {
56-
const button = document.createElement('button')
57-
button.className = settings.classes.button
58-
button.innerHTML = action.icon
59-
button.title = action.title
60-
button.onclick = action.result
61-
actionbar.appendChild(button)
62-
})
61+
const button = document.createElement('button');
62+
button.className = settings.classes.button;
63+
button.innerHTML = action.icon;
64+
button.title = action.title;
65+
button.onclick = action.result;
66+
actionbar.appendChild(button);
67+
});
6368

64-
if (settings.styleWithCSS) exec('styleWithCSS')
69+
if (settings.styleWithCSS) { exec('styleWithCSS'); }
6570

66-
return settings.element
67-
}
71+
return settings.element;
72+
};
6873

69-
export default { exec, init }
74+
export default { exec, init };

eform-client/src/app/common/services/auth/auth.service.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ export class AuthService extends BaseService {
4646
if (loginInfo.code) {
4747
body = body.append('code', loginInfo.code);
4848
}
49-
debugger;
5049
return this.postUrlEncoded(AuthMethods.Login, body).pipe(map((result) => {
5150
return result;
5251
}));
@@ -96,10 +95,6 @@ export class AuthService extends BaseService {
9695
}));
9796
}
9897

99-
logout(): Observable<any> {
100-
return this.get(AuthMethods.Logout);
101-
}
102-
10398
twoFactorAuthInfo(): Observable<OperationDataResult<boolean>> {
10499
return this.get(AuthMethods.TwoFactorAuthInfo);
105100
}

0 commit comments

Comments
 (0)