From 70e05c6a3a685c6c929f93cf48fe08d870518ce6 Mon Sep 17 00:00:00 2001 From: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> Date: Wed, 6 Nov 2024 09:48:44 +0100 Subject: [PATCH] Combobox: Remove Chance to generate options in story (#95842) Generate basic options --- .../grafana-ui/src/components/Combobox/Combobox.story.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/grafana-ui/src/components/Combobox/Combobox.story.tsx b/packages/grafana-ui/src/components/Combobox/Combobox.story.tsx index 23c8f30032b..420a96c1ea9 100644 --- a/packages/grafana-ui/src/components/Combobox/Combobox.story.tsx +++ b/packages/grafana-ui/src/components/Combobox/Combobox.story.tsx @@ -1,6 +1,5 @@ import { action } from '@storybook/addon-actions'; import { Meta, StoryFn, StoryObj } from '@storybook/react'; -import { Chance } from 'chance'; import React, { ComponentProps, useCallback, useEffect, useState } from 'react'; import { SelectableValue } from '@grafana/data'; @@ -13,8 +12,6 @@ import { Select, AsyncSelect } from '../Select/Select'; import { Combobox, ComboboxOption } from './Combobox'; -const chance = new Chance(); - type PropsAndCustomArgs = ComponentProps & { numberOfOptions: number }; const meta: Meta = { @@ -76,8 +73,8 @@ export const Basic: Story = {}; async function generateOptions(amount: number): Promise { return Array.from({ length: amount }, (_, index) => ({ - label: chance.sentence({ words: index % 5 }), - value: chance.guid(), + label: 'Option ' + index, + value: index.toString(), })); }