import { ASSETS_URL } from '../../../consts/common'; import type { DataGridProps } from '../types'; import type { DataGridMockProps } from './index'; const mockData: DataGridProps['tableData'] = { page: 1, totalPages: 404, totalRecords: 12111, data: [ { _id: '60c5c0b220d2d56612d330cd', actions: 'edit', accountManager: 'Sagi Tikotski', activity: '4 TM licenses have been purchased', isUserGreyed: false, activityType: 'Expansion', arrChanged: 480, cancellationReason: 'Not using the service as much as expected', comments: 'Brand new account. Onboarding users through December and January', companyName: 'Optimal IP Translations Ltd', companySize: 'Medium', country: 'IL', createdDate: '2021-11-14T14:06:53Z', customerId: 'metricslegal', customerSuccessEngineer: 'Amit Geva', osType: 'Windows', points: 125.1124952, userEmail: 'mock@fake.com', userName: 'Mock mock', iconSrc: 'https://upload.wikimedia.org/wikipedia/commons/8/8f/Cute-kittens-12929201-1600-1200.jpg', website: 'thepctnetwork.com', companyHref: '/', emailVerified: true, webRuleName: 'Computer and Internet Computer and Internet Computer and Internet Computer and Internet', url: 'http://www.twitter.comhttp://www.twitter.comhttp://www.twitter.comhttp://www.twitter.comhttp://www.twitter.com', webRuleLink: 'http://www.twitter.com', network: { name: 'Network 1' }, regionName: 'London - 1', regionIp: 'GW - 138.68.111.211', regionCode: 'GB', sourceIp: '123.2.5.5', destinationIp: '3.2.111.3', program: 'Slack.exeSlack.exeSlack.exeSlack.exeSlack.exeSlack.exeSlack.exeSlack.exeSlack.exeSlack.exeSlack.exeSlack.exe', action: 'Warn', webCategory: 'Social Media, Social Media, Social Media, Social Media, Social Media, Social Media Social Media, Social Media', showAvatarTooltip: false, device: 'Device Name', deviceTypeOS: 'Device Type / OS', connection: 'Connection Name', connectionType: 'Connection Type', userLocationName: 'Toronto', userIp: 'CA - 39.208.95.21', userLocationCode: 'CA', childs: [ { _id: '60c5c0b220d2d56612d330cd1', accountManager: 'Sagi Tikotski', activity: '4 TM licenses have been purchased', activityType: 'Expansion', arrChanged: -15, companyName: 'Child1', companySize: 'Medium', country: 'IL', createdDate: '2021-06-13T00:00:00.000Z', customerId: 'metricslegal', customerSuccessEngineer: 'Amit Geva', userEmail: 'child@fake.com', userName: 'Mock mock', website: 'thepctnetwork.com', companyHref: '/' }, { _id: '60c5c0b220d2d56612d330cd2', accountManager: 'Sagi Tikotski', activity: '4 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 321, companyName: 'Child2', companySize: 'Medium', country: 'IL', createdDate: '2021-06-13T00:00:00.000Z', customerId: 'metricslegal', customerSuccessEngineer: 'Amit Geva', userEmail: 'child@fake.com', userName: 'Mock mock', website: 'thepctnetwork.com', companyHref: '/', childs: [ { _id: '60c5c0b220d2d56612d330cd32', accountManager: 'Sagi Tikotski', activity: '4 TM licenses have been purchased', activityType: 'Expansion', arrChanged: -15, companyName: 'Nested child', companySize: 'Large', country: 'IL', createdDate: '2021-06-13T00:00:00.000Z', customerId: 'metricslegal', customerSuccessEngineer: 'John Snow', userEmail: 'nested_child@fake.com', userName: 'Mocky mock', website: 'thepctnetwork.com', companyHref: '/' } ] } ] }, { _id: '60c56c5520d2d56612ce60ae', accountManager: 'Joe Ferrigno', activity: '15 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 1350, cancellationReason: 'I am experiencing technical difficulties', comments: '*Not renewing*', companyName: 'CopperTree Solutions Inc', companySize: 'Large', country: 'CA', createdDate: '2021-06-13T00:00:00.000Z', customerId: 'coppertree', customerSuccessEngineer: 'Amit Geva', osType: 'Linux', webRuleName: 'Web Rule Link', webRuleLink: 'http://www.facebook.com', userEmail: '-', userName: '-', website: 'ctsol.ca', companyHref: '/', emailVerified: true, action: 'Block', webCategory: 'Business and Economy', showAvatarTooltip: false, disabled: true }, { _id: '60c5503520d2d56612ccbaa0', accountManager: 'Sivan Tehila', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 115, companyName: 'V Shred LLC', companySize: 'Medium', country: 'US', createdDate: '2021-06-13T00:00:00.000Z', customerId: 'vshred', customerSuccessEngineer: 'Harold Seeram', osType: 'Android', points: 112.71556364, userEmail: 'v.shred@fake.com', userName: 'Victor Shred', website: 'vshred.com', companyHref: '/', emailVerified: true, isUserGreyed: false, actions: 'edit', webRuleName: 'Link', url: 'http://www.facebook.com', webRuleLink: 'https://www.example.com', network: 'Network 3', regionName: 'New York - 2', regionIp: 'US - 68.108.91.70', regionCode: 'US', sourceIp: '68.134.96.78', destinationIp: '103.41.81.70', program: 'Slack.exe', action: 'Success', webCategory: 'Social Media', showAvatarTooltip: false }, { _id: '60c509e220d2d56612c916b2', accountManager: 'Jim Finnerty', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 90, comments: 'Just started with Implementation - good standing. Very limited use case', companyName: 'Feedwire', companySize: 'Small', country: 'US', createdDate: '2021-06-12T00:00:00.000Z', customerId: 'feedwire', customerSuccessEngineer: 'Amit Geva', osType: 'IOS', points: 84.21565664, userEmail: '-', userName: '-', website: 'https://www.feedwire.com', companyHref: '/', webCategory: 'Business and Economy' }, { _id: '60c41ad520d2d56612bc5dde', accountManager: 'David Boyajian', activity: '1 PS licenses have been purchased', activityType: 'Expansion', arrChanged: 600, comments: 'NA', companyName: 'Drishti Technologies Inc', companySize: 'Medium', country: 'US', createdDate: '2021-06-12T00:00:00.000Z', customerId: 'drishti', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'https://drishti.com/about-us/', companyHref: '/' }, { _id: '60c56c5520d2d56612ce60ad', accountManager: 'Joe Ferrigno', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: -90, comments: 'Growing organically, but still small', companyName: 'CopperTree Solutions Inc', companySize: 'Large', country: 'CA', createdDate: '2021-06-13T00:00:00.000Z', customerId: 'coppertree', customerSuccessEngineer: 'Amit Geva', userEmail: 'john.doe@fake.com', userName: 'John Doe', website: 'ctsol.ca', companyHref: '/', emailVerified: false, isUserGreyed: false, actions: 'edit', webRuleName: 'Table Body Text', url: 'http://www.linkedin.com', webRuleLink: 'https://www.linkedin.com', network: 'Network 2', regionName: 'Toronto', regionIp: 'CA - 39.208.95.21', regionCode: 'CA', sourceIp: '12.34.56.78', destinationIp: '13.21.11.7', program: 'Slack.exe', action: 'Success', webCategory: 'Business and Economy', showAvatarTooltip: false }, { _id: '60c40cc520d2d56612bb6aac', accountManager: 'Sivan Tehila', activity: '2 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 0, comments: 'NA', companyName: 'Cloudwick', companySize: 'Medium', country: 'US', createdDate: '2021-06-12T00:00:00.000Z', customerId: 'cloudwick', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'cloudwick.com', companyHref: '/' }, { _id: '60c40cc520d2d56612bb6aab', accountManager: 'Gregg Golden', activity: '4 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 1000001, companyName: 'Axiom Zen', companySize: 'Enterprise', country: 'CA', createdDate: '2021-06-12T00:00:00.000Z', customerId: 'axiomzenportfolio', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'axiomzen.co', companyHref: '/' }, { _id: '60c3feb420d2d56612ba8d42', accountManager: 'David Boyajian', activity: '2 PS licenses have been purchased', activityType: 'Expansion', arrChanged: 1200, companyName: 'Drishti Technologies Inc', companySize: 'Medium', country: 'US', createdDate: '2021-06-12T00:00:00.000Z', customerId: 'drishti', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'https://drishti.com/about-us/', companyHref: '/' }, { _id: '60c3e29520d2d56612b8e98d', accountManager: 'David Boyajian', activity: '2 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 200, comments: 'NA', companyName: 'Crossbeam, Inc.', companySize: 'Medium', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'crossbeam', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'getcrossbeam.com', companyHref: '/' }, { _id: '60c3b86220d2d56612b682a3', accountManager: 'Sivan Tehila', activity: '4 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 1000000003, companyName: 'Cloudwick', companySize: 'Medium', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'cloudwick', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'cloudwick.com', companyHref: '/' }, { _id: '60c3aa5420d2d56612b5b569', accountManager: 'Sivan Tehila', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 96, comments: "Slowly onboarding their users, but the admin assures us it's simply due to bandwidth and nothing to do with the platform.", companyName: 'vzghost', companySize: 'SMB', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'vzghost', customerSuccessEngineer: 'Amit Geva', userEmail: '-', userName: '-', website: 'g6labs.com', companyHref: '/' }, { _id: '60c3aa5420d2d56612b5b568', accountManager: 'David Boyajian', activity: '10 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 960, comments: 'NA', companyName: 'SchoolPass', companySize: 'SMB', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'schoolpass', customerSuccessEngineer: 'Amit Geva', userEmail: '-', userName: '-', website: 'schoolpass.com', companyHref: '/' }, { _id: '60c3aa5420d2d56612b5b566', accountManager: 'Gregg Golden', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 180, companyName: 'Ronati', companySize: 'SMB', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'ronati', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'ronati.com', companyHref: '/' }, { _id: '60c3aa5420d2d56612b5b563', accountManager: 'David Boyajian', activity: '3 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 360, companyName: 'JuliusWorks', companySize: 'SMB', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'julius', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'https://www.juliusworks.com', companyHref: '/' }, { _id: '60c3aa5420d2d56612b5b562', accountManager: 'Katarina Klein', activity: '3 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 540, comments: 'Organically growing', companyName: 'Craft Clubs Ltd', companySize: 'Medium', country: 'GB', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'craftginclub', customerSuccessEngineer: 'Yevgeni Bulichev', userEmail: '-', userName: '-', website: 'craftginclub.co.uk', companyHref: '/' }, { _id: '60c38e3220d2d56612b41e7f', accountManager: 'Sivan Tehila', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 96, companyName: 'Project Well', companySize: 'SMB', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'wellbetty', customerSuccessEngineer: 'Amit Geva', userEmail: '-', userName: '-', website: 'wellbetty.com', companyHref: '/' }, { _id: '60c38e3220d2d56612b41e7d', accountManager: 'Gregg Golden', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 180, companyName: 'Ready Responders', companySize: 'Large', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'ready', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'readyresponders.com', companyHref: '/' }, { _id: '60c38e3220d2d56612b41e7b', accountManager: 'David Boyajian', activity: '10 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 1800, companyName: 'Feedonomics Inc.', companySize: 'Medium', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'feedonomics', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'https://feedonomics.com/', companyHref: '/' }, { _id: '60c38e3220d2d56612b41e7a', accountManager: 'David Boyajian', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 144, cancellationReason: 'Not using the service as much as expected', comments: 'Never logged into platform, Annual until July 2022', companyName: 'Ciitizen', companySize: 'Small', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'ciitizen', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'https://www.ciitizen.com/', companyHref: '/' }, { _id: '60c3721320d2d56612b277c1', accountManager: 'Gregg Golden', activity: '1 PS licenses have been purchased', activityType: 'Expansion', arrChanged: 480, companyName: 'CEFALY Technology', companySize: 'SMB', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'cefaly', customerSuccessEngineer: 'Amit Geva', userEmail: '-', userName: '-', website: 'cefaly.com', companyHref: '/' }, { _id: '60c355f220d2d56612b0b93b', accountManager: 'Katarina Klein', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 144, companyName: 'Harbr Group Limited', companySize: 'Medium', country: 'GB', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'harbrdata', customerSuccessEngineer: 'Alex Berman', userEmail: '-', userName: '-', website: 'harbr.group', companyHref: '/' }, { _id: '60c347e320d2d56612affa50', accountManager: 'Sagi Tikotski', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 120, comments: 'Still not sure about the future, because of the overtake by HP. Scheduled a QBR for Jan. 5th 2022', companyName: 'Catalyst Media Integrated LLP', companySize: 'SMB', country: 'IN', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'catalystmi', customerSuccessEngineer: 'Amit Geva', userEmail: '-', userName: '-', website: 'catalystmi.com', companyHref: '/' }, { _id: '60c32bc220d2d56612ae38a7', accountManager: 'Gregg Golden', activity: '1 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 138, comments: 'Growing organically after 1-2 months. Unresponsive but annual until December 2022', companyName: 'RSVP', companySize: 'Large', country: 'GB', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'rsvpmedia', customerSuccessEngineer: 'Alex Berman', userEmail: '-', userName: '-', website: 'rsvp.co.uk', companyHref: '/' }, { _id: '60c31db320d2d56612ad6863', accountManager: 'Michael Warfield', activity: '1 PS licenses have been purchased', activityType: 'Expansion', arrChanged: 480, comments: 'Awaiting legal', companyName: 'Datum360', companySize: 'SMB', country: 'GB', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'datum360', customerSuccessEngineer: 'Yevgeni Bulichev', userEmail: '-', userName: '-', website: 'datum360.com', companyHref: '/' }, { _id: '60c2c95520d2d56612a885dc', accountManager: 'Gregg Golden', activity: '20 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 3600, companyName: 'Partners in Performance International Pty Ltd', companySize: 'Large', country: 'AU', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'pipglobal', customerSuccessEngineer: 'Amit Geva', userEmail: '-', userName: '-', website: 'pip.global', companyHref: '/' }, { _id: '60c2c95520d2d56612a885db', accountManager: 'Gregg Golden', activity: '50 TM licenses have been purchased', activityType: 'Expansion', arrChanged: 9000, companyName: 'Partners in Performance International Pty Ltd', companySize: 'Large', country: 'AU', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'pipglobal', customerSuccessEngineer: 'Amit Geva', userEmail: '-', userName: '-', website: 'pip.global', companyHref: '/' }, { _id: '60c2bb4520d2d56612a79493', accountManager: 'David Boyajian', activity: '1 PS licenses have been purchased', activityType: 'Expansion', arrChanged: 600, comments: 'Expanding in August/September/October, but MAU% has decreased since.', companyName: 'Nimble Robotics', companySize: 'Medium', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'nimble', customerSuccessEngineer: 'Harold Seeram', userEmail: '-', userName: '-', website: 'nimble.ai', companyHref: '/' }, { _id: '60c29f2220d2d56612a5e36a', accountManager: 'Sivan Tehila', activity: '5 TM and 1 PS licenses have been purchased', activityType: 'New', arrChanged: 1200, companyName: 'Nexla', companySize: 'SMB', country: 'US', createdDate: '2021-06-11T00:00:00.000Z', customerId: 'nexla', customerSuccessEngineer: 'Amit Geva', userEmail: '-', userName: '-', website: '-', companyHref: '/' }, { _id: '60c2911820d2d56612a52522', accountManager: undefined, activity: '2 TM licenses have been purchased', activityType: 'Expansion', arrChanged: undefined, companyName: undefined, companySize: 'SMB', country: 'US', createdDate: undefined, customerId: 'prefect', customerSuccessEngineer: undefined, userEmail: '-', userName: undefined, website: 'prefect.io', companyHref: '/' } ] }; const mockTableConfig: DataGridProps['tableConfig'] = [ { isSortable: false, pinnable: false, field: 'companyName', title: 'Company Name', show: true, width: 360, fieldsToExport: [ 'companyName', 'customerId', 'status', 'companySize', 'country', 'customerType' ] }, { isSortable: true, field: 'createdDate', title: 'Date', show: true, width: 144, fieldsToExport: ['createdDate'], customTimeFunc: time => { const oneHour = 3600000; const oneMin = 60000; // Convert both dates to milliseconds const then = new Date(time).getTime(); const now = new Date().getTime(); // Calculate the difference in milliseconds const difference = Math.abs(now - then); const differenceInMins = Math.round(difference / oneMin); if (difference < oneHour) { return `${differenceInMins} min ago`; } else { return false; } }, timeFormat: 'HH:MM:ss' }, { isSortable: true, field: 'cancellationReason', title: 'Cancellation Reason', show: true, width: 240, truncateText: true, fieldsToExport: ['cancellationReason'] }, { isSortable: true, field: 'osType', title: 'OS Type', show: true, width: 160, fieldsToExport: ['osType'] }, { isSortable: true, field: 'points', title: 'Points', show: true, width: 160, fieldsToExport: ['points'], customNodeGenerator: value => { if (typeof value === 'number') { return `${value.toFixed(2)} points`; } else { return '-'; } } }, { isSortable: true, field: 'action', title: 'Action', show: true, width: 160, fieldsToExport: ['action'], indicatorColors: { block: '#FD596F', success: '#44D7B6', warn: '#FFC955' } }, { isSortable: true, field: 'comments', title: 'Comments', show: true, width: 240, fieldsToExport: ['comments'] }, { isSortable: true, field: 'webCategory', title: 'Web Category', show: true, width: 193, fieldsToExport: ['webCategory'] }, { isSortable: false, field: 'webRule', title: 'Web Rule Name', show: true, width: 174, fieldsToExport: ['webRuleName'] }, { isSortable: false, field: 'network', title: 'Network', show: true, width: 174, fieldsToExport: ['network'] }, { isSortable: false, field: 'regionName', title: 'Region', show: true, width: 200, fieldsToExport: ['region'] }, { isSortable: false, field: 'url', title: 'URL', show: true, width: 174, fieldsToExport: ['url'] }, { isSortable: false, field: 'userName', title: 'Contact Person', show: true, width: 174, fieldsToExport: ['userName'], withEmailIcon: false, withUserIcon: true, avatarTooltipText: 'Deleted rule' }, { isSortable: false, field: 'sourceIp', title: 'Source IP', show: true, width: 174, fieldsToExport: ['sourceIp'] }, { field: 'destinationIp', isSortable: false, title: 'Destination IP', show: true, width: 174, fieldsToExport: ['destinationIp'] }, { field: 'program', isSortable: false, title: 'Program', show: true, width: 174, fieldsToExport: ['program'] }, { isSortable: false, field: 'activity', title: 'Activity', show: true, width: 364, fieldsToExport: ['activity'] }, { isSortable: true, field: 'activityType', title: 'Activity Type', show: true, width: 160, fieldsToExport: ['activityType'] }, { isSortable: true, field: 'arrChanged', title: 'ARR', fromToGroup: true, show: true, width: 112, fieldsToExport: ['arrChanged'] }, { isSortable: false, field: 'accountManager', title: 'Acc. Manager', show: true, width: 144, align: 'center', fieldsToExport: ['accountManager'] }, { isSortable: false, field: 'customerSuccessEngineer', title: 'CS Engineer', show: true, width: 144, align: 'center', fieldsToExport: ['customerSuccessEngineer'] }, { isSortable: false, field: 'actions', title: '', show: true, width: 150, align: 'center', fieldsToExport: [], actions: [ { iconSrc: `${ASSETS_URL}/icons/icon_trash.svg`, value: 'trash', onClick: value => () => { alert('Trash click'); } }, { iconSrc: `${ASSETS_URL}/icons/icon_Edit.svg`, value: 'edit', onClick: value => () => { alert('Edit click'); } }, { iconSrc: `${ASSETS_URL}/icons/icon_View.svg`, value: 'view', onClick: value => () => { alert('View click'); } } ] } ]; mockData.data.forEach(item => { if (item.webRuleName) { item.webRule = { text: item.webRuleName, link: item.webRuleLink, tooltipText: item.webRuleLink ? 'View Web Filter Rule' : 'Deleted Rule' }; } }); const mockPrimary: DataGridMockProps = { title1: 'Hello World', tableConfig: mockTableConfig, tableData: mockData }; // first and second are for compatibility with older modules export { mockData, mockTableConfig, mockPrimary };