Commit 566f0c81 by GD-A-150752

app-select-2 updated

parent 1594c8a9
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<div class="col-md-6" <div class="col-md-6"
*ngIf="this.messageTemplateTypes.length && this.messageTemplate && this.messageTemplate.TemplateType"> *ngIf="this.messageTemplateTypes.length && this.messageTemplate && this.messageTemplate.TemplateType">
<label for="select">Message Template Type</label> <label for="select">Message Template Type</label>
<app-select-2 [data]="messageTemplateTypes" [value]="templateTypeId" <app-select-2 [data]="messageTemplateTypes" [value]="messageTemplateTypes[0]"
fieldLabel="Description" id="select" fieldLabel="Description" id="select"
(valChange)="storeMessageContent($event)"> (valChange)="storeMessageContent($event)">
</app-select-2> </app-select-2>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</div> </div>
<div class="col-md-6" *ngIf="subjectPlaceholderOptions.length"> <div class="col-md-6" *ngIf="subjectPlaceholderOptions.length">
<label>Placeholder for Subject</label> <label>Placeholder for Subject</label>
<app-select-2 [data]="subjectPlaceholderOptions" [value]="0" <app-select-2 [data]="subjectPlaceholderOptions" [value]="subjectPlaceholderOptions[0]"
fieldLabel="Description" fieldLabel="Description"
(valChange)="addPlaceholderInSubject($event)"> (valChange)="addPlaceholderInSubject($event)">
</app-select-2> </app-select-2>
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<div class="form-group row h-80"> <div class="form-group row h-80">
<div class="col-md-offset-6 col-md-6" *ngIf="contentPlaceholderOptions.length"> <div class="col-md-offset-6 col-md-6" *ngIf="contentPlaceholderOptions.length">
<label>Placeholder for Content</label> <label>Placeholder for Content</label>
<app-select-2 [data]="contentPlaceholderOptions" [value]="0" <app-select-2 [data]="contentPlaceholderOptions" [value]="contentPlaceholderOptions[0]"
fieldLabel="Description" fieldLabel="Description"
(valChange)="addPlaceholderInMessageContent($event)"> (valChange)="addPlaceholderInMessageContent($event)">
</app-select-2> </app-select-2>
......
...@@ -81,7 +81,6 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni ...@@ -81,7 +81,6 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
} }
initComponent(): void { initComponent(): void {
setTimeout(() => {
this.subscriptions.push(this.appService.getMessageTemplateTypeEnum() this.subscriptions.push(this.appService.getMessageTemplateTypeEnum()
.subscribe( .subscribe(
data => { data => {
...@@ -127,7 +126,6 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni ...@@ -127,7 +126,6 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
} }
) )
); );
}, 0);
} }
showSaveBtn(): boolean { showSaveBtn(): boolean {
...@@ -297,10 +295,10 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni ...@@ -297,10 +295,10 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
if (this.ContentPlaceholderOptionsEnum) { if (this.ContentPlaceholderOptionsEnum) {
if (this.emailTemplateType()) { if (this.emailTemplateType()) {
this.contentPlaceholderOptions = this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForContent || this.contentPlaceholderOptions = this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForContent ||
option.Value === null); option.Value === '-');
} else { } else {
this.contentPlaceholderOptions = this.ContentPlaceholderOptionsEnum this.contentPlaceholderOptions = this.ContentPlaceholderOptionsEnum
.filter(option => option.ShowForContent && option.Value !== 'JOB_LINK' || option.Value === null); .filter(option => option.ShowForContent && option.Value !== 'JOB_LINK' || option.Value === '-');
} }
} }
...@@ -418,22 +416,16 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni ...@@ -418,22 +416,16 @@ export class EditMessageTemplateComponent extends BaseComponent implements OnIni
this.subscriptions.push(this.appService.getPlaceholderOptionsEnum() this.subscriptions.push(this.appService.getPlaceholderOptionsEnum()
.subscribe(options => { .subscribe(options => {
this.ContentPlaceholderOptionsEnum = options; this.ContentPlaceholderOptionsEnum = options;
this.contentPlaceholderOptions = this.ContentPlaceholderOptionsEnum.filter(option => option.Value === null)
this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForContent || option.Value === null) .map(val => {
.map((elem, index) => { val.Value = '-';
elem.id = index;
elem.text = elem.Description;
return elem; return val;
}); });
this.contentPlaceholderOptions =
this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForContent || option.Value === '-');
this.subjectPlaceholderOptions = this.subjectPlaceholderOptions =
this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForSubject || option.Value === null) this.ContentPlaceholderOptionsEnum.filter(option => option.ShowForSubject || option.Value === '-');
.map((elem, index) => {
elem.id = index;
elem.text = elem.Description;
return elem;
});
}) })
); );
} }
......
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
</div> </div>
<div *ngIf="stepTypes && stepTypes.length" class="col-md-offset-2 col-md-4"> <div *ngIf="stepTypes && stepTypes.length" class="col-md-offset-2 col-md-4">
<app-select-2 (valChange)="addStep($event, stage)" [data]="stepTypes" <app-select-2 (valChange)="addStep($event, stage)" [data]="stepTypes"
[value]="0" [value]="stepTypes[0]"
fieldLabel="Description"> fieldLabel="Description">
</app-select-2> </app-select-2>
</div> </div>
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
<div *ngFor="let message of stage.WorkFlowMessages" class="form-group row"> <div *ngFor="let message of stage.WorkFlowMessages" class="form-group row">
<div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage" <div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage"
class="col-lg-12 col-md-12"> class="col-lg-12 col-md-12">
<h3>Withdrawal Process</h3> <h4>Withdrawal Process</h4>
</div> </div>
<div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage" <div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage"
class="col-lg-12 col-md-12 mb-10"> class="col-lg-12 col-md-12 mb-10">
...@@ -471,7 +471,7 @@ ...@@ -471,7 +471,7 @@
</div> </div>
<div *ngIf="stepTypes && stepTypes.length" class="col-md-offset-8 col-md-4"> <div *ngIf="stepTypes && stepTypes.length" class="col-md-offset-8 col-md-4">
<app-select-2 (valChange)="addStep($event, stage)" [data]="stepTypes" <app-select-2 (valChange)="addStep($event, stage)" [data]="stepTypes"
[value]="0" [value]="stepTypes[0]"
fieldLabel="Description"> fieldLabel="Description">
</app-select-2> </app-select-2>
</div> </div>
...@@ -625,7 +625,7 @@ ...@@ -625,7 +625,7 @@
<div *ngFor="let message of stage.WorkFlowMessages" class="form-group row"> <div *ngFor="let message of stage.WorkFlowMessages" class="form-group row">
<div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage" <div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage"
class="col-lg-12 col-md-12"> class="col-lg-12 col-md-12">
<h3>Withdrawal Process</h3> <h4>Withdrawal Process</h4>
</div> </div>
<div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage" <div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage"
class="col-lg-12 col-md-12 mb-10"> class="col-lg-12 col-md-12 mb-10">
...@@ -848,13 +848,13 @@ ...@@ -848,13 +848,13 @@
</div> </div>
</div> </div>
<div *ngFor="let message of stage.WorkFlowMessages" class="form-group row"> <div *ngFor="let message of stage.WorkFlowMessages" class="form-group ui-g">
<div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage" <div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage"
class="col-lg-12 col-md-12"> class="ui-g-offset-0 ui-g-10">
<h3>Withdrawal Process</h3> <h4>Withdrawal Process</h4>
</div> </div>
<div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage" <div *ngIf="stage.UseMessaging && message.IsWithdrawalMessage"
class="col-lg-12 col-md-12 mb-10"> class="ui-g-12 mb-10">
<div class="col-md-2"> <div class="col-md-2">
<label>After</label> <label>After</label>
<p-inputMask (change)="generateDelayString(message)" <p-inputMask (change)="generateDelayString(message)"
......
...@@ -101,6 +101,12 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn ...@@ -101,6 +101,12 @@ export class EditWorkflowTemplateComponent extends BaseComponent implements OnIn
this.stageTypes = response[0]; this.stageTypes = response[0];
this.stepTypeOptions = response[1]; this.stepTypeOptions = response[1];
this.stepTypeOptions.filter(type => type.Value === null)
.map(val => {
val.Value = '-';
return val;
});
if (!this.adminPortalLayoutService.getHiringTeamID().HasDiversity) { if (!this.adminPortalLayoutService.getHiringTeamID().HasDiversity) {
this.stepTypeOptions = this.stepTypeOptions.filter(type => type.Value !== 'DIVERSITY'); this.stepTypeOptions = this.stepTypeOptions.filter(type => type.Value !== 'DIVERSITY');
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<div class="shorting-dropdown"> <div class="shorting-dropdown">
<div class="order-label">order by</div> <div class="order-label">order by</div>
<app-select-2 [data]="sortOptions" [value]="sortOptions[0]" fieldLabel="description" <app-select-2 [data]="sortOptions" [value]="sortOptions[0]" fieldLabel="description"
(valChange)="sortWorkFlowTemplates($event)"> (valChange)="sortWorkFlowTemplates($event)" fieldValue="ObjectID">
</app-select-2> </app-select-2>
</div> </div>
</div> </div>
......
...@@ -13,18 +13,16 @@ export class SelectTwoComponent { ...@@ -13,18 +13,16 @@ export class SelectTwoComponent {
ignoreChange = false; ignoreChange = false;
@Input() fieldLabel: string; @Input() fieldLabel: string;
@Input() fieldValue: string;
@Input() set data(items) { @Input() set data(items) {
this._originalItems = items; this._originalItems = items;
this.ignoreChange = true; this.ignoreChange = true;
this._items = items.map((elem, index) => { this._items = items.map(elem =>
const item = { ({
id: elem.ObjectID ? elem.ObjectID : index, id: elem.ObjectID ? elem.ObjectID : elem.Value,
text: elem[this.fieldLabel] text: elem[this.fieldLabel]
}; }));
return item;
});
setTimeout(() => { setTimeout(() => {
this.ignoreChange = false; this.ignoreChange = false;
...@@ -32,7 +30,7 @@ export class SelectTwoComponent { ...@@ -32,7 +30,7 @@ export class SelectTwoComponent {
} }
@Input() set value(value) { @Input() set value(value) {
this._value = value.id || value.ObjectID || 0; this._value = value.ObjectID || value.Value;
} }
@ViewChild('mySelect') mySelect: Select2Component; @ViewChild('mySelect') mySelect: Select2Component;
...@@ -57,8 +55,8 @@ export class SelectTwoComponent { ...@@ -57,8 +55,8 @@ export class SelectTwoComponent {
if (item) { if (item) {
this.valChange.emit(item); this.valChange.emit(item);
} }
// tslint:disable-next-line:no-empty
} catch (e) { } catch (e) {
} }
} }
} }
.listing-title {
color: #1a2531;
font-size: 28px;
font-weight: 300;
}
.template-name.heading { .template-name.heading {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
...@@ -45,18 +39,10 @@ ...@@ -45,18 +39,10 @@
padding-top: 0 !important; padding-top: 0 !important;
} }
.pb-0 {
padding-bottom: 0 !important;
}
.mb-0 { .mb-0 {
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
.mt-80 {
margin-top: 80px;
}
.w-100 { .w-100 {
width: 100% !important; width: 100% !important;
} }
...@@ -69,44 +55,6 @@ ...@@ -69,44 +55,6 @@
height: 60px; height: 60px;
} }
.bg-grey {
background-color: #e9ecef;
}
/* Listing of message and workflow templates */
.messageTemplate {
background: #fff none repeat scroll 0 0;
display: inline-block;
width: 100%;
box-shadow: 0 2px 3px 0 rgba(0, 0, 0, 0.02);
margin-bottom: 10px;
.messageRow {
height: 40px;
padding: 15px;
display: flex;
.templateName {
width: 95%;
align-self: center;
text-overflow: ellipsis;
word-break: break-all;
border-left: 3px solid #03ac66;
padding-left: 5px;
span {
cursor: pointer;
font-weight: bold;
color: #4e5258;
font-size: 18px;
}
}
}
}
/* End listing of message and workflow template styling */
/* Panel Styling */ /* Panel Styling */
.messaging { .messaging {
...@@ -230,10 +178,17 @@ ...@@ -230,10 +178,17 @@
} }
.normalDropDown { .normalDropDown {
.select2-container .select2-selection .select2-selection__rendered { .select2-container--open {
z-index: 100000;
}
.select2-container {
.select2-selection .select2-selection__rendered {
background: none; background: none;
padding-left: 10px; padding-left: 10px;
} }
}
} }
.h-80 { .h-80 {
......
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