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

Enhancement/8418 Remove KMW redundant VRT Scenarios #9479

Merged
merged 20 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2fc4ccb
Remove simple redundant KMW error scenarios.
jimmymadon Oct 7, 2024
77cab62
Remove simple redundant KMW loading VRT scenarios.
jimmymadon Oct 7, 2024
7c93e7e
Remove simple redundant KMW InsufficientPermissions VRT scenarios.
jimmymadon Oct 7, 2024
b0a1e03
Remove remaining simple redundant KMW VRT scenarios.
jimmymadon Oct 8, 2024
bfca893
Merge branch 'develop' into enhancement/8418-remove-KMW-VRTs.
jimmymadon Oct 8, 2024
2749031
Add Zero Data scenario to generic MetricTileNumeric component.
jimmymadon Oct 8, 2024
e7e0de4
Add Loading story to generic MetricTileNumeric component for consiste…
jimmymadon Oct 8, 2024
3a40d84
Remove remaining instance of redundant loading scenario is KMW tile.
jimmymadon Oct 8, 2024
7ad1fd0
Add Zero Data scenario to generic MetricTileText component.
jimmymadon Oct 8, 2024
4a7abed
Remove simple redundant KMW zero data VRT scenarios.
jimmymadon Oct 8, 2024
52cb130
Add a single "Loading" state scenario for a generic KMW tile component.
jimmymadon Oct 8, 2024
dbaa80f
Re-add one single Error and Insufficient Permissions scenarios.
jimmymadon Oct 8, 2024
856e0d9
Add documenation for Zero State KMW tiles.
jimmymadon Oct 8, 2024
846a2a4
Add a scenario each for component states of KMW with Custom Dimensions.
jimmymadon Oct 8, 2024
b001b5d
Remove redundant KMW gathering data VRT scenarios.
jimmymadon Oct 8, 2024
7f90cf0
Remove redundant KMW gathering data VRT scenarios.
jimmymadon Oct 8, 2024
1b9f8ec
Merge branch 'enhancement/8418-remove-KMW-VRTs' of github.com:google/…
jimmymadon Oct 8, 2024
bf3651c
Add new VRT reference images for new generic or moved scenarios.
jimmymadon Oct 9, 2024
5f39d0a
Prune VRT reference images not part of active scenarios.
jimmymadon Oct 9, 2024
8be9cdc
Merge branch 'develop' into enhancement/8418-remove-KMW-VRTs.
tofumatt Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 42 additions & 0 deletions assets/js/components/KeyMetrics/MetricTileNumeric.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,48 @@ ZeroChange.scenario = {
delay: 250,
};

export const ZeroData = Template.bind( {} );
ZeroData.storyName = 'Zero Data';
ZeroData.args = {
title: 'New Visitors',
metricValue: 0,
subText: 'of 0 total visitors',
currentValue: 0,
previousValue: 0,
};
// Since the "Zero" state is similar for all "numeric" KMW tiles, this should be
// the sole scenario and should not be added to any other "numeric" type KMW components.
ZeroData.scenario = {
label: 'KeyMetrics/MetricTileNumeric/ZeroData',
delay: 250,
};

export const Loading = Template.bind( {} );
Loading.storyName = 'Loading';
Loading.args = {
title: 'New Visitors',
metricValue: 0,
subText: 'of 0 total visitors',
currentValue: 0,
previousValue: 0,
loading: true,
};
// Since the "Loading" state is the same for all KMW tiles, this is the sole scenario
// and should not be added to any other generic `MetricTile___` or KMW component.
Loading.scenario = {
label: 'KeyMetrics/MetricTileNumeric/Loading',
};
Loading.decorators = [
( Story ) => {
// Ensure the animation is paused for VRT tests to correctly capture the loading state.
return (
<div className="googlesitekit-vrt-animation-paused">
<Story />
</div>
);
},
];

export default {
title: 'Key Metrics/WidgetTiles/MetricTileNumeric',
component: MetricTileNumeric,
Expand Down
2 changes: 2 additions & 0 deletions assets/js/components/KeyMetrics/MetricTileTable.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ ZeroData.args = {
return <div>No data available</div>;
},
};
// Since the "Zero" state is similar for all "tabular" KMW tiles, this should be
// the sole scenario and should not be added to any other "table" type KMW components.
ZeroData.scenario = {
label: 'KeyMetrics/MetricTileTable/ZeroData',
delay: 250,
Expand Down
16 changes: 16 additions & 0 deletions assets/js/components/KeyMetrics/MetricTileText.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,22 @@ ZeroChange.scenario = {
delay: 250,
};

export const ZeroData = Template.bind( {} );
ZeroData.storyName = 'Zero Data';
ZeroData.args = {
title: 'Most engaged traffic source',
metricValue: '-',
subText: '0% of engaged sessions',
currentValue: 0,
previousValue: 0,
};
// Since the "Zero" state is similar for all "textual" KMW tiles, this should be
// the sole scenario and should not be added to any other "text" type KMW components.
ZeroData.scenario = {
label: 'KeyMetrics/MetricTileText/ZeroData',
delay: 250,
};

export const Loading = Template.bind( {} );
Loading.storyName = 'Loading';
Loading.args = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,6 @@ ZeroData.args = {
} );
},
};
ZeroData.scenario = {
label: 'KeyMetrics/TopEarningContentWidget/ZeroData',
delay: 250,
};

export const Error = Template.bind( {} );
Error.storyName = 'Error';
Expand All @@ -192,10 +188,6 @@ Error.args = {
] );
},
};
Error.scenario = {
label: 'KeyMetrics/PopularContent/Error',
delay: 250,
};

export const InsufficientPermissions = Template.bind( {} );
InsufficientPermissions.storyName = 'Insufficient Permissions';
Expand All @@ -221,10 +213,6 @@ InsufficientPermissions.args = {
] );
},
};
InsufficientPermissions.scenario = {
label: 'KeyMetrics/PopularContent/InsufficientPermissions',
delay: 250,
};

export const AdSenseNotLinked = Template.bind( {} );
AdSenseNotLinked.storyName = 'AdSense Not Linked';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ ZeroData.args = {
} );
},
};
ZeroData.scenario = {
label: 'KeyMetrics/EngagedTrafficSourceWidget/ZeroData',
};

export const Error = Template.bind( {} );
Error.storyName = 'Error';
Expand All @@ -119,6 +116,8 @@ Error.args = {
] );
},
};
// Since the "Error" state is the same for all KMW tiles, this is the sole scenario
// and should not be added to any other generic `MetricTile___` or KMW component.
Error.scenario = {
label: 'KeyMetrics/EngagedTrafficSource/Error',
delay: 250,
Expand Down Expand Up @@ -148,6 +147,9 @@ InsufficientPermissions.args = {
] );
},
};
// Since the "Insufficient Permissions Error" state is the same for all KMW tiles,
// this is the sole scenario and should not be added to any other generic
// `MetricTile___` or KMW component.
InsufficientPermissions.scenario = {
label: 'KeyMetrics/EngagedTrafficSource/InsufficientPermissions',
delay: 250,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,6 @@ ZeroData.args = {
} );
},
};
ZeroData.scenario = {
label: 'KeyMetrics/LeastEngagingPagesWidget/ZeroData',
delay: 250,
};

export const Error = Template.bind( {} );
Error.storyName = 'Error';
Expand All @@ -309,10 +305,6 @@ Error.args = {
] );
},
};
Error.scenario = {
label: 'KeyMetrics/LeastEngagingPagesWidget/Error',
delay: 250,
};

export const InsufficientPermissions = Template.bind( {} );
InsufficientPermissions.storyName = 'Insufficient Permissions';
Expand All @@ -339,11 +331,6 @@ InsufficientPermissions.args = {
},
};

InsufficientPermissions.scenario = {
label: 'KeyMetrics/LeastEngagingPagesWidget/InsufficientPermissions',
delay: 250,
};

export default {
title: 'Key Metrics/LeastEngagingPagesWidget',
decorators: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,6 @@ ZeroData.args = {
} );
},
};
ZeroData.scenario = {
label: 'KeyMetrics/MostEngagingPagesWidget/ZeroData',
delay: 250,
};

export const Error = Template.bind( {} );
Error.storyName = 'Error';
Expand All @@ -327,10 +323,6 @@ Error.args = {
] );
},
};
Error.scenario = {
label: 'KeyMetrics/MostEngagingPagesWidget/Error',
delay: 250,
};

export const InsufficientPermissions = Template.bind( {} );
InsufficientPermissions.storyName = 'Insufficient Permissions';
Expand All @@ -357,11 +349,6 @@ InsufficientPermissions.args = {
},
};

InsufficientPermissions.scenario = {
label: 'KeyMetrics/MostEngagingPagesWidget/InsufficientPermissions',
delay: 250,
};

export default {
title: 'Key Metrics/MostEngagingPagesWidget',
decorators: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,6 @@ ZeroData.args = {
} );
},
};
ZeroData.scenario = {
label: 'KeyMetrics/NewVisitors/ZeroData',
delay: 250,
};

export const Error = Template.bind( {} );
Error.storyName = 'Error';
Expand All @@ -125,10 +121,6 @@ Error.args = {
] );
},
};
Error.scenario = {
label: 'KeyMetrics/NewVisitors/Error',
delay: 250,
};

export const InsufficientPermissions = Template.bind( {} );
InsufficientPermissions.storyName = 'Insufficient Permissions';
Expand All @@ -155,11 +147,6 @@ InsufficientPermissions.args = {
},
};

InsufficientPermissions.scenario = {
label: 'KeyMetrics/NewVisitors/InsufficientPermissions',
delay: 250,
};

export default {
title: 'Key Metrics/NewVisitors',
decorators: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ ZeroData.args = {
} );
},
};
ZeroData.scenario = {
label: 'KeyMetrics/PagesPerVisit/ZeroData',
delay: 250,
};

export const Error = Template.bind( {} );
Error.storyName = 'Error';
Expand All @@ -139,10 +135,6 @@ Error.args = {
] );
},
};
Error.scenario = {
label: 'KeyMetrics/PagesPerVisit/Error',
delay: 250,
};

export const InsufficientPermissions = Template.bind( {} );
InsufficientPermissions.storyName = 'Insufficient Permissions';
Expand All @@ -169,11 +161,6 @@ InsufficientPermissions.args = {
},
};

InsufficientPermissions.scenario = {
label: 'KeyMetrics/PagesPerVisit/InsufficientPermissions',
delay: 250,
};

export default {
title: 'Key Metrics/PagesPerVisit',
decorators: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ ZeroData.args = {
} );
},
};
ZeroData.scenario = {
label: 'KeyMetrics/PopularAuthorsWidget/ZeroData',
};

export const GatheringData = Template.bind( {} );
GatheringData.storyName = 'Gathering Data';
Expand All @@ -122,6 +119,9 @@ GatheringData.args = {
);
},
};
// Since the "Gathering Data" state is the same for all KMW tiles that require
// custom dimensions, this is the sole scenario and should not be added to any
// other generic `MetricTile___` or KMW component.
GatheringData.scenario = {
label: 'KeyMetrics/PopularAuthorsWidget/GatheringData',
};
Expand All @@ -136,6 +136,13 @@ ErrorMissingCustomDimensions.args = {
} );
},
};
// Since the "Error Missing Custom Dimensions" state is the same for all KMW tiles
// that require custom dimensions, this is the sole scenario and should not be
// added to any other generic `MetricTile___` or KMW component.
ErrorMissingCustomDimensions.scenario = {
label: 'KeyMetrics/PopularAuthorsWidget/ErrorMissingCustomDimensions',
delay: 250,
};

export const ErrorCustomDimensionsInsufficientPermissions = Template.bind( {} );
ErrorCustomDimensionsInsufficientPermissions.storyName =
Expand All @@ -158,6 +165,13 @@ ErrorCustomDimensionsInsufficientPermissions.args = {
} );
},
};
// Since the "Error Custom Dimensions Insufficient Permissions" state is the same for
// all KMW tiles that require custom dimensions,, this is the sole scenario and should
// not be added to any other generic `MetricTile___` or KMW component.
ErrorCustomDimensionsInsufficientPermissions.scenario = {
label: 'KeyMetrics/PopularAuthorsWidget/ErrorCustomDimensionsGeneric',
delay: 250,
};

export const ErrorCustomDimensionsGeneric = Template.bind( {} );
ErrorCustomDimensionsGeneric.storyName =
Expand All @@ -180,6 +194,13 @@ ErrorCustomDimensionsGeneric.args = {
} );
},
};
// Since the "Error Custom Dimensions Generic" state is the same for all KMW tiles
// that require custom dimensions, this is the sole scenario and should not be added
// to any other generic `MetricTile___` or KMW component.
ErrorCustomDimensionsGeneric.scenario = {
label: 'KeyMetrics/PopularAuthorsWidget/ErrorCustomDimensionsGeneric',
delay: 250,
};

export default {
title: 'Key Metrics/PopularAuthorsWidget',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ ZeroData.args = {
} );
},
};
ZeroData.scenario = {
label: 'KeyMetrics/PopularContentWidget/ZeroData',
delay: 250,
};

export const Error = Template.bind( {} );
Error.storyName = 'Error';
Expand All @@ -186,10 +182,6 @@ Error.args = {
] );
},
};
Error.scenario = {
label: 'KeyMetrics/PopularContent/Error',
delay: 250,
};

export const InsufficientPermissions = Template.bind( {} );
InsufficientPermissions.storyName = 'Insufficient Permissions';
Expand All @@ -216,11 +208,6 @@ InsufficientPermissions.args = {
},
};

InsufficientPermissions.scenario = {
label: 'KeyMetrics/PopularContent/InsufficientPermissions',
delay: 250,
};

export default {
title: 'Key Metrics/PopularContentWidget',
decorators: [
Expand Down
Loading
Loading