- Activate
@@ -223,6 +223,7 @@
Content |
Placement |
Order |
+ Before |
Active |
Actions |
@@ -239,7 +240,7 @@
- {{check.pageHelpContent.content}}
+
|
{{check.pageHelpContent.placement}}
@@ -248,6 +249,10 @@
{{check.pageHelpContent.order}}
|
+
+ {{check.pageHelpContent.isPriorTo}}
+
+ |
@@ -159,7 +159,7 @@
-
+
diff --git a/app/pages/modal-form.component.ts b/app/pages/modal-form.component.ts
index 6539701..6f55420 100644
--- a/app/pages/modal-form.component.ts
+++ b/app/pages/modal-form.component.ts
@@ -11,6 +11,7 @@ import { HelpContentService } from "../services/help-content.service";
import { Page } from "../domain/page";
import { Entity } from "../domain/entity";
import { Community } from "../domain/community";
+import { DivId } from "../domain/divId";
@Component({
selector: 'modal-form',
@@ -60,59 +61,76 @@ export class ModalFormComponent {
}
public saveCustom(obj : any) {
- if(!this.formGroup.valid) {
- this.errorMessage = "Please fill in all required fields marked with *"
+ if (this.type == 'none') {
+ this.emmitObject.emit(true);
+ this.hideModal();
} else {
+ if(!this.formGroup.valid) {
+ this.errorMessage = "Please fill in all required fields marked with *"
+ } else {
- if (this.type == 'topic') {
- this._faqService.saveTopic( obj).subscribe(
- data => this.emmitObject.emit(data),
- error => this.emmitError.emit(error)
- );
- } else if (this.type == 'question') {
- this._faqService.saveQuestion( obj).subscribe(
- data => this.emmitObject.emit(data),
- error => this.emmitError.emit(error)
- );
- } else if (this.type == 'community') {
- if(this.saveText == 'Update') {
- this._helpService.updateCommunity( obj).subscribe(
- data => this.emmitObject.emit(data),
- error => this.emmitError.emit(error)
+ if (this.type == 'topic') {
+ this._faqService.saveTopic( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
);
- console.info( obj);
+ } else if (this.type == 'question') {
+ this._faqService.saveQuestion( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ } else if (this.type == 'community') {
+ if(this.saveText == 'Update') {
+ this._helpService.updateCommunity( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ console.info( obj);
- } else if(this.saveText == 'Save') {
- this._helpService.saveCommunity( obj).subscribe(
- data => this.emmitObject.emit(data),
- error => this.emmitError.emit(error)
- );
- console.info( obj);
- }
- } else if (this.type == 'page') {
- if(this.saveText == 'Update') {
- this._helpService.updatePage( obj).subscribe(
- data => this.emmitObject.emit(data),
- error => this.emmitError.emit(error)
- );
- } else if(this.saveText == 'Save') {
- this._helpService.savePage( obj).subscribe(
- data => this.emmitObject.emit(data),
- error => this.emmitError.emit(error)
- );
- }
- } else if (this.type == 'entity') {
- if(this.saveText == 'Update') {
- this._helpService.updateEntity( obj).subscribe(
- data => this.emmitObject.emit(data),
- error => this.emmitError.emit(error)
- );
- } else if(this.saveText == 'Save') {
- this._helpService.saveEntity( obj).subscribe(
- data => this.emmitObject.emit(data),
- error => this.emmitError.emit(error)
- );
- }
+ } else if(this.saveText == 'Save') {
+ this._helpService.saveCommunity( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ console.info( obj);
+ }
+ } else if (this.type == 'page') {
+ if(this.saveText == 'Update') {
+ this._helpService.updatePage( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ } else if(this.saveText == 'Save') {
+ this._helpService.savePage( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ }
+ } else if (this.type == 'entity') {
+ if(this.saveText == 'Update') {
+ this._helpService.updateEntity( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ } else if(this.saveText == 'Save') {
+ this._helpService.saveEntity( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ }
+ } else if (this.type == 'divId') {
+ if(this.saveText == 'Update') {
+ this._helpService.updateDivId( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ } else if(this.saveText == 'Save') {
+ this._helpService.saveDivId( obj).subscribe(
+ data => this.emmitObject.emit(data),
+ error => this.emmitError.emit(error)
+ );
+ }
+ }
}
this.hideModal();
}
diff --git a/app/services/help-content.service.ts b/app/services/help-content.service.ts
index db8d176..c47b9b0 100644
--- a/app/services/help-content.service.ts
+++ b/app/services/help-content.service.ts
@@ -8,7 +8,8 @@ import { Page } from "../domain/page";
import { PageHelpContent } from "../domain/page-help-content";
import { Community } from "../domain/community";
import { Entity } from "../domain/entity";
-
+import { DivId } from "../domain/divId";
+import { DivHelpContent } from "../domain/div-help-content";
@Injectable()
export class HelpContentService {
@@ -26,6 +27,113 @@ export class HelpContentService {
}
}
+ getDivIdsFull(community_pid: string, page_id: string) {
+ if(page_id) {
+ return this.http.get(this._helpContentUrl + 'divFull?community='+community_pid+'&page='+page_id)
+ .map(res => > res.json())
+ .catch(this.handleError);
+ } else {
+ return this.http.get(this._helpContentUrl + 'divFull?community='+community_pid)
+ .map(res => > res.json())
+ .catch(this.handleError);
+ }
+ }
+
+ updateDivId(divId: DivId) {
+ let headers = new Headers({'Content-Type': 'application/json'});
+ let options = new RequestOptions({headers: headers});
+
+ HelpContentService.removeNulls(divId);
+
+ return this.http.post(this._helpContentUrl + 'div/update', JSON.stringify(divId), options)
+ .map(res => res.json())
+ .catch(this.handleError);
+ }
+
+ getDivId(divId: string) {
+ return this.http.get(this._helpContentUrl + 'div/'+divId)
+ .map(res => res.json())
+ .catch(this.handleError);
+ }
+
+ saveDivId(divId: DivId) {
+ let headers = new Headers({'Content-Type': 'application/json'});
+ let options = new RequestOptions({headers: headers});
+
+ HelpContentService.removeNulls(divId);
+
+ return this.http.post(this._helpContentUrl + 'div/save', JSON.stringify(divId), options)
+ .map(res => res.json())
+ .catch(this.handleError);
+ }
+
+ getCommunitiesWithDivId() {
+ return this.http.get(this._helpContentUrl + 'community?div=true')
+ .map(res => > res.json())
+ .catch(this.handleError);
+ }
+
+ getCommunityPagesWithDivId(community_pid: string) {
+ return this.http.get(this._helpContentUrl + 'community/'+community_pid+'/pages?div=true')
+ .map(res => > res.json())
+ .catch(this.handleError);
+ }
+
+ getCommunityDivHelpContents(community_pid: string) {
+ return this.http.get(this._helpContentUrl + 'divhelpcontent?community='+community_pid)
+ .map(res => > res.json())
+ .catch(this.handleError);
+ }
+
+ getDivHelpContent(id : string) {
+ return this.http.get(this._helpContentUrl + 'divhelpcontent/' + id)
+ .map(res => res.json())
+ .catch(this.handleError);
+ }
+
+ insertOrUpdateDivHelpContent(divHelpContent: DivHelpContent) {
+
+ let headers = new Headers({'Content-Type': 'application/json'});
+ let options = new RequestOptions({headers: headers});
+
+ HelpContentService.removeNulls(divHelpContent);
+
+ return this.http.post(this._helpContentUrl + 'divhelpcontent', JSON.stringify(divHelpContent), options)
+ .map(res => res.json())
+ .catch(this.handleError);
+ }
+
+ deleteDivIds(ids : string[]) {
+ let headers = new Headers({'Content-Type': 'application/json'});
+ let options = new RequestOptions({headers: headers});
+
+ return this.http.post(this._helpContentUrl + 'div/delete',JSON.stringify(ids), options)
+ .catch(this.handleError);
+ }
+
+ deleteDivHelpContents(ids : string[]) {
+ let headers = new Headers({'Content-Type': 'application/json'});
+ let options = new RequestOptions({headers: headers});
+
+ return this.http.post(this._helpContentUrl + 'divhelpcontent/delete',JSON.stringify(ids), options)
+ .catch(this.handleError);
+ }
+
+ toggleDivHelpContents(ids : string[],status : boolean) {
+ let headers = new Headers({'Content-Type': 'application/json'});
+ let options = new RequestOptions({headers: headers});
+
+ return this.http.post(this._helpContentUrl + 'divhelpcontent/toggle?status='+ status.toString(), JSON.stringify(ids), options)
+ //.map( res => res.json())
+ .catch(this.handleError);
+ }
+
+ getPagesWithDivIds(community_pid: string) {
+ return this.http.get(this._helpContentUrl + 'div/pages?communtity='+community_pid)
+ .map(res => |