-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Pill component disabled state * Extracted tag delete button into separate component with disabled state * Tags abilities migration * Tag policy * Tags controller protected with policy * DisabledGuard tooltip wrapping as props * Frontend tag component supports abilities * ClusterList with tag abilities * DatabaseOverview tags with abilities * HostsList with tags with abilities * SapSytemOverview tags with abilities * Tests refactor * Addressing review feedbacks
- Loading branch information
Showing
26 changed files
with
527 additions
and
81 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,46 @@ | ||
import React from 'react'; | ||
|
||
import Tags from '.'; | ||
|
||
export default { | ||
title: 'Components/Tags', | ||
component: Tags, | ||
argTypes: { onChange: { action: 'tag changed' } }, | ||
args: { | ||
tags: ['carbonara', 'Amatriciana'], | ||
userAbilities: [{ name: 'all', resource: 'all' }], | ||
tagAdditionPermittedFor: ['all:all'], | ||
tagDeletionPermittedFor: ['all:all'], | ||
}, | ||
argTypes: { | ||
onChange: { action: 'tag changed' }, | ||
tagAdditionPermittedFor: { | ||
control: 'array', | ||
description: 'Abilities that allow tag creation', | ||
}, | ||
tagDeletionPermittedFor: { | ||
control: 'array', | ||
description: 'Abilities that allow tag deletion', | ||
}, | ||
}, | ||
}; | ||
|
||
export function Populated(args) { | ||
return <Tags tags={['carbonara', 'Amatriciana']} {...args} />; | ||
} | ||
export const Default = { | ||
args: { | ||
tags: ['carbonara', 'Amatriciana'], | ||
userAbilities: [{ name: 'all', resource: 'all' }], | ||
tagAdditionPermittedFor: ['all:all'], | ||
tagDeletionPermittedFor: ['all:all'], | ||
}, | ||
}; | ||
|
||
export function Empty(args) { | ||
return <Tags tags={[]} {...args} />; | ||
} | ||
export const Empty = { | ||
args: { | ||
...Default.args, | ||
tags: [], | ||
}, | ||
}; | ||
|
||
export const Disabled = { | ||
args: { | ||
...Default.args, | ||
userAbilities: [], | ||
}, | ||
}; |
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
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
Oops, something went wrong.