Skip to content

Commit

Permalink
Jetpack: add UsagePanel story (#33771)
Browse files Browse the repository at this point in the history
* register Jetpack plugin ./extensions folder

* Add UsagePanel story

* changelog
  • Loading branch information
retrofox authored Oct 25, 2023
1 parent 94d4cc9 commit 31dd176
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Storybook: register ./extensions folder of the Jetpack plugin project
1 change: 1 addition & 0 deletions projects/js-packages/storybook/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"packages/search",
"plugins/protect",
"plugins/boost",
"plugins/jetpack",
"packages/videopress"
]
},
Expand Down
1 change: 1 addition & 0 deletions projects/js-packages/storybook/storybook/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const projects = [
'../../../packages/my-jetpack/_inc/components',
'../../../packages/search/src/dashboard/components',
'../../../plugins/protect/src/js/components',
'../../../plugins/jetpack/extensions/',
'../../../plugins/boost/app/assets/src',
'../../../packages/videopress/src/client/admin/components',
'../../../packages/videopress/src/client/components',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: enhancement

Jetpack: add UsagePanel story
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* External Dependencies
*/
import React from 'react';
/*
* Internal Dependencies
*/
import UsagePanel from '..';

export default {
title: 'Plugins/Jetpack/Extensions/UsagePanel',
component: UsagePanel,
parameters: {
docs: {
autodocs: false,
},
},
};

const DefaultTemplate = () => {
const props = {};

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

export const aiAssistantFeatureUnsupported = DefaultTemplate.bind( {} );
aiAssistantFeatureUnsupported.parameters = {
mockData: [
{
url: 'wpcom/v2/jetpack-ai/ai-assistant-feature?_locale=user',
method: 'GET',
status: 200,
response: {
'has-feature': false,
'requests-count': 11,
'requests-limit': 20,
},
},
],
};
aiAssistantFeatureUnsupported.storyName = 'AI Assistant feature unsupported';

export const aiAssisstantFeatureSupported = DefaultTemplate.bind( {} );
aiAssisstantFeatureSupported.parameters = {
mockData: [
{
url: 'wpcom/v2/jetpack-ai/ai-assistant-feature?_locale=user',
method: 'GET',
status: 200,
response: {
'has-feature': true,
'requests-count': 120,
'requests-limit': 20,
},
},
],
};

aiAssisstantFeatureSupported.storyName = 'AI Assistant feature supported';

0 comments on commit 31dd176

Please sign in to comment.