Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit106c383

Browse files
feat: add Storybook stories for View Source button
Adds two new stories to test the View Source button functionality:- WithViewSourceButton: Shows the button for template administrators- WithoutViewSourceButton: Hides the button for regular usersThese stories exercise the canUpdateTemplate prop and demonstratethe conditional rendering of the View Source button.Co-authored-by: matifali <10648092+matifali@users.noreply.github.com>
1 parenta1bb34d commit106c383

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

‎site/src/pages/CreateWorkspacePage/CreateWorkspacePageView.stories.tsx‎

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,43 @@ export const ExternalAuthAllConnected: Story = {
382382
],
383383
},
384384
};
385+
386+
exportconstWithViewSourceButton:Story={
387+
args:{
388+
canUpdateTemplate:true,
389+
versionId:"template-version-123",
390+
template:{
391+
...MockTemplate,
392+
organization_name:"default",
393+
name:"docker-template",
394+
},
395+
},
396+
parameters:{
397+
docs:{
398+
description:{
399+
story:
400+
"This story shows the View Source button that appears for template administrators. The button allows quick navigation to the template editor from the workspace creation page.",
401+
},
402+
},
403+
},
404+
};
405+
406+
exportconstWithoutViewSourceButton:Story={
407+
args:{
408+
canUpdateTemplate:false,
409+
versionId:"template-version-123",
410+
template:{
411+
...MockTemplate,
412+
organization_name:"default",
413+
name:"docker-template",
414+
},
415+
},
416+
parameters:{
417+
docs:{
418+
description:{
419+
story:
420+
"This story shows the workspace creation page for users without template update permissions. The View Source button is hidden for these users.",
421+
},
422+
},
423+
},
424+
};

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp