Browse Source

remove comments

pull/2/head
Muhammad Sulaiman Yusuf 3 years ago
parent
commit
436a2255e5
  1. 51
      src/const/CustomFunc.js

51
src/const/CustomFunc.js

@ -48,7 +48,6 @@ export const hideAttr = [
"m_users_gender",
"m_users_name",
"m_users_phone_number",
// "jumlah_pekerjaan"
];
export const salesAttrShow = [
@ -114,7 +113,6 @@ export const formatLabel = (label) => {
let output = "";
if (label.includes("_")) {
// if sentences
let words = label.split("_");
for (let i=0; i < words.length; i++) {
words[i] = words[i].charAt(0).toUpperCase() + words[i].substr(1);
@ -127,7 +125,7 @@ export const formatLabel = (label) => {
return output;
}
export const QUERY_BUILDER_FIELD_SALES =
export const QUERY_BUILDER_FIELD_SALES =
{
"properties->username": {
label: 'Username',
@ -167,7 +165,7 @@ export const QUERY_BUILDER_FIELD_SALES =
},
}
export const QUERY_BUILDER_FIELD_CUSTOMER =
export const QUERY_BUILDER_FIELD_CUSTOMER =
{
"properties->name": {
label: 'Name',
@ -199,7 +197,7 @@ export const QUERY_BUILDER_FIELD_CUSTOMER =
},
}
export const QUERY_BUILDER_FIELD_OFFICE =
export const QUERY_BUILDER_FIELD_OFFICE =
{
"properties->company": {
label: 'Company',
@ -224,7 +222,7 @@ export const QUERY_BUILDER_FIELD_OFFICE =
}
export const getChildrenTree = (data) =>
export const getChildrenTree = (data) =>
data.map((item, index) => {
if (item.subproyeks && item.subproyeks.length > 0) {
return {
@ -235,32 +233,6 @@ export const getChildrenTree = (data) =>
...item
}
}
// else if (item.plannings && item.plannings.length > 0) {
// return {
// "children": getChildrenTree(item.plannings),
// "title": item.nama,
// "key": Math.random(),
// ...item
// }
// }
// OSPRO V2
// else if (item.laporan_plannings && item.laporan_plannings.length > 0) {
// let lp = item.laporan_plannings.map(lp_item => {
// return {
// "nama_subproyek": item.join.m_subproyek_nama,
// "nama_planning": item.nama,
// "nama_user": item.join.m_users_name,
// ...lp_item
// }
// });
// return {
// "key": Math.random(),
// "title": item.nama,
// ...item,
// "laporan_plannings": lp // modify the laporan_plannings
// }
// }
return {
"title": item.nama,
"key": Math.random(),
@ -275,7 +247,6 @@ export const formatRupiah = (angka, prefix) => {
rupiah = split[0].substr(0, sisa),
ribuan = split[0].substr(sisa).match(/\d{3}/gi);
var separator = "";
// tambahkan titik jika yang di input sudah menjadi angka ribuan
if(ribuan){
separator = sisa ? '.' : '';
rupiah += separator + ribuan.join('.');
@ -300,15 +271,14 @@ export const formatNumber = (angka) => {
rupiah = split[0].substr(0, sisa),
ribuan = split[0].substr(sisa).match(/\d{3}/gi);
var separator = "";
// tambahkan titik jika yang di input sudah menjadi angka ribuan
if(ribuan){
separator = sisa ? '.' : '';
rupiah += separator + ribuan.join('.');
}
rupiah = split[1] != undefined ? rupiah + ',' + split[1] : rupiah;
return rupiah
}
return rupiah
}
export const formatThousand = (x) => {
@ -322,22 +292,19 @@ sortBy(data, {
prop: "date",
desc: true,
parser: function (item) {
//ignore case sensitive
return item.toUpperCase();
}
});
*/
export const sortBy = (function () {
var toString = Object.prototype.toString,
// default parser function
parse = function (x) { return x; },
// gets the item to be sorted
getItem = function (x) {
var isObject = x != null && typeof x === "object";
var isProp = isObject && this.prop in x;
return this.parser(isProp ? x[this.prop] : x);
};
/**
* Sorts an array of elements.
*
@ -359,7 +326,7 @@ export const sortBy = (function () {
return cfg.desc * (a < b ? -1 : +(a > b));
});
};
}());
@ -373,4 +340,4 @@ export const renderLabelStatus = (text) => {
label = text.toUpperCase();
}
return label;
}
}

Loading…
Cancel
Save