Skip to content

Commit

Permalink
Fix approximately 1 billion faker console warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Sep 21, 2023
1 parent 038a697 commit 7a272da
Show file tree
Hide file tree
Showing 45 changed files with 179 additions and 173 deletions.
6 changes: 3 additions & 3 deletions src-docs/src/views/datagrid/advanced/custom_renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ import {
const raw_data: Array<{ [key: string]: string }> = [];
for (let i = 1; i < 100; i++) {
raw_data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()}`,
email: faker.internet.email(),
location: `${faker.address.city()}, ${faker.address.country()}`,
location: `${faker.location.city()}, ${faker.location.country()}`,
date: `${faker.date.past()}`,
amount: faker.commerce.price(1, 1000, 2, '$'),
amount: faker.commerce.price({ min: 1, max: 1000, dec: 2, symbol: '$' }),
});
}

Expand Down
8 changes: 4 additions & 4 deletions src-docs/src/views/datagrid/advanced/in_memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ const raw_data = [];

for (let i = 1; i < 100; i++) {
raw_data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: <EuiLink href="">{faker.internet.email()}</EuiLink>,
location: (
<Fragment>
{`${faker.address.city()}, `}
<EuiLink href="https://google.com">{faker.address.country()}</EuiLink>
{`${faker.location.city()}, `}
<EuiLink href="https://google.com">{faker.location.country()}</EuiLink>
</Fragment>
),
date: `${faker.date.past()}`,
account: faker.finance.account(),
account: faker.finance.accountNumber(),
amount: faker.commerce.price(),
phone: faker.phone.number(),
version: faker.system.semver(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ const raw_data = [];

for (let i = 1; i < 100; i++) {
raw_data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: <EuiLink href="">{faker.internet.email()}</EuiLink>,
location: (
<Fragment>
{`${faker.address.city()}, `}
<EuiLink href="https://google.com">{faker.address.country()}</EuiLink>
{`${faker.location.city()}, `}
<EuiLink href="https://google.com">{faker.location.country()}</EuiLink>
</Fragment>
),
date: `${faker.date.past()}`,
account: faker.finance.account(),
account: faker.finance.accountNumber(),
amount: faker.commerce.price(),
phone: faker.phone.number(),
version: faker.system.semver(),
Expand Down
8 changes: 4 additions & 4 deletions src-docs/src/views/datagrid/advanced/in_memory_pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ const raw_data = [];

for (let i = 1; i < 100; i++) {
raw_data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: <EuiLink href="">{faker.internet.email()}</EuiLink>,
location: (
<Fragment>
{`${faker.address.city()}, `}
<EuiLink href="https://google.com">{faker.address.country()}</EuiLink>
{`${faker.location.city()}, `}
<EuiLink href="https://google.com">{faker.location.country()}</EuiLink>
</Fragment>
),
date: `${faker.date.past()}`,
account: faker.finance.account(),
account: faker.finance.accountNumber(),
amount: faker.commerce.price(),
phone: faker.phone.number(),
version: faker.system.semver(),
Expand Down
8 changes: 4 additions & 4 deletions src-docs/src/views/datagrid/advanced/in_memory_sorting.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ const raw_data = [];

for (let i = 1; i < 100; i++) {
raw_data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: <EuiLink href="">{faker.internet.email()}</EuiLink>,
location: (
<Fragment>
{`${faker.address.city()}, `}
<EuiLink href="https://google.com">{faker.address.country()}</EuiLink>
{`${faker.location.city()}, `}
<EuiLink href="https://google.com">{faker.location.country()}</EuiLink>
</Fragment>
),
date: `${faker.date.past()}`,
account: faker.finance.account(),
account: faker.finance.accountNumber(),
amount: faker.commerce.price(),
phone: faker.phone.number(),
version: faker.system.semver(),
Expand Down
6 changes: 3 additions & 3 deletions src-docs/src/views/datagrid/advanced/ref.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ import {
const raw_data: Array<{ [key: string]: string }> = [];
for (let i = 1; i < 100; i++) {
raw_data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()}`,
email: faker.internet.email(),
location: `${faker.address.city()}, ${faker.address.country()}`,
account: faker.finance.account(),
location: `${faker.location.city()}, ${faker.location.country()}`,
account: faker.finance.accountNumber(),
date: `${faker.date.past()}`,
});
}
Expand Down
8 changes: 4 additions & 4 deletions src-docs/src/views/datagrid/basics/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ const data = [];

for (let i = 1; i < 20; i++) {
data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: faker.internet.email(),
city: <EuiLink href="http://google.com">{faker.address.city()}</EuiLink>,
country: faker.address.country(),
account: faker.finance.account(),
city: <EuiLink href="http://google.com">{faker.location.city()}</EuiLink>,
country: faker.location.country(),
account: faker.finance.accountNumber(),
});
}

Expand Down
10 changes: 5 additions & 5 deletions src-docs/src/views/datagrid/basics/datagrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const raw_data = [];

for (let i = 1; i < 100; i++) {
const email = faker.internet.email();
const name = `${faker.name.lastName()}, ${faker.name.firstName()}`;
const suffix = faker.name.suffix();
const name = `${faker.person.lastName()}, ${faker.person.firstName()}`;
const suffix = faker.person.suffix();
raw_data.push({
name: {
formatted: `${name} ${suffix}`,
Expand All @@ -54,12 +54,12 @@ for (let i = 1; i < 100; i++) {
},
location: (
<Fragment>
{`${faker.address.city()}, `}
<EuiLink href="https://google.com">{faker.address.country()}</EuiLink>
{`${faker.location.city()}, `}
<EuiLink href="https://google.com">{faker.location.country()}</EuiLink>
</Fragment>
),
date: `${faker.date.past()}`,
account: faker.finance.account(),
account: faker.finance.accountNumber(),
amount: faker.commerce.price(),
phone: faker.phone.number(),
version: faker.system.semver(),
Expand Down
8 changes: 4 additions & 4 deletions src-docs/src/views/datagrid/basics/flex.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ const data = [];

for (let i = 1; i < 20; i++) {
data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: faker.internet.email(),
city: <EuiLink href="http://google.com">{faker.address.city()}</EuiLink>,
country: faker.address.country(),
account: faker.finance.account(),
city: <EuiLink href="http://google.com">{faker.location.city()}</EuiLink>,
country: faker.location.country(),
account: faker.finance.accountNumber(),
});
}

Expand Down
12 changes: 7 additions & 5 deletions src-docs/src/views/datagrid/basics/virtualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,21 @@ function RenderCellValue({ rowIndex, columnId }) {

if (data[rowIndex] == null) {
const email = faker.internet.email();
const name = `${faker.name.lastName()}, ${faker.name.firstName()}`;
const suffix = faker.name.suffix();
const name = `${faker.person.lastName()}, ${faker.person.firstName()}`;
const suffix = faker.person.suffix();
data[rowIndex] = {
name: `${name} ${suffix}`,
email: <EuiLink href="">{email}</EuiLink>,
location: (
<Fragment>
{`${faker.address.city()}, `}
<EuiLink href="https://google.com">{faker.address.country()}</EuiLink>
{`${faker.location.city()}, `}
<EuiLink href="https://google.com">
{faker.location.country()}
</EuiLink>
</Fragment>
),
date: `${faker.date.past()}`,
account: faker.finance.account(),
account: faker.finance.accountNumber(),
amount: faker.commerce.price(),
phone: faker.phone.number(),
version: faker.system.semver(),
Expand Down
12 changes: 7 additions & 5 deletions src-docs/src/views/datagrid/basics/virtualization_constrained.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,21 @@ function RenderCellValue({ rowIndex, columnId }) {

if (data[rowIndex] == null) {
const email = faker.internet.email();
const name = `${faker.name.lastName()}, ${faker.name.firstName()}`;
const suffix = faker.name.suffix();
const name = `${faker.person.lastName()}, ${faker.person.firstName()}`;
const suffix = faker.person.suffix();
data[rowIndex] = {
name: `${name} ${suffix}`,
email: <EuiLink href="">{email}</EuiLink>,
location: (
<Fragment>
{`${faker.address.city()}, `}
<EuiLink href="https://google.com">{faker.address.country()}</EuiLink>
{`${faker.location.city()}, `}
<EuiLink href="https://google.com">
{faker.location.country()}
</EuiLink>
</Fragment>
),
date: `${faker.date.past()}`,
account: faker.finance.account(),
account: faker.finance.accountNumber(),
amount: faker.commerce.price(),
phone: faker.phone.number(),
version: faker.system.semver(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ const columns: EuiDataGridColumn[] = [
const data: Array<{ [key: string]: ReactNode }> = [];
for (let i = 1; i < 5; i++) {
data.push({
default: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
default: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
datetime: `${faker.date.past()}`,
json: JSON.stringify([
{
numeric: faker.finance.account(),
numeric: faker.finance.accountNumber(),
currency: faker.finance.amount(),
date: `${faker.date.past()}`,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ const columns: EuiDataGridColumn[] = [
const data: Array<{ [key: string]: ReactNode }> = [];
for (let i = 1; i < 5; i++) {
data.push({
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
suffix: faker.name.suffix(),
firstName: faker.person.firstName(),
lastName: faker.person.lastName(),
suffix: faker.person.suffix(),
boolean: `${faker.datatype.boolean()}`,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ const columns: EuiDataGridColumn[] = [
const data: Array<{ [key: string]: ReactNode }> = [];
for (let i = 1; i < 5; i++) {
data.push({
default: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
default: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
datetime: `${faker.date.past()}`,
json: JSON.stringify([
{
numeric: faker.finance.account(),
numeric: faker.finance.accountNumber(),
currency: faker.finance.amount(),
date: `${faker.date.past()}`,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ for (let i = 1; i < 5; i++) {
avatar: (
<EuiAvatar
size="s"
name={`${faker.name.lastName()}, ${faker.name.firstName()}`}
name={`${faker.person.lastName()}, ${faker.person.firstName()}`}
/>
),
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: faker.internet.email(),
city: faker.address.city(),
country: faker.address.country(),
account: faker.finance.account(),
city: faker.location.city(),
country: faker.location.country(),
account: faker.finance.accountNumber(),
});
}

Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/datagrid/cells_popovers/focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const data = [];

for (let i = 0; i < 10; i++) {
data.push([
<span>{faker.name.firstName()}</span>,
<span>{faker.name.firstName()}</span>,
<span>{faker.person.firstName()}</span>,
<span>{faker.person.firstName()}</span>,

<span>
<EuiLink href="#/tabular-content/data-grid-cells-popovers#focus">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ const columns: EuiDataGridColumn[] = [
const data: Array<{ [key: string]: ReactNode }> = [];
for (let i = 1; i < 5; i++) {
data.push({
default: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
default: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
datetime: `${faker.date.past()}`,
json: JSON.stringify([
{
numeric: faker.finance.account(),
numeric: faker.finance.accountNumber(),
currency: faker.finance.amount(),
date: `${faker.date.past()}`,
},
Expand Down
10 changes: 5 additions & 5 deletions src-docs/src/views/datagrid/schema_columns/column_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ for (let i = 1; i < 5; i++) {
avatar: (
<EuiAvatar
size="s"
name={`${faker.name.lastName()}, ${faker.name.firstName()}`}
name={`${faker.person.lastName()}, ${faker.person.firstName()}`}
/>
),
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: faker.internet.email(),
city: faker.address.city(),
country: faker.address.country(),
account: faker.finance.account(),
city: faker.location.city(),
country: faker.location.country(),
account: faker.finance.accountNumber(),
});
}

Expand Down
10 changes: 5 additions & 5 deletions src-docs/src/views/datagrid/schema_columns/column_widths.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ for (let i = 1; i < 5; i++) {
avatar: (
<EuiAvatar
size="s"
name={`${faker.name.lastName()}, ${faker.name.firstName()}`}
name={`${faker.person.lastName()}, ${faker.person.firstName()}`}
/>
),
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: faker.internet.email(),
city: faker.address.city(),
country: faker.address.country(),
account: faker.finance.account(),
city: faker.location.city(),
country: faker.location.country(),
account: faker.finance.accountNumber(),
});
}

Expand Down
10 changes: 5 additions & 5 deletions src-docs/src/views/datagrid/schema_columns/control_columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ for (let i = 1; i < 500; i++) {
avatar: (
<EuiAvatar
size="s"
name={`${faker.name.lastName()}, ${faker.name.firstName()}`}
name={`${faker.person.lastName()}, ${faker.person.firstName()}`}
/>
),
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
email: faker.internet.email(),
city: faker.address.city(),
country: faker.address.country(),
account: faker.finance.account(),
city: faker.location.city(),
country: faker.location.country(),
account: faker.finance.accountNumber(),
});
}

Expand Down
2 changes: 1 addition & 1 deletion src-docs/src/views/datagrid/schema_columns/footer_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const raw_data = [];

for (let i = 1; i < 20; i++) {
raw_data.push({
name: `${faker.name.lastName()}, ${faker.name.firstName()} ${faker.name.suffix()}`,
name: `${faker.person.lastName()}, ${faker.person.firstName()} ${faker.person.suffix()}`,
date: `${faker.date.past()}`,
amount: `$${faker.commerce.price()}`,
phone: faker.phone.number(),
Expand Down
Loading

0 comments on commit 7a272da

Please sign in to comment.