mobicloud-core 1.0.162 → 1.0.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/mobicloud-core-components.umd.js +48 -9
- package/bundles/mobicloud-core-components.umd.js.map +1 -1
- package/bundles/mobicloud-core-components.umd.min.js +1 -1
- package/bundles/mobicloud-core-components.umd.min.js.map +1 -1
- package/components/employee/employee-profile/employee-profile.component.d.ts +6 -0
- package/components/mobicloud-core-components.metadata.json +1 -1
- package/esm2015/components/employee/employee-profile/employee-profile.component.js +42 -6
- package/fesm2015/mobicloud-core-components.js +41 -5
- package/fesm2015/mobicloud-core-components.js.map +1 -1
- package/package.json +1 -1
|
@@ -1921,13 +1921,17 @@
|
|
|
1921
1921
|
{ id: api.GenderType.Other, description: $localize(templateObject_5$4 || (templateObject_5$4 = __makeTemplateObject([":@@EnumValue-Other:Other"], [":@@EnumValue-Other:Other"]))) }
|
|
1922
1922
|
];
|
|
1923
1923
|
this.fullNameSortOrder = "asc";
|
|
1924
|
+
this.editorOptions_Supervisor = { readOnly: true, itemTemplate: 'employee_itemTemplate', fieldTemplate: 'employee_fieldTemplate', valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['EmployeeNumber', 'Name'], showClearButton: true };
|
|
1925
|
+
this.editorOptions_PayrollInterval = { readOnly: true, itemTemplate: 'payrollInterval_itemTemplate', fieldTemplate: 'payrollInterval_fieldTemplate', valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['IntervalId', 'Name'], showClearButton: true };
|
|
1926
|
+
this.editorOptions_PayrollNumber = { readOnly: true, showClearButton: true, minSearchLength: 0, maxItemCount: 200, openOnFieldClick: true, itemTemplate: 'payrollEmplTemplate', valueExpr: 'EmployeeId', searchExpr: ['EmployeeId', 'EmployeeNumber', 'Name'] };
|
|
1927
|
+
this.editorOptions_EmployeeGroup = { readOnly: true, itemTemplate: 'employeegroup_itemTemplate', fieldTemplate: 'employeegroup_fieldTemplate', valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['GroupId', 'Name'], showClearButton: true };
|
|
1924
1928
|
this.loadPayrollEmployees();
|
|
1925
1929
|
}
|
|
1926
1930
|
EmployeeProfileComponent.prototype.loadPayrollEmployees = function () {
|
|
1927
1931
|
return __awaiter(this, void 0, void 0, function () {
|
|
1928
1932
|
var url;
|
|
1929
1933
|
var _this = this;
|
|
1930
|
-
return __generator(this, function (
|
|
1934
|
+
return __generator(this, function (_o) {
|
|
1931
1935
|
url = "" + this.cloudDataService.getMobiManagementApiUrl('PayrollApi/PayrollEmployees');
|
|
1932
1936
|
this.httpGet(url).then(function (response) {
|
|
1933
1937
|
response.subscribe(function (payroll_employees) {
|
|
@@ -1947,11 +1951,11 @@
|
|
|
1947
1951
|
if (requestTimeout === void 0) { requestTimeout = 30000; }
|
|
1948
1952
|
return __awaiter(this, void 0, void 0, function () {
|
|
1949
1953
|
var httpHeaderValues, httpHeaders;
|
|
1950
|
-
return __generator(this, function (
|
|
1951
|
-
switch (
|
|
1954
|
+
return __generator(this, function (_o) {
|
|
1955
|
+
switch (_o.label) {
|
|
1952
1956
|
case 0: return [4 /*yield*/, this.cloudDataService.httpHeaderValues_Json()];
|
|
1953
1957
|
case 1:
|
|
1954
|
-
httpHeaderValues =
|
|
1958
|
+
httpHeaderValues = _o.sent();
|
|
1955
1959
|
httpHeaders = new http.HttpHeaders(httpHeaderValues);
|
|
1956
1960
|
return [2 /*return*/, this.httpClient.get(url, { headers: httpHeaders })
|
|
1957
1961
|
.pipe(operators.timeout(requestTimeout), operators.catchError(this.cloudDataService.handleError))
|
|
@@ -1962,9 +1966,22 @@
|
|
|
1962
1966
|
};
|
|
1963
1967
|
EmployeeProfileComponent.prototype.ngOnInit = function () {
|
|
1964
1968
|
var _this = this;
|
|
1965
|
-
this.coreService.mobiUserProfileObservable.subscribe(function (p) { return _this.fullEditAllowed = _this.coreService.isMasterOrganizationUserAuthenticated(); });
|
|
1966
|
-
this.coreService.mobiUserProfileObservable.subscribe(function (p) { var _a; return _this.editAllowed = (_this.coreService.isMasterOrganizationUserAuthenticated() || (p === null || p === void 0 ? void 0 : p.user_id) == ((_a = _this.employee) === null || _a === void 0 ? void 0 : _a.Id)); });
|
|
1967
1969
|
this.initializeDataSources();
|
|
1970
|
+
this.coreService.mobiUserProfileObservable.subscribe(function (p) {
|
|
1971
|
+
var _a;
|
|
1972
|
+
_this.fullEditAllowed = _this.coreService.isMasterOrganizationUserAuthenticated();
|
|
1973
|
+
_this.editAllowed = (_this.coreService.isMasterOrganizationUserAuthenticated() || (p === null || p === void 0 ? void 0 : p.user_id) == ((_a = _this.employee) === null || _a === void 0 ? void 0 : _a.Id));
|
|
1974
|
+
if (_this.fullEditAllowed) {
|
|
1975
|
+
_this.editorOptions_Supervisor.dataSource = _this.supervisor_ds;
|
|
1976
|
+
delete _this.editorOptions_Supervisor.readOnly;
|
|
1977
|
+
_this.editorOptions_PayrollNumber.dataSource = _this.payrollEmployeeNumbers;
|
|
1978
|
+
delete _this.editorOptions_PayrollNumber.readOnly;
|
|
1979
|
+
_this.editorOptions_PayrollInterval.dataSource = _this.payrollInterval_ds;
|
|
1980
|
+
delete _this.editorOptions_PayrollInterval.readOnly;
|
|
1981
|
+
_this.editorOptions_EmployeeGroup.dataSource = _this.employeegroup_ds;
|
|
1982
|
+
delete _this.editorOptions_EmployeeGroup.readOnly;
|
|
1983
|
+
}
|
|
1984
|
+
});
|
|
1968
1985
|
};
|
|
1969
1986
|
EmployeeProfileComponent.prototype.initializeDataSources = function () {
|
|
1970
1987
|
this.employee_store = new ODataStore__default['default']({
|
|
@@ -1979,6 +1996,7 @@
|
|
|
1979
1996
|
this.createLocationDataSource();
|
|
1980
1997
|
this.createSupervisorDataSource();
|
|
1981
1998
|
this.createPayrollIntervalDataSource();
|
|
1999
|
+
this.createEmployeeGroupDataSource();
|
|
1982
2000
|
};
|
|
1983
2001
|
EmployeeProfileComponent.prototype.ngOnChanges = function (changes) {
|
|
1984
2002
|
var _a;
|
|
@@ -2030,7 +2048,7 @@
|
|
|
2030
2048
|
};
|
|
2031
2049
|
EmployeeProfileComponent.prototype.saveEmployee = function () {
|
|
2032
2050
|
var _this = this;
|
|
2033
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
2051
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2034
2052
|
if (((_a = this.employee) === null || _a === void 0 ? void 0 : _a.Id) && this.employee_store) {
|
|
2035
2053
|
this.isLoadingData = true;
|
|
2036
2054
|
this.loadingText = $localize(templateObject_9$3 || (templateObject_9$3 = __makeTemplateObject([":@@Updating-Text-Employee:Updating employee..."], [":@@Updating-Text-Employee:Updating employee..."])));
|
|
@@ -2047,6 +2065,7 @@
|
|
|
2047
2065
|
update_values.SupervisorId = (_j = this.formEmployee) === null || _j === void 0 ? void 0 : _j.SupervisorId;
|
|
2048
2066
|
update_values.PayrollNumber = (_k = this.formEmployee) === null || _k === void 0 ? void 0 : _k.PayrollNumber;
|
|
2049
2067
|
update_values.PayrollIntervalId = (_l = this.formEmployee) === null || _l === void 0 ? void 0 : _l.PayrollIntervalId;
|
|
2068
|
+
update_values.EmployeeGroupId = (_m = this.formEmployee) === null || _m === void 0 ? void 0 : _m.EmployeeGroupId;
|
|
2050
2069
|
}
|
|
2051
2070
|
this.employee_store.update(this.employee.Id, update_values)
|
|
2052
2071
|
.then(function (dataObj) {
|
|
@@ -2152,7 +2171,7 @@
|
|
|
2152
2171
|
};
|
|
2153
2172
|
EmployeeProfileComponent.prototype.createPayrollIntervalDataSource = function () {
|
|
2154
2173
|
return __awaiter(this, void 0, void 0, function () {
|
|
2155
|
-
return __generator(this, function (
|
|
2174
|
+
return __generator(this, function (_o) {
|
|
2156
2175
|
this.payrollInterval_ds = new DataSource__default['default']({
|
|
2157
2176
|
store: new ODataStore__default['default']({
|
|
2158
2177
|
url: this.cloudDataService.getMobiManagementODataUrl("PayrollInterval"),
|
|
@@ -2170,12 +2189,32 @@
|
|
|
2170
2189
|
});
|
|
2171
2190
|
});
|
|
2172
2191
|
};
|
|
2192
|
+
EmployeeProfileComponent.prototype.createEmployeeGroupDataSource = function () {
|
|
2193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
2194
|
+
return __generator(this, function (_o) {
|
|
2195
|
+
this.employeegroup_ds = new DataSource__default['default']({
|
|
2196
|
+
store: new ODataStore__default['default']({
|
|
2197
|
+
url: this.cloudDataService.getMobiManagementODataUrl("EmployeeGroup"),
|
|
2198
|
+
withCredentials: true,
|
|
2199
|
+
key: "Id",
|
|
2200
|
+
keyType: "Guid",
|
|
2201
|
+
version: 4,
|
|
2202
|
+
}),
|
|
2203
|
+
requireTotalCount: true,
|
|
2204
|
+
map: function (dataItem) {
|
|
2205
|
+
return Object.assign(new api.EmployeeGroup(), dataItem);
|
|
2206
|
+
}
|
|
2207
|
+
});
|
|
2208
|
+
return [2 /*return*/];
|
|
2209
|
+
});
|
|
2210
|
+
});
|
|
2211
|
+
};
|
|
2173
2212
|
return EmployeeProfileComponent;
|
|
2174
2213
|
}());
|
|
2175
2214
|
EmployeeProfileComponent.decorators = [
|
|
2176
2215
|
{ type: core.Component, args: [{
|
|
2177
2216
|
selector: 'mobicloud-employee-profile',
|
|
2178
|
-
template: "<mobicloud-group-box title=\"Profile\" i18n-title=\"@@CaptionHeader-Profile\" [width]=\"[width]\" [contentheight]=[contentheight] class=\"employeeProfileForm\" [isLoadingData]=\"isLoadingData\" [loadingText]=\"loadingText\" \n [editAllowed]=\"editAllowed\" [inEditMode]=\"inEditMode\" [hasErrors]=\"hasErrors\" errorCaption=\"Error\" i18n-errorCaption=\"@@CaptionHeader-Error\" [errorText]=\"errorText\" [enableRetryOnError]=\"true\"\n (Edit_Click)=\"onEditClick()\" (Save_Click)=\"onSaveClick()\" (CancelEdit_Click)=\"onCancelEditClick()\" (Retry_Click)=\"onRetryClick()\">\n\n <dx-form #form id=\"form\"\n [formData]=\"formEmployee\"\n [readOnly]=\"!inEditMode\"\n [showColonAfterLabel]=\"true\"\n labelLocation=\"top\"\n [showValidationSummary]=\"false\" \n [showRequiredMark] = \"false\"\n validationGroup=\"formEmployeeData_Profile\">\n\n <dxi-item itemType=\"group\" caption=\"\" [colCount]=\"2\">\n <dxi-item dataField=\"FirstName\" [editorOptions]=\"{ inputAttr: {'autocomplete': 'given-name'} }\">\n <dxo-label text=\"First name\" i18n-text=\"@@FieldCaption-FirstName\"></dxo-label> \n <dxi-validation-rule type=\"required\" message=\"First name is required\" i18n-message=\"@@ValidationText-FirstName-Required\"></dxi-validation-rule> \n </dxi-item>\n <dxi-item dataField=\"LastName\" [editorOptions]=\"{ inputAttr: {'autocomplete': 'family-name'} }\">\n <dxo-label text=\"Last name\" i18n-text=\"@@FieldCaption-LastName\"></dxo-label> \n <dxi-validation-rule type=\"required\" message=\"Last name is required\" i18n-message=\"@@ValidationText-LastName-Required\"></dxi-validation-rule> \n </dxi-item>\n \n\n\n \n <dxi-item dataField=\"Initials\">\n <dxo-label text=\"Initials\" i18n-text=\"@@FieldCaption-Initials\"></dxo-label> \n </dxi-item>\n\n\n\n\n <dxi-item dataField=\"Gender\" editorType=\"dxSelectBox\" [editorOptions]=\"{ dataSource: genderType_ds, valueExpr: 'id', displayExpr: 'description' }\">\n <dxo-label text=\"Gender\" i18n-text=\"@@FieldCaption-Gender\"></dxo-label>\n </dxi-item> \n\n\n <dxi-item dataField=\"DepartmentId\" editorType=\"dxLookup\" [editorOptions]=\"{ itemTemplate:'department_itemTemplate', fieldTemplate: 'department_fieldTemplate', dataSource: department_ds, valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['Name'], showClearButton: true }\">\n <dxo-label text=\"Department\" i18n-text=\"@@FieldCaption-Department\"></dxo-label> \n </dxi-item> \n\n <dxi-item dataField=\"LocationId\" editorType=\"dxLookup\" [editorOptions]=\"{ itemTemplate:'location_itemTemplate', fieldTemplate: 'location_fieldTemplate', dataSource: location_ds, valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['Name'], showClearButton: true }\">\n <dxo-label text=\"Location\" i18n-text=\"@@FieldCaption-Location\"></dxo-label>\n </dxi-item> \n\n <dxi-item dataField=\"InventLocationId\" editorType=\"dxLookup\" [editorOptions]=\"{ itemTemplate:'inventLocation_itemTemplate', fieldTemplate: 'inventLocation_fieldTemplate', dataSource: inventLocation_ds, valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['InventLocationId','Name'], showClearButton: true }\">\n <dxo-label text=\"InventLocation\" i18n-text=\"@@FieldCaption-InventLocation\"></dxo-label>\n </dxi-item> \n\n <dxi-item dataField=\"SupervisorId\" #responsible editorType=\"dxLookup\" [editorOptions]=\"
|
|
2217
|
+
template: "<mobicloud-group-box title=\"Profile\" i18n-title=\"@@CaptionHeader-Profile\" [width]=\"[width]\" [contentheight]=[contentheight] class=\"employeeProfileForm\" [isLoadingData]=\"isLoadingData\" [loadingText]=\"loadingText\" \n [editAllowed]=\"editAllowed\" [inEditMode]=\"inEditMode\" [hasErrors]=\"hasErrors\" errorCaption=\"Error\" i18n-errorCaption=\"@@CaptionHeader-Error\" [errorText]=\"errorText\" [enableRetryOnError]=\"true\"\n (Edit_Click)=\"onEditClick()\" (Save_Click)=\"onSaveClick()\" (CancelEdit_Click)=\"onCancelEditClick()\" (Retry_Click)=\"onRetryClick()\">\n\n <dx-form #form id=\"form\"\n [formData]=\"formEmployee\"\n [readOnly]=\"!inEditMode\"\n [showColonAfterLabel]=\"true\"\n labelLocation=\"top\"\n [showValidationSummary]=\"false\" \n [showRequiredMark] = \"false\"\n validationGroup=\"formEmployeeData_Profile\">\n\n <dxi-item itemType=\"group\" caption=\"\" [colCount]=\"2\">\n <dxi-item dataField=\"FirstName\" [editorOptions]=\"{ inputAttr: {'autocomplete': 'given-name'} }\">\n <dxo-label text=\"First name\" i18n-text=\"@@FieldCaption-FirstName\"></dxo-label> \n <dxi-validation-rule type=\"required\" message=\"First name is required\" i18n-message=\"@@ValidationText-FirstName-Required\"></dxi-validation-rule> \n </dxi-item>\n <dxi-item dataField=\"LastName\" [editorOptions]=\"{ inputAttr: {'autocomplete': 'family-name'} }\">\n <dxo-label text=\"Last name\" i18n-text=\"@@FieldCaption-LastName\"></dxo-label> \n <dxi-validation-rule type=\"required\" message=\"Last name is required\" i18n-message=\"@@ValidationText-LastName-Required\"></dxi-validation-rule> \n </dxi-item>\n \n\n\n \n <dxi-item dataField=\"Initials\">\n <dxo-label text=\"Initials\" i18n-text=\"@@FieldCaption-Initials\"></dxo-label> \n </dxi-item>\n\n\n\n\n <dxi-item dataField=\"Gender\" editorType=\"dxSelectBox\" [editorOptions]=\"{ dataSource: genderType_ds, valueExpr: 'id', displayExpr: 'description' }\">\n <dxo-label text=\"Gender\" i18n-text=\"@@FieldCaption-Gender\"></dxo-label>\n </dxi-item> \n\n\n <dxi-item dataField=\"DepartmentId\" editorType=\"dxLookup\" [editorOptions]=\"{ itemTemplate:'department_itemTemplate', fieldTemplate: 'department_fieldTemplate', dataSource: department_ds, valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['Name'], showClearButton: true }\">\n <dxo-label text=\"Department\" i18n-text=\"@@FieldCaption-Department\"></dxo-label> \n </dxi-item> \n\n <dxi-item dataField=\"LocationId\" editorType=\"dxLookup\" [editorOptions]=\"{ itemTemplate:'location_itemTemplate', fieldTemplate: 'location_fieldTemplate', dataSource: location_ds, valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['Name'], showClearButton: true }\">\n <dxo-label text=\"Location\" i18n-text=\"@@FieldCaption-Location\"></dxo-label>\n </dxi-item> \n\n <dxi-item dataField=\"InventLocationId\" editorType=\"dxLookup\" [editorOptions]=\"{ itemTemplate:'inventLocation_itemTemplate', fieldTemplate: 'inventLocation_fieldTemplate', dataSource: inventLocation_ds, valueExpr: 'Id', displayExpr: 'Name', searchEnabled: true, searchExpr: ['InventLocationId','Name'], showClearButton: true }\">\n <dxo-label text=\"InventLocation\" i18n-text=\"@@FieldCaption-InventLocation\"></dxo-label>\n </dxi-item> \n\n <dxi-item dataField=\"SupervisorId\" #responsible editorType=\"dxLookup\" [editorOptions]=\"editorOptions_Supervisor\">\n <dxo-label text=\"Supervisor\" i18n-text=\"@@FieldCaption-Supervisor\"></dxo-label> \n </dxi-item> \n\n <dxi-item dataField=\"PayrollNumber\" editorType=\"dxAutocomplete\" [editorOptions]=\"editorOptions_PayrollNumber\">\n <dxo-label text=\"Payroll no.\" i18n-text=\"@@FieldCaption-PayrollNumber\"></dxo-label> \n </dxi-item> \n\n <dxi-item dataField=\"PayrollIntervalId\" editorType=\"dxLookup\" [editorOptions]=\"editorOptions_PayrollInterval\">\n <dxo-label text=\"Payroll interval\" i18n-text=\"@@FieldCaption-PayrollInterval\"></dxo-label> \n </dxi-item> \n \n <dxi-item dataField=\"EmployeeGroupId\" editorType=\"dxLookup\" [editorOptions]=\"editorOptions_EmployeeGroup\">\n <dxo-label text=\"Employee group\" i18n-text=\"@@FieldCaption-EmployeeGroup\"></dxo-label> \n </dxi-item> \n </dxi-item> \n \n <!-- Templates -->\n <div *dxTemplate=\"let item of 'department_itemTemplate'\">\n {{ item?.Name }}\n </div> \n <div *dxTemplate=\"let fieldData of 'department_fieldTemplate'\" [ngClass]=\"{'lookup-field-template-container':!inEditMode, 'lookup-field-template-container-readonly':!inEditMode}\">\n {{fieldData?.Name}}\n </div> \n <div *dxTemplate=\"let item of 'location_itemTemplate'\">\n {{ item?.Name }}\n </div> \n <div *dxTemplate=\"let fieldData of 'location_fieldTemplate'\" [ngClass]=\"{'lookup-field-template-container':!inEditMode, 'lookup-field-template-container-readonly':!inEditMode}\">\n {{fieldData?.Name}}\n </div> \n <div *dxTemplate=\"let item of 'inventLocation_itemTemplate'\">\n {{item?.Name}} {{ item?.InventLocationId ? ('(' + item.InventLocationId + ')') : ('') }}\n </div> \n <div *dxTemplate=\"let item of 'inventLocation_fieldTemplate'\" [ngClass]=\"{'lookup-field-template-container':!inEditMode, 'lookup-field-template-container-readonly':!inEditMode}\">\n {{item?.Name}} {{ item?.InventLocationId ? ('(' + item.InventLocationId + ')') : ('') }}\n </div> \n <div *dxTemplate=\"let item of 'employee_itemTemplate'\">\n {{item?.Name}} {{ item?.EmployeeNumber ? ('(' + item.EmployeeNumber + ')') : ('') }}\n </div> \n <div *dxTemplate=\"let item of 'employee_fieldTemplate'\" [ngClass]=\"{'lookup-field-template-container':!inEditMode, 'lookup-field-template-container-readonly':!inEditMode}\">\n {{item?.Name}} {{ item?.EmployeeNumber ? ('(' + item.EmployeeNumber + ')') : ('') }}\n </div> \n <div class=\"payrollno-dropdown\" *dxTemplate=\"let empl of 'payrollEmplTemplate'\">\n <div class=\"payrollno-dropdown-emplno\">{{empl.EmployeeNumber}}</div><div class=\"payrollno-dropdown-emplname\">{{empl.Name}}</div>\n </div> \n \n <div *dxTemplate=\"let fieldData of 'payrollInterval_itemTemplate'\">\n {{fieldData?.Name}}\n </div> \n <div *dxTemplate=\"let fieldData of 'payrollInterval_fieldTemplate'\" [ngClass]=\"{'lookup-field-template-container':!inEditMode, 'lookup-field-template-container-readonly':!inEditMode}\">\n {{fieldData?.Name}} {{ fieldData?.IntervalId ? ('(' + fieldData?.IntervalId + ')') : ('') }}\n </div>\n\n <div *dxTemplate=\"let item of 'employeegroup_itemTemplate'\">\n {{ item?.Name }}\n </div> \n <div *dxTemplate=\"let fieldData of 'employeegroup_fieldTemplate'\" [ngClass]=\"{'lookup-field-template-container':!inEditMode, 'lookup-field-template-container-readonly':!inEditMode}\">\n {{fieldData?.Name}}\n </div> \n </dx-form>\n</mobicloud-group-box>",
|
|
2179
2218
|
styles: [".employeeProfileForm .mat-form-field{width:100%;margin-left:10px;margin-right:10px}.mat-form-field mat-label{text-transform:uppercase!important}.payrollno-dropdown{display:flex}.payrollno-dropdown-emplno{min-width:30px}.payrollno-dropdown-emplname{margin-left:16px}"]
|
|
2180
2219
|
},] }
|
|
2181
2220
|
];
|