Commit c92fbc0a by Harsh Shah

Error Message component added, minor changes in Edit WF/Message components

parent 94835b32
import { NgModule } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { Select2Component, Select2Module } from 'ng2-select2';
import { Select2Module } from 'ng2-select2';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { ModalModule } from 'ngx-bootstrap/modal';
import { DeviceDetectorModule } from 'ngx-device-detector';
......@@ -15,6 +15,7 @@ import { EditMessageTemplateComponent } from './components/edit-message-template
import { EditMessageTemplateService } from './components/edit-message-template/edit-message-template.service';
import { EditWorkflowTemplateComponent } from './components/edit-workflow-template/edit-workflow-template.component';
import { EditWorkflowTemplateService } from './components/edit-workflow-template/edit-workflow-template.service';
import { ErrorMessageComponent } from './components/error-message/error-message.component';
import { ListMessageTemplateComponent } from './components/list-message-template/list-message-template.component';
import { ListWorkFlowsComponent } from './components/list-work-flows/list-work-flows.component';
import { SelectTwoComponent } from './components/select-2/select-2.component';
......@@ -39,7 +40,8 @@ import { OneITModule } from './oneit/oneit.module';
ListMessageTemplateComponent,
ListWorkFlowsComponent,
EditWorkflowTemplateComponent,
SelectTwoComponent
SelectTwoComponent,
ErrorMessageComponent
],
providers: [
FormBuilder,
......
......@@ -47,19 +47,6 @@
(click)="createJobClicked()">
Create Job
</a>
<!-- <%
if(selectedTeam != null && companyUser != null)
{
Article jobsArticle = WebUtils.getArticleByShortCut(objTran, WebUtils.JOBS);
boolean onJob = WebUtils.onJobPages(renderMode);
boolean hasBillingSetup = selectedTeam.hasBillingSetup();
boolean canCreateJob = selectedTeam.allowJobCreation();
boolean trialNotAllowed = selectedTeam.trialJobNotAllowed();
%>
<a href="<%= onJob || !canCreateJob ? "javascript:void(0);": jobsArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", WebUtils.START_JOB).toMap()) %>" class="<%= onJob || !hasBillingSetup ? "disabled" : ""%>" onclick="<%= canCreateJob ? "" : trialNotAllowed ? "trialNotAllowed()" : "showReachedCap()"%>">Create Job</a>
<%
}
%> -->
</div>
</div>
</div>
......@@ -89,84 +76,6 @@
</ng-container>
</div>
</ng-template>
<!-- <%
if(selectedTeam != null && companyUser != null)
{
%>
<div class="modal fade" id="reachedCap" role="dialog">
<div class="modal-dialog welcome-pop-top">
<div class="modal-body main-welcome-popup">
<h2>Your account reached monthly cap!</h2>
<%
if(companyUser.getRoleForHiringTeam(selectedTeam) == RoleType.STANDARD)
{
%>
<p>Your account has reached the monthly cap for number of jobs, contact your Administrator to have the Cap increased.</p>
<%
}
else
{
%>
<p>Your account has reached the monthly cap for number of jobs. Please make a request by contacting us to make changes.</p>
<div class="create-y-f-job">
<a href=" https://www.matchd.com/support/" target="_blank">Make a Request</a>
</div>
<%
}
%>
</div>
</div>
</div>
<oneit:form name="popupForm" method="post" enctype="multipart/form-data">
<div class="modal fade" id="trialNotAllowed" role="dialog">
<div class="modal-dialog welcome-pop-top">
<div class="modal-body main-welcome-popup">
<h2>Your account is on trial!</h2>
<%
if(companyUser.getRoleForHiringTeam(selectedTeam) == RoleType.STANDARD)
{
%>
<p>Only one Job can be created during the Trial. Please contact your Administrator to set up billing</p>
<%
}
else
{
%>
<p>Only one Job can be created during the Trial. <%= selectedTeam.getCardID() == null ? "Enter Billing Method and" : "" %> Select Plan to enable creation of additional jobs.</p>
<div class="create-y-f-job">
<oneit:button value=" " name="gotoPage" skin="link"
requestAttribs="<%= CollectionUtils.mapEntry("nextPage", companyArticle.getLink(request, CollectionUtils.mapEntry("cms.rm", selectedTeam.getCardID() == null ? "Billing" : "ManagePlan").toMap()))
.mapEntry("procParams", CollectionUtils.mapEntry("HiringTeam", selectedTeam).toMap())
.toMap() %>">
Setup <%= selectedTeam.getCardID() == null ? "Billing" : "Payment Plan" %>
</oneit:button>
</div>
<%
}
%>
</div>
</div>
</div>
</oneit:form>
<%
}
%>
<script type="text/javascript">
$(document).ready(function()
{
if($('.dashboard-content-area').height() < $(window).height())
{
($('.dashboard-content-area').hasClass('second-part') ) ?
$('.dashboard-content-area').height($(window).height() - $('.dashboard-content-area').outerHeight() + $('.dashboard-content-area').height() - 65) :
$('.second-part').innerHeight( $(window).height() - $('.dashboard-first-part').outerHeight() - 65 )
}
});
</script>
<%
}
%> -->
<div class="container-fluid">
<div class="row content">
<div class="sidebar-menu fixed">
......@@ -184,7 +93,7 @@
</ul>
</div>
</div>
<router-outlet></router-outlet>
<router-outlet (activate)="onRouteUpdate()"></router-outlet>
</div>
</div>
<p-progressSpinner animationDuration="1s" *ngIf="showLoader"></p-progressSpinner>
\ No newline at end of file
import { Message } from '@angular/compiler/src/i18n/i18n_ast';
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { Router } from '@angular/router';
import { BsModalService } from 'ngx-bootstrap/modal';
......@@ -17,16 +17,13 @@ import { AdminPortalLayoutService } from './admin-portal-layout.service';
templateUrl: './admin-portal-layout.component.html',
styleUrls: ['./admin-portal-layout.component.css']
})
export class AdminPortalLayoutComponent implements OnInit {
export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
@ViewChild('reachedCapModal') reachedCapModal;
@ViewChild('trialNotAllowedModal') trialNotAllowedModal;
showLoader: boolean;
subscriptions: Array<Subscription> = [];
errorMsgs: Message[] = [];
successMsgs: Message[] = [];
showAllErrorsCalled: boolean = false;
dialogOpen: boolean = false;
clientName: string;
userName: string;
homeURL: string;
......@@ -68,20 +65,6 @@ export class AdminPortalLayoutComponent implements OnInit {
)
);
this.subscriptions.push(
this.msgsService.errorMsgsUpdated.subscribe(
data => {
this.errorMsgs = data;
}
)
);
this.subscriptions.push(
this.msgsService.showAllErrors.subscribe((data) => {
this.showAllErrorsCalled = data;
})
);
this.titleService.setTitle('Matchd');
this.subscribeToUserData();
this.loadData();
......@@ -190,4 +173,8 @@ export class AdminPortalLayoutComponent implements OnInit {
)
);
}
ngOnDestroy() {
this.utilsService.unsubscribeSubscriptions(this.subscriptions);
}
}
<form #form="ngForm">
<div class="dashboard-content-area second-part">
<app-error-message></app-error-message>
<form #form="ngForm">
<div class="ui-g ui-fluid mt-80">
<div class="ui-g-10 listing-title pt-0 pb-0">{{editMode ? "Edit" : "Add"}} Message Template</div>
</div>
......@@ -121,4 +123,5 @@
</div>
<div id="showPlainText"></div>
<p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
</form>
</form>
</div>
\ No newline at end of file
<form #form="ngForm">
<div class="dashboard-content-area second-part">
<app-error-message></app-error-message>
<form #form="ngForm">
<div class="ui-g ui-fluid">
<div class="ui-g-12 nopad">
<p-toolbar>
......@@ -1012,4 +1014,5 @@
</div>
</div>
<p-progressSpinner *ngIf="showLoader"></p-progressSpinner>
</form>
</form>
</div>
\ No newline at end of file
<div class="error-message message-common" *ngIf="errorMsgs && errorMsgs.length > 0">
<img src="assets/images/error-alert.png" class="alert-icon"/>
<ng-container *ngFor="let msg of errorMsgs">
<span class="message-txt" style="font-weight: bold" *ngIf="msg.summary">
{{ msg.summary }}
</span>
<span class="message-txt" *ngIf="msg.detail">
{{ msg.detail }}
</span>
</ng-container>
</div>
import { Message } from '@angular/compiler/src/i18n/i18n_ast';
import { Component, OnInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { MsgsService } from '../../oneit/services/msgs.service';
import { UtilsService } from '../../oneit/services/utils.service';
@Component({
selector: 'app-error-message',
templateUrl: './error-message.component.html'
})
export class ErrorMessageComponent implements OnInit {
subscriptions: Array<Subscription> = [];
errorMsgs: Message[] = [];
showAllErrorsCalled: boolean = false;
dialogOpen: boolean = false;
constructor(
private msgsService: MsgsService,
private utilsService: UtilsService,
) { }
ngOnInit() {
this.subscriptions.push(
this.msgsService.errorMsgsUpdated.subscribe(
data => {
console.log(data);
this.errorMsgs = data;
}
)
);
this.subscriptions.push(
this.msgsService.showAllErrors.subscribe((data) => {
this.showAllErrorsCalled = data;
})
);
}
ngOnDestroy() {
this.utilsService.unsubscribeSubscriptions(this.subscriptions);
}
}
......@@ -5,7 +5,7 @@
},
"messages": {
"SAVE_SUCCESS": "Details saved successfully",
"FORM_ERROR": "Errors occured, please correct them before continuing!",
"FORM_ERROR": "Errors occurred, please correct them and try again",
"MESSAGE_ERROR_SUMMARY": "Error Message",
"MESSAGE_SUCCESS_SUMMARY": "Success Message",
"SERVER_NOT_RESPONSE": "API Not Responding"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment