-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Jetpack: add UsagePanel story (#33771)
* register Jetpack plugin ./extensions folder * Add UsagePanel story * changelog
- Loading branch information
Showing
5 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/js-packages/storybook/changelog/update-jetpack-add-usage-panel-story
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/update-jetpack-add-usage-panel-story
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: enhancement | ||
|
||
Jetpack: add UsagePanel story |
59 changes: 59 additions & 0 deletions
59
...k/extensions/plugins/ai-assistant-plugin/components/usage-panel/stories/index.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |