sccoreui
Version:
ui-sccore
227 lines (226 loc) • 9.99 kB
JavaScript
"use strict";
// const allDummyData = [
// {
// "employeeId": 101,
// "employeeName": "Erica Rogers",
// "jobTitle": "CEO",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 102,
// "employeeName": "Malcolm Barrett",
// "jobTitle": "Exec. Vice President",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 103,
// "employeeName": "Esther Baker",
// "jobTitle": "Director of Operations",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 104,
// "employeeName": "Brittany Hanson",
// "jobTitle": "Fleet Coordinator",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 105,
// "employeeName": "Leah Flowers",
// "jobTitle": "Parts Technician",
// "employmentType": "Contract"
// },
// {
// "employeeId": 106,
// "employeeName": "Tammy Sutton",
// "jobTitle": "Service Technician",
// "employmentType": "Contract"
// }
// ]
// },
// {
// "employeeId": 107,
// "employeeName": "Derek Paul",
// "jobTitle": "Inventory Control",
// "employmentType": "Permanent"
// }
// ]
// },
// {
// "employeeId": 108,
// "employeeName": "Francis Strickland",
// "jobTitle": "VP Sales",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 109,
// "employeeName": "Morris Hanson",
// "jobTitle": "Sales Manager",
// "employmentType": "Permanent"
// },
// {
// "employeeId": 110,
// "employeeName": "Todd Tyler",
// "jobTitle": "Sales Executive",
// "employmentType": "Contract"
// },
// {
// "employeeId": 111,
// "employeeName": "Bennie Wise",
// "jobTitle": "Sales Executive",
// "employmentType": "Contract"
// },
// {
// "employeeId": 112,
// "employeeName": "Joel Cooper",
// "jobTitle": "Sales Executive",
// "employmentType": "Permanent"
// }
// ]
// }
// ]
// },
// {
// "employeeId": 113,
// "employeeName": "Luke McBride",
// "jobTitle": "Exec. Vice President",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 114,
// "employeeName": "Sarah Baker",
// "jobTitle": "Director of Operations",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 115,
// "employeeName": "Mason Hanson",
// "jobTitle": "Fleet Coordinator",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 116,
// "employeeName": "Hannah Flowers",
// "jobTitle": "Parts Technician",
// "employmentType": "Contract"
// },
// {
// "employeeId": 117,
// "employeeName": "Rob Sutton",
// "jobTitle": "Service Technician",
// "employmentType": "Contract"
// }
// ]
// },
// {
// "employeeId": 118,
// "employeeName": "Paul Smith",
// "jobTitle": "Inventory Control",
// "employmentType": "Permanent"
// }
// ]
// },
// {
// "employeeId": 119,
// "employeeName": "Adam Newman",
// "jobTitle": "VP Sales",
// "employmentType": "Permanent",
// "children": [
// {
// "employeeId": 120,
// "employeeName": "John Smith",
// "jobTitle": "Sales Manager",
// "employmentType": "Permanent"
// },
// {
// "employeeId": 121,
// "employeeName": "Alice Grant",
// "jobTitle": "Sales Executive",
// "employmentType": "Contract"
// },
// {
// "employeeId": 122,
// "employeeName": "Ben Hill",
// "jobTitle": "Sales Executive",
// "employmentType": "Contract"
// },
// {
// "employeeId": 123,
// "employeeName": "Joe Cooper",
// "jobTitle": "Sales Executive",
// "employmentType": "Permanent"
// }
// ]
// }
// ]
// }
// ]
// }
// ]
Object.defineProperty(exports, "__esModule", { value: true });
exports.dummyData = exports.getNormalData = exports.getAllData = void 0;
const tslib_1 = require("tslib");
// const allDummyDataMoreChildren = [
// {
// employeeId: generateUniqueId(),
// employeeName: "Parent 1",
// jobTitle: "CEO",
// employmentType: "Permanent",
// group: true,
// },
// // Repeat the structure for Parent 3 through Parent 10
// ];
function generateUniqueId() {
const timestamp = Date.now().toString().slice(-4); // Last 4 digits of timestamp
const randomPart = Math.floor(100000 + Math.random() * 900000).toString(); // 6 random digits
return timestamp + randomPart; // 10-digit unique ID
}
let k = 1;
function delayWithValue(ms, value) {
return new Promise((resolve) => {
setTimeout(() => {
resolve(value); // Return the value after the delay
}, ms);
});
}
const getAllData = (text) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
console.log(k, "called", text);
k = k + 1;
const data = yield delayWithValue(500, [
{
id: generateUniqueId(),
employeeName: "Parent 1",
jobTitle: "CEO" + generateUniqueId(),
employmentType: "Permanent",
group: true,
},
// Repeat the structure for Parent 3 through Parent 10
]);
return data;
});
exports.getAllData = getAllData;
const getNormalData = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const data = yield delayWithValue(500, [{
id: 1,
employeeName: "Parent 1",
jobTitle: "CEO",
employmentType: "Permanent",
group: true,
}]);
return data;
});
exports.getNormalData = getNormalData;
exports.dummyData = [{
id: 1,
employeeName: "Parent 1",
jobTitle: "CEO",
employmentType: "Permanent",
group: true,
},
{
id: 3,
employeeName: "Parent 3",
jobTitle: "CEO",
employmentType: "Permanent",
group: true,
}];