Commit 8cd1c29d by GD-A-150752

message-engine-hiring-team

parent 812d5215
......@@ -7,7 +7,7 @@ import { DeviceDetectorModule } from 'ngx-device-detector';
import { DndModule } from 'ngx-drag-drop';
import {
ConfirmationService,
DragDropModule,
DragDropModule, FileUploadModule,
InputMaskModule,
MultiSelectModule,
OrderListModule
......@@ -45,7 +45,8 @@ import { OneITModule } from './oneit/oneit.module';
DragDropModule,
OrderListModule,
MultiSelectModule,
DndModule
DndModule,
FileUploadModule
],
declarations: [
AppComponent,
......
......@@ -122,7 +122,7 @@ export const routes: Routes = [
canActivate: [AuthGuard]
},
{
path: 'message-engine/:jobId',
path: 'message-engine',
component: MessageEngineApplicantViewComponent
}
]
......
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { MessageTemplateModel } from "./models/message-template.model";
import { environment } from '../environments/environment';
import { MessageTemplateModel } from './models/message-template.model';
import { PlaceholderOptionsEnum } from './models/placeholder-options.enum';
import { TemplateTypeEnum } from './models/template-type.enum';
import { ApiService } from './oneit/services/api.service';
import { EnumService } from './oneit/services/enum.service';
import { SearchService } from './oneit/services/search.service';
import { UtilsService } from './oneit/services/utils.service';
......@@ -14,7 +16,8 @@ export class AppService {
constructor(
private enumService: EnumService,
private searchService: SearchService,
private utilsService: UtilsService
private utilsService: UtilsService,
private apiService: ApiService
) {
}
......@@ -53,4 +56,20 @@ export class AppService {
}
);
}
processObjects(serviceName: string, dataParams): Observable<any> {
const params: any = {
environment: environment.envName, // Fetch this from environment e.g. environment.envName
...dataParams
};
return this.apiService.post(`svc/${serviceName}`, params)
.map(
data => {
if (this.utilsService.isSuccessfulResponse(data)) {
return data;
}
}
);
}
}
......@@ -28,7 +28,7 @@
<div class="user-profile-dropdown" dropdown *ngIf="userMenu">
<a class="user-name" dropdownToggle href="javascript:void(0)">
{{ userMenu.label }}
<img src="assets/images/arrow.svg" />
<img src="assets/images/arrow.svg"/>
</a>
<ul class="profile-dropdown dropdown-menu" *dropdownMenu>
<span class="arrow-up"></span>
......@@ -43,7 +43,8 @@
</ul>
</div>
<div class="create-job-btn">
<a *ngIf="selectedTeamID && companyUser" [ngClass]="{'disabled': createJobDisabled}" href="javascript:void(0)"
<a *ngIf="selectedTeamID && companyUser" [ngClass]="{'disabled': createJobDisabled}"
href="javascript:void(0)"
(click)="createJobClicked()">
Create Job
</a>
......@@ -55,9 +56,11 @@
<ng-template #reachedCapModal>
<div class="modal-body main-welcome-popup">
<h2>Your account reached monthly cap!</h2>
<p *ngIf="isStandardUser">Your account has reached the monthly cap for number of jobs, contact your Administrator to have the Cap increased.</p>
<p *ngIf="isStandardUser">Your account has reached the monthly cap for number of jobs, contact your
Administrator to have the Cap increased.</p>
<ng-container *ngIf="!isStandardUser">
<p>Your account has reached the monthly cap for number of jobs. Please make a request by contacting us to make changes.</p>
<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>
......@@ -67,9 +70,12 @@
<ng-template #trialNotAllowedModal>
<div class="modal-body main-welcome-popup">
<h2>Your account is on trial!</h2>
<p *ngIf="isStandardUser">Only one Job can be created during the Trial. Please contact your Administrator to set up billing.</p>
<p *ngIf="isStandardUser">Only one Job can be created during the Trial. Please contact your Administrator to set
up billing.</p>
<ng-container *ngIf="!isStandardUser">
<p>Only one Job can be created during the Trial. {{ !selectedTeam || !selectedTeam.CardID ? "Enter Billing Method and" : "" }} Select Plan to enable creation of additional jobs.</p>
<p>Only one Job can be created during the
Trial. {{ !selectedTeam || !selectedTeam.CardID ? "Enter Billing Method and" : "" }} Select Plan to
enable creation of additional jobs.</p>
<div class="create-y-f-job">
<a [routerLink]="['admin/iframe-page', redirectURL]">{{ !selectedTeam || !selectedTeam.CardID ? "Billing" : "Payment Plan" }}</a>
</div>
......@@ -97,5 +103,11 @@
<router-outlet (activate)="onRouteUpdate()"></router-outlet>
</div>
</div>
<p-dialog #messageEngine [(visible)]="showChat" header="" [modal]="true" [responsive]="true"
class="message-engine" [style]="{width: '300px', height: '500px'}">
<app-message-engine-applicant-view *ngIf="showChat" [embedded]="true"
(minimize)="showChat = false"></app-message-engine-applicant-view>
</p-dialog>
<div *ngIf="showBubble" class="chat-icon" (click)="showChat = !showChat"></div>
<p-progressSpinner animationDuration="1s" *ngIf="showLoader"></p-progressSpinner>
<app-feedback></app-feedback>
......@@ -6,12 +6,12 @@ import { BsModalService } from 'ngx-bootstrap/modal';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subscription } from 'rxjs';
import { environment } from '../../../../environments/environment';
import { IframeMsgHandlingService } from "../../../oneit/services/iframe-msg-handling.service";
import { MsgsService } from '../../../oneit/services/msgs.service';
import { UserService } from '../../../oneit/services/user.service';
import { UtilsService } from '../../../oneit/services/utils.service';
import { AdminPortalLayoutService } from './admin-portal-layout.service';
@Component({
selector: 'app-admin-portal-layout',
templateUrl: './admin-portal-layout.component.html'
......@@ -22,7 +22,7 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
@ViewChild('trialNotAllowedModal') trialNotAllowedModal;
showLoader: boolean;
subscriptions: Array<Subscription> = [];
successMsgs: Message[] = [];
successMsgs: Array<Message> = [];
clientName: string;
userName: string;
homeURL: string;
......@@ -31,15 +31,16 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
selectedTeam: any;
selectedTeamID: string;
redirectURL: string;
createJobDisabled : boolean;
createJobDisabled: boolean;
isStandardUser: boolean;
hiringTeams: any[];
hiringTeams: Array<any>;
userMenu: any;
sidebarMenu: any;
select2Options = {
minimumResultsForSearch: Infinity
}
};
showChat = false;
showBubble = false;
constructor(
private deviceService: DeviceDetectorService,
......@@ -49,12 +50,28 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
private utilsService: UtilsService,
private titleService: Title,
private router: Router,
private modalService: BsModalService
) { }
private modalService: BsModalService,
private iframeMsgHandlingService: IframeMsgHandlingService
) {
}
ngOnInit(): void {
// Subscribe to msgReceived of iframeMsgHandlingService to get JobId
this.subscriptions.push(this.iframeMsgHandlingService.msgReceived.subscribe(
(message: any) => {
if (!message || !message.name) {
return;
}
if (message.name !== 'HiringTeamChat' || message.message === null) {
return;
}
ngOnInit() {
if(this.deviceService.isMobile()) {
window.location.href = (environment.baseUrl + "extensions/adminportal/responsive_alert.jsp");
this.showBubble = true;
}
));
if (this.deviceService.isMobile()) {
window.location.href = `${environment.baseUrl}extensions/adminportal/responsive_alert.jsp`;
}
this.subscriptions.push(
this.msgsService.successMsgsUpdated.subscribe(
......@@ -69,11 +86,11 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
this.loadData();
}
onRouteUpdate() {
onRouteUpdate(): void {
this.loadData();
}
loadData() {
loadData(): void {
this.userService.reloadUserDetails();
this.msgsService.clearErrorMessages();
......@@ -82,7 +99,7 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
this.userName = this.userService.getUsername();
}
subscribeToUserData() {
subscribeToUserData(): void {
this.subscriptions.push(this.adminPortalLayoutService.userDataUpdated.subscribe(
data => {
this.clientName = data.ClientName || this.userService.getFullName();
......@@ -94,16 +111,16 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
this.hiringTeams = data.HiringTeams;
this.createJobDisabled = data.CreateJobDisabled;
if(this.hiringTeams) {
//this.utilsService.addNULLOptionForAssocSelect(this.hiringTeams, 'HiringTeamName');
for(let hiringTeam of this.hiringTeams) {
hiringTeam.id = hiringTeam.ObjectID; //Added for select2
if (this.hiringTeams) {
// this.utilsService.addNULLOptionForAssocSelect(this.hiringTeams, 'HiringTeamName');
for (const hiringTeam of this.hiringTeams) {
hiringTeam.id = hiringTeam.ObjectID; // Added for select2
hiringTeam.text = hiringTeam.HiringTeamName;
}
}
if(this.companyName) {
this.titleService.setTitle('Matchd - ' + this.companyName);
if (this.companyName) {
this.titleService.setTitle(`Matchd - ${this.companyName}`);
} else {
this.titleService.setTitle('Matchd');
}
......@@ -114,25 +131,27 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
));
}
loadMenu() {
this.adminPortalLayoutService.getAdminMenu().subscribe(
loadMenu(): void {
this.adminPortalLayoutService.getAdminMenu()
.subscribe(
data => {
this.userMenu = data.userMenu;
this.sidebarMenu= data.sidebarMenu;
this.sidebarMenu = data.sidebarMenu;
},
error => {
this.utilsService.handleError(error);
}
)
);
}
selectedTeamChanged(event : any): void {
selectedTeamChanged(event: any): void {
this.selectedTeamID = event.value;
this.showLoader = true;
this.subscriptions.push(
this.adminPortalLayoutService.selectHiringTeam(this.selectedTeamID).subscribe (
data => {
this.adminPortalLayoutService.selectHiringTeam(this.selectedTeamID)
.subscribe(
() => {
this.router.navigate(['admin/iframe-page', this.homeURL]);
this.loadData();
this.showLoader = false;
......@@ -148,13 +167,13 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
createJobClicked(): void {
this.showLoader = true;
this.subscriptions.push(
this.adminPortalLayoutService.createJob(this.selectedTeamID, this.companyUser).subscribe (
this.adminPortalLayoutService.createJob(this.selectedTeamID, this.companyUser)
.subscribe(
data => {
if(data.AllowCreateJob) {
if(data.AllowCreateJob === 'REACHED_CAP') {
if (data.AllowCreateJob) {
if (data.AllowCreateJob === 'REACHED_CAP') {
this.modalService.show(this.reachedCapModal);
}
else if(data.AllowCreateJob === 'TRIAL') {
} else if (data.AllowCreateJob === 'TRIAL') {
this.modalService.show(this.trialNotAllowedModal);
} else {
......@@ -173,7 +192,7 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
);
}
ngOnDestroy() {
ngOnDestroy(): void {
this.utilsService.unsubscribeSubscriptions(this.subscriptions);
}
}
......@@ -24,7 +24,7 @@
<label for="MessageTemplate{{messageTemplate.ObjectID}}">Message Template</label>
<input [(ngModel)]="messageTemplate.TemplateName"
name="MessageTemplate{{messageTemplate.ObjectID}}" tabindex="1"
autofocus
autofocus required
fieldLabel="Message Template" type="text" [disabled]="showLoader"
class="form-control" id="MessageTemplate{{messageTemplate.ObjectID}}">
</div>
......@@ -44,7 +44,7 @@
name="Subject{{messageTemplate.ObjectID}}"
fieldLabel="Subject" placeholder="Subject" type="text"
class="form-control" tabindex="2"
[disabled]="showLoader">
[disabled]="showLoader" required>
</div>
<div class="col-md-6" *ngIf="subjectPlaceholderOptions.length">
<label>Placeholder for Subject</label>
......
......@@ -341,7 +341,7 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
attribsByName: 'Autocomplete'
};
if(this.isGlobalHT) {
if (this.isGlobalHT) {
this.subscriptions.push(
combineLatest(
this.editWorkflowTemplateService.getMessageTemplates([], sharedMsgParams)
......
......@@ -2,6 +2,33 @@ a {
color: rgb(3, 160, 231);
}
::ng-deep {
.ui-fileupload-buttonbar {
padding: 0 !important;
.ui-button {
width: 100% !important;
background-color: #667281 !important;
}
}
.ui-fileupload-row {
div:nth-child(n+3) {
display: none;
}
}
.ui-button-text {
padding: 0 !important;
margin-top: 1px;
}
}
.attachments {
display: flex;
flex-direction: column;
}
.message-block {
background-color: white;
border-radius: 20px;
......@@ -41,6 +68,11 @@ a {
}
}
.messages-wrapper {
max-height: 300px;
overflow-y: auto;
}
* {
transition: all .15s;
......@@ -51,12 +83,27 @@ a {
margin-top: 25px;
}
.buttons-wrapper {
display: flex;
flex-direction: row;
margin-top: 10px;
justify-content: space-between;
:last-child {
width: 60%;
min-height: 45px;
display: inline-block;
cursor: pointer;
border-radius: 100px;
}
}
.sendBtn {
letter-spacing: 1px;
color: #fff;
overflow: visible;
position: relative;
width: 100%;
width: 33%;
cursor: pointer;
border-radius: 100px;
background-color: #667281;
......@@ -64,7 +111,6 @@ a {
min-height: 45px;
text-transform: uppercase;
border-color: #667281;
padding-right: 35px;
p {
color: #fff;
......@@ -83,8 +129,8 @@ a {
svg {
position: absolute;
top: 4px;
right: 10px;
top: 0;
right: 30%;
height: 30px;
width: auto;
transition: transform .15s;
......@@ -95,51 +141,21 @@ a {
}
}
@keyframes flyaway {
0% {
transform: rotate(10deg);
top: 13px;
right: 25px;
height: 30px;
}
5% {
transform: rotate(10deg);
top: 13px;
right: 0px;
height: 30px;
}
20% {
transform: rotate(-20deg);
top: 13px;
right: -130px;
height: 45px;
}
40% {
transform: rotate(10deg);
top: -40px;
right: -280px;
opacity: 1;
}
100% {
transform: rotate(60deg);
top: -200px;
right: -1000px;
height: 0;
opacity: 0;
}
}
.main-tab-template {
position: relative;
@keyframes bounce-in {
0% {
padding-right: 30px;
}
40% {
padding-right: 6px;
}
50% {
padding-left: 30px;
.minimize {
position: absolute;
right: 10px;
transform: rotate(-90deg);
cursor: pointer;
height: 20px;
width: 20px;
line-height: normal;
img {
height: 10px;
width: 10px;
}
100% {
padding-left: 6px;
}
}
export class EngineApplicantView {
ObjectID: string;
ObjectClass = 'EngineApplicantView';
ComposeSection: string;
}
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { SaveService } from "../../oneit/services/save.service";
import { SearchService } from '../../oneit/services/search.service';
import { UtilsService } from '../../oneit/services/utils.service';
......@@ -8,7 +9,8 @@ import { UtilsService } from '../../oneit/services/utils.service';
export class MessageEngineApplicantViewService {
constructor(
private searchService: SearchService,
private utilsService: UtilsService
private utilsService: UtilsService,
private saveService: SaveService
) {
}
......
......@@ -29,7 +29,7 @@ export class SelectTwoComponent {
}
@Input() set value(value) {
this._value = value.ObjectID || value.Value;
this._value = value.ObjectID ? value.ObjectID : value.Value;
}
@ViewChild('mySelect') mySelect: Select2Component;
......
......@@ -37,5 +37,8 @@ export const ASSOCS = {
JOB: 'Job',
CANDIDATE: 'Candidate',
USER: 'User',
MESSAGE: 'Message'
MESSAGES: 'Messages',
HIRING_TEAM: 'HiringTeam',
SENT_BY: 'SentBy',
ATTACHMENTS: 'Attachments'
};
......@@ -4,6 +4,6 @@ import { MessageModel } from './message.model';
export class ChatAttachmentModel {
ObjectID: string;
ObjectClass = CLASSES.CHAT_ATTACHMENT;
File: string;
File: {};
Message: MessageModel;
}
export class HiringTeamModel {
ObjectID: string;
HiringTeamName: string;
}
......@@ -33,5 +33,5 @@ export class JobApplicationModel {
Notes: Array<string>;
ScheduledEmails: Array<string>;
SentEmails: Array<string>;
Messages: Array<string>;
Messages: Array<MessageModel>;
}
import { CLASSES } from '../constants';
import { HiringTeamModel } from './hiring-team.model';
export class JobModel {
ObjectID: string;
......@@ -54,7 +55,7 @@ export class JobModel {
Client: string;
JobOwner: string;
CreatedBy: string;
HiringTeam: string;
HiringTeam: HiringTeamModel;
Occupation: string;
ShortenedURL: string;
AssessmentTemplate: string;
......
import { CLASSES } from '../constants';
import { ChatAttachmentModel } from './chat-attachment.model';
import { HiringTeamModel } from './hiring-team.model';
import { JobApplicationModel } from './job-application.model';
import { SentViaEnum } from './sent-via.enum';
import { UserModel } from './user.model';
import { WorkflowMessageModel } from './workflow-message.model';
export class MessageModel {
......@@ -10,8 +12,9 @@ export class MessageModel {
SentVia: SentViaEnum;
MessageContent: string;
IsRead: boolean;
SentBy: string;
SentBy: UserModel | HiringTeamModel | string;
WorkFlowMessage: WorkflowMessageModel;
JobApplication: JobApplicationModel;
Attachments: ChatAttachmentModel;
Attachments: Array<ChatAttachmentModel>;
ObjectCreatedStr: string;
}
......@@ -9,6 +9,7 @@ export class UserModel {
PasswordExpiryDate: string;
FirstName: string;
LastName: string;
Name: string;
UserDescription: string;
Email: string;
SupportUser: string;
......
......@@ -272,16 +272,28 @@
width: 100% !important;
}
.ui-dialog {
.edit-message-template {
.ui-dialog {
.ui-dialog-titlebar {
display: none;
}
.ui-dialog-content {
padding: 0 !important;
}
}
.ui-dialog {
&.ui-dialog-draggable {
left: 130px !important;
right: 130px !important;
overflow-y: scroll;
height: 80% !important;
}
}
}
.edit-message-template {
.message-engine {
.ui-dialog {
.ui-dialog-titlebar {
display: none;
......@@ -291,8 +303,36 @@
padding: 0 !important;
}
}
.ui-dialog {
&.ui-dialog-draggable {
left: auto !important;
right: 10px !important;
height: 85% !important;
bottom: 0 !important;
overflow-y: scroll;
top: auto !important;
min-width: 600px;
width: 55%;
}
}
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 200px rgba(183, 183, 183, 0.2);
border-radius: 6px;
}
::-webkit-scrollbar-thumb {
border-radius: 6px;
-webkit-box-shadow: inset 0 0 200px rgba(100, 100, 100, 0.42);
}
}
.editor {
min-height: 150px !important;
}
......@@ -416,3 +456,40 @@ body .ui-dropdown-panel .ui-dropdown-filter-container {
.ui-button.ui-button-icon-only {
margin: 1px;
}
.chat-icon {
width: 70px;
height: 70px;
border-radius: 100px;
position: fixed;
bottom: 10px;
right: 20px;
background-image: url("assets/images/chat-icon.jpg");
background-repeat: round;
cursor: pointer;
}
app-message-engine-applicant-view {
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 200px rgba(183, 183, 183, 0.2);
border-radius: 6px;
}
::-webkit-scrollbar-thumb {
border-radius: 6px;
-webkit-box-shadow: inset 0 0 200px rgba(100, 100, 100, 0.42);
}
}
.pad-5 {
padding: 5px;
}
.h-45 {
height: 45px !important;
}
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