-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow adding permisisons and identites when creatign a group. Simplif…
…y group editing (#887)
- Loading branch information
Showing
26 changed files
with
1,113 additions
and
755 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { Button, Icon } from "@canonical/react-components"; | ||
import { FC } from "react"; | ||
import { pluralize } from "util/instanceBulkActions"; | ||
|
||
interface Props { | ||
count: number; | ||
entity: string; | ||
icon: string; | ||
isEditing: boolean; | ||
isModified: boolean; | ||
onClick: (entity: string) => void; | ||
} | ||
|
||
const PanelFormLink: FC<Props> = ({ | ||
count, | ||
entity, | ||
icon, | ||
isEditing, | ||
isModified, | ||
onClick, | ||
}) => { | ||
return ( | ||
<Button | ||
appearance="base" | ||
className="panel-form-link" | ||
onClick={() => onClick(entity)} | ||
type="button" | ||
> | ||
<span className="panel-form-link__column"> | ||
<Icon name={icon} className="panel-form-link__icon" /> | ||
<span className="panel-form-link__title"> | ||
{isEditing ? "Edit " : "Add "} {pluralize(entity, 2)} | ||
</span> | ||
</span> | ||
<span className="panel-form-link__column u-align--right"> | ||
{isModified && <Icon name="status-in-progress-small" />} | ||
<span className="panel-form-link__count u-text--muted"> | ||
{count === 0 | ||
? `No ${pluralize(entity, 2)}` | ||
: `${count} ${pluralize(entity, count)}`} | ||
</span> | ||
<Icon name="chevron-right" /> | ||
</span> | ||
</Button> | ||
); | ||
}; | ||
|
||
export default PanelFormLink; |
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.