Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createRandomItem(docRefType) {
return {
uuid: guid(),
type: docRefType,
name: loremIpsum(LOREM_CONFIG),
};
}
import loremIpsum from 'lorem-ipsum';
const getRandomInt = (min, max) => Math.floor(Math.random() * (max - min)) + min;
const LOREM_CONFIG = { count: 3, units: 'words' };
const minimalTracker_undefinedLastPollAge = {
filterId: 1,
enabled: true,
lastPollAge: undefined,
pipelineName: loremIpsum(LOREM_CONFIG),
priority: getRandomInt(1, 99),
filter: '',
createUser: 'tester',
createdOn: 87134234234,
};
const minimalTracker_nullLastPollAge = {
filterId: 2,
enabled: true,
lastPollAge: null,
pipelineName: loremIpsum(LOREM_CONFIG),
priority: getRandomInt(1, 99),
filter: '',
createUser: 'tester',
createdOn: 87134234234,
};
onLoad: () => {
console.log('Photo loaded');
},
status: status,
date: +new Date(),
avatar: `data:image/png;base64,${this.photo()}`,
};
case 'chat':
return {
id: String(Math.random()),
avatar: `data:image/png;base64,${this.photo()}`,
avatarFlexible: true,
statusColor: 'lightgreen',
statusColorType: parseInt(Math.random() * 100 % 2) === 1 ? 'encircle' : undefined,
alt: loremIpsum({ count: 2, units: 'words' }),
title: loremIpsum({ count: 2, units: 'words' }),
date: new Date(),
subtitle: loremIpsum({ count: 1, units: 'sentences' }),
unread: parseInt(Math.random() * 10 % 3),
dropdownMenu: (
,
size: 24,
}
}}
items={[
function homePageView() {
return div([
h1('Welcome to History Examples!'),
p(placeholderText())
])
}
_reload(numItems) {
const tableData = [];
for (var i = 0; i < numItems; i++) {
tableData.push({
id: i,
name: {
first: loremIpsum({ count: 1, units: "words" }),
last: loremIpsum({ count: 2, units: "words" }),
},
age: Math.round(Math.random() * 100),
status: loremIpsum({ count: 1, units: "words" }),
notes: loremIpsum({ count: 2, units: "sentences" }),
});
}
this.setState({ tableData });
if (this._lazyTable) {
this._lazyTable.lazyReset();
}
}
addAlert = () => {
const alert = {
message: ipsum({ count: Math.floor(Math.random() * 4) }),
type: this.randomType(),
id: Math.random(),
};
this.setState(({ alerts }) => ({
alerts: [alert, ...alerts],
}));
};
create({ content = {}, ...options }: Object) {
const previewText = content.text || loremIpsum(content.lipsum || defaultLipsum);
return {
type: "cms-element-text",
elements: [],
data: {
text: createValue(previewText, content.typography || "paragraph"),
settings: {
margin: {
mobile: { top: 0, left: 0, right: 0, bottom: 15 },
desktop: { top: 0, left: 0, right: 0, bottom: 25 },
advanced: true
},
padding: {
desktop: { all: 0 },
mobile: { all: 0 }
}
},
status: status,
date: +new Date(),
avatar: `data:image/png;base64,${this.photo()}`,
};
case 'chat':
return {
id: String(Math.random()),
avatar: `data:image/png;base64,${this.photo()}`,
avatarFlexible: true,
statusColor: 'lightgreen',
statusColorType: parseInt(Math.random() * 100 % 2) === 1 ? 'encircle' : undefined,
alt: loremIpsum({ count: 2, units: 'words' }),
title: loremIpsum({ count: 2, units: 'words' }),
date: new Date(),
subtitle: loremIpsum({ count: 1, units: 'sentences' }),
unread: parseInt(Math.random() * 10 % 3),
dropdownMenu: (
,
size: 24,
}
}}
items={[
{
icon: {
)}
`}
>
<button type="primary"> this.setState({isModalOpen: true})}
value="Open Modal"
/>
{this.state.isModalOpen && (
this.setState({isModalOpen: false})}
>
<p>{loremIpsum({count: 1, units: "paragraphs"})}</p>
<p>{loremIpsum({count: 1, units: "paragraphs"})}</p>
<footer>
</footer></button><button type="link" value="Never mind"> this.setState({isModalOpen: false})}
/>
</button><button type="primary" value="Sounds good"> this.setState({isModalOpen: false})}
/>
)}
</button>
setInterval(() => {
for (const contestId of Object.keys(this.clarificationsMap)) {
const clarifArr = this.clarificationsMap[contestId]
for (const clarif of clarifArr) {
const newEntry: ClarificationEntry = {
id: Math.round(Math.random() * 100000).toString(),
sender: 'jury',
content: loremIpsum({ count: 1, units: 'paragraphs' }),
read: false,
issuedTime: new Date(),
}
clarif.entries.push(newEntry)
}
}
}, 60 * 1000)
}