The userdetails page is a tabbed view that displays the myleaves, myprofile, and myapprovals page.
myapprovals page will be hidden for the employee and will only be visible to the manager.
Drag various components to create the following layout of the userdetails page:
Use the following table to configure properties for the userdetails page:
TAB-1
Basic Properties
Property name | Property Value |
---|---|
Label |
My Leaves |
Basic Properties
Property name | Property Value |
---|---|
Layout Direction |
Center |
Perpendicular Direction | Center |
fxshow | true |
fxhide | false |
Wrap |
wrap |
fxFlex | 100 |
HTML-1
Basic Properties
To add a property double click on the Html editor and enter <bh-myleaves style="width:100%"></bh-myleaves>.
Basic Properties
Property name | Property Value |
---|---|
Label |
My Profile |
Basic Properties
Property name | Property Value |
---|---|
Layout Direction |
Center |
Perpendicular Direction | Center |
fxshow | true |
fxhide | false |
Wrap |
wrap |
fxFlex | 100 |
Basic properties
To add a property, double click on the Html editor and enter <bh-myprofile style="width:100%"></bh-myprofile> in the code
Basic Properties
Property name | Property Value |
---|---|
Label | My Approvals |
Custom Properties
In the Custom Property field, select Key/Value Option. Enter *ngIf in the Key field and enter uService.isManager() in the value field.
Basic Properties
Property name | Property Value |
---|---|
Layout Direction |
Center |
Perpendicular Direction |
Center |
fxshow | true |
fxhide | false |
Wrap |
wrap |
fxFlex | 100 |
Basic Properties
To add a property double click on the Html editor and enter <bh-myapprovals style="width:100%"><bh-myapprovals> .
Step 1: Replace the Tab Group component with the Tabs component.
Step 2: Add three more tabs using the New Tab button inside the Tabs component. Refer Tabs component to know more.
Properties for the Tabs component:
Tab-1
Property name | Property Value |
---|---|
label | My leaves |
Tab-2
Property name | Property Value |
---|---|
label | My profile |
Tab-3
Property name | Property Value |
---|---|
label | My approvals |
The properties for the Row and HTML5 components remain the same as mentioned before. |
Page Implementation:
The view of the userdetails page on runtime:
JavaScript /*DEFAULT GENERATED TEMPLATE. DO NOT CHANGE SELECTOR TEMPLATE_URL AND CLASS NAME*/
import { Component, OnInit } from '@angular/core'
import { ModelMethods } from '../../lib/model.methods';
// import { BDataModelService } from '../service/bDataModel.service';
import { NDataModelService } from 'neutrinos-seed-services';
import { NBaseComponent } from '../../../../../app/baseClasses/nBase.component';
import { userService } from '../../services/user/user.service';
/**
* Service import Example :
* import { HeroService } from '../../services/hero/hero.service';
*/
@Component({
selector: 'bh-userdetails',
templateUrl: './userdetails.template.html'
})
export class userdetailsComponent extends NBaseComponent implements OnInit {
mm: ModelMethods;
constructor(private bdms: NDataModelService,public uService: userService) {
super();
this.mm = new ModelMethods(bdms);
}
ngOnInit() {
}
get(dataModelName, filter?, keys?, sort?, pagenumber?, pagesize?) {
this.mm.get(dataModelName, filter, keys, sort, pagenumber, pagesize,
result => {
// On Success code here
},
error => {
// Handle errors here
});
}
getById(dataModelName, dataModelId) {
this.mm.getById(dataModelName, dataModelId,
result => {
// On Success code here
},
error => {
// Handle errors here
})
}
put(dataModelName, dataModelObject) {
this.mm.put(dataModelName, dataModelObject,
result => {
// On Success code here
}, error => {
// Handle errors here
})
}
validatePut(formObj, dataModelName, dataModelObject) {
this.mm.validatePut(formObj, dataModelName, dataModelObject,
result => {
// On Success code here
}, error => {
// Handle errors here
})
}
update(dataModelName, update, filter, options) {
const updateObject = {
update: update,
filter: filter,
options: options
};
this.mm.update(dataModelName, updateObject,
result => {
// On Success code here
}, error => {
// Handle errors here
})
}
delete (dataModelName, filter) {
this.mm.delete(dataModelName, filter,
result => {
// On Success code here
}, error => {
// Handle errors here
})
}
deleteById(dataModelName, dataModelId) {
this.mm.deleteById(dataModelName, dataModelId,
result => {
// On Success code here
}, error => {
// Handle errors here
})
}
updateById(dataModelName, dataModelId, dataModelObj) {
this.mm.updateById(dataModelName, dataModelId, dataModelObj,
result => {
// On Success code here
}, error => {
// Handle errors here
})
}
}