Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lf 4747 create sensor readings kpi component #3705

Merged
merged 33 commits into from
Mar 25, 2025
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6f5af71
LF-4747 Add Bento layout style
Duncan-Brain Feb 28, 2025
8b95619
LF-4747 Customize gap and max columns
Duncan-Brain Mar 1, 2025
bec9e2e
LF-4747 Add update licence
Duncan-Brain Mar 1, 2025
44d999d
LF-4747 Update type in meta definiton
Duncan-Brain Mar 1, 2025
92011d5
LF-4747 Add sensor reading KPI tile
Duncan-Brain Mar 1, 2025
9c8a735
LF-4747 Add stories for sensor reading kpi tile
Duncan-Brain Mar 1, 2025
2625440
LF-4747 Add ruler icon
Duncan-Brain Mar 3, 2025
15e543b
LF-4747 Update Bento layout to have default values
Duncan-Brain Mar 3, 2025
52b7feb
LF-4747 Update Layout stories to require props for story
Duncan-Brain Mar 3, 2025
7c0eede
LF-4747 Create sensor KPI tile
Duncan-Brain Mar 3, 2025
809a617
LF-4747 Add stories for sensor KPI tile
Duncan-Brain Mar 3, 2025
b8db5b6
LF-4747 Extract out reusable Measurement type
Duncan-Brain Mar 3, 2025
f911d5a
LF-4747 Adjust font and positioning styles for sensorKPI
Duncan-Brain Mar 3, 2025
e269c45
LF-4747 Adjust date on scss file
Duncan-Brain Mar 3, 2025
96b70d6
LF-4747 Update bento layout
Duncan-Brain Mar 4, 2025
a9bde5f
LF-4747 Opt out of default mobile behaviour in nested bento layout
Duncan-Brain Mar 4, 2025
1b0cad4
LF-4747 Disallow text wrapping for measure text
Duncan-Brain Mar 4, 2025
088ec03
LF-4747 Update stories
Duncan-Brain Mar 4, 2025
3b8237f
LF-4747 Update sensor tiles to accept intrinsic atributes like key etc
Duncan-Brain Mar 4, 2025
e4e667c
LF-4747 Add color as prop and remove opacity layer due to buggy corne…
Duncan-Brain Mar 4, 2025
68ea95d
LF-4747 Add default color black and handle 3 character colors
Duncan-Brain Mar 4, 2025
60ada2a
LF-4747 improve stories structure and add colors
Duncan-Brain Mar 4, 2025
7a3325d
LF-4747 Use profile discriminator measurement type to decide icon
Duncan-Brain Mar 5, 2025
682ad9e
LF-4747 Remove unused import and unused function
Duncan-Brain Mar 5, 2025
b2a16d0
LF-4747 Fix typing and remove extra css property
Duncan-Brain Mar 6, 2025
a537169
LF-4747 Update css comments
Duncan-Brain Mar 18, 2025
38ebea3
LF-4747 remove excess css style
Duncan-Brain Mar 18, 2025
8523139
LF-4747 combine identical css
Duncan-Brain Mar 18, 2025
7271b58
LF-4747 Remove color validation and replace with JsDoc
Duncan-Brain Mar 18, 2025
2b3b847
LF-4747 fix stories color
Duncan-Brain Mar 18, 2025
a011940
LF-4747 Make stories better so props can be adjusted in storybook - o…
Duncan-Brain Mar 18, 2025
c5ff9e2
LF-4747 Move into SensorTile folder - tbd if moving up to components …
Duncan-Brain Mar 18, 2025
8b8474f
LF-4747 Fix types - thanks Joyce
Duncan-Brain Mar 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
LF-4747 Update stories
  • Loading branch information
Duncan-Brain committed Mar 4, 2025
commit 088ec03bb7731d622cf826dcbe790090f6ef23aa
78 changes: 64 additions & 14 deletions packages/webapp/src/stories/Tile/SensorKPITiles.stories.tsx
Original file line number Diff line number Diff line change
@@ -22,15 +22,16 @@ import { Status } from '../../components/StatusIndicatorPill';

// type PropTypes = SensorReadingKPIprops | SensorKPIprops;

type TemplateProps = Partial<BentoLayoutProps> & {
type TemplateProps = {
TileComponent: () => JSX.Element;
bento: boolean;
};

const Template = ({ TileComponent, layoutConfig }: TemplateProps) => {
return layoutConfig ? (
<BentoLayout layoutConfig={layoutConfig}>
{new Array(layoutConfig.maxColumns + 2).fill('').map(() => {
return <TileComponent />;
const Template = ({ TileComponent, bento }: TemplateProps) => {
return bento ? (
<BentoLayout>
{new Array(5).fill('').map((_val, id) => {
return <TileComponent key={id} />;
})}
</BentoLayout>
) : (
@@ -55,10 +56,7 @@ const SensorReadingKPITile = () => {
export const SensorReadingKPIBento: Story = {
args: {
TileComponent: SensorReadingKPITile,
layoutConfig: {
gapInPx: 8,
maxColumns: 3,
},
bento: true,
},
};

@@ -103,10 +101,7 @@ const SensorKPITile = () => {
export const SensorKPIBento: Story = {
args: {
TileComponent: SensorKPITile,
layoutConfig: {
gapInPx: 8,
maxColumns: 3,
},
bento: true,
},
};

@@ -115,3 +110,58 @@ export const SensorKPIOne: Story = {
TileComponent: SensorKPITile,
},
};

const SensorKPITileManyParams = () => {
const props = {
sensor: {
id: 'AS4TG5',
status: {
status: Status.ONLINE,
pillText: 'Online',
tooltipText: 'Device has sent data in the last 12 hours',
},
},
discriminator: {
measurement: 'depth_elevation',
value: 50,
unit: 'cm',
},
measurements: [
{
measurement: 'Ambient Temperature',
value: 50,
unit: '°F',
},
{
measurement: 'Wind Speed',
value: 50,
unit: 'km/h',
},
{
measurement: 'Wind Direction',
value: 30,
unit: 'NE',
},
{
measurement: 'Humidity',
value: 50,
unit: '%',
},
],
};

return <SensorKPI {...props} />;
};

export const SensorKPIManyParamsBento: Story = {
args: {
TileComponent: SensorKPITileManyParams,
bento: true,
},
};

export const SensorKPIManyParamsOne: Story = {
args: {
TileComponent: SensorKPITileManyParams,
},
};