-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e551887
commit b89429b
Showing
5 changed files
with
58 additions
and
6 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
24 changes: 24 additions & 0 deletions
24
ontrack-web-core/components/core/model/properties/PropertyEditButton.js
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,24 @@ | ||
import InlineCommand from "@components/common/InlineCommand"; | ||
import {FaPencilAlt} from "react-icons/fa"; | ||
import PropertyDialog, {usePropertyDialog} from "@components/core/model/properties/PropertyDialog"; | ||
|
||
export default function PropertyEditButton({entityType, entityId, property}) { | ||
|
||
const dialog = usePropertyDialog({}) | ||
|
||
const startDialog = () => { | ||
const propertyList = [property] | ||
dialog.start({entityType, entityId, propertyList, initialProperty: property}) | ||
} | ||
|
||
return ( | ||
<> | ||
<InlineCommand | ||
icon={<FaPencilAlt/>} | ||
title="Edit this property" | ||
onClick={startDialog} | ||
/> | ||
<PropertyDialog dialog={dialog}/> | ||
</> | ||
) | ||
} |
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
19 changes: 19 additions & 0 deletions
19
ontrack-web-core/components/framework/properties/PropertyTitle.js
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,19 @@ | ||
import {Space, Typography} from "antd"; | ||
import PropertyEditButton from "@components/core/model/properties/PropertyEditButton"; | ||
|
||
export default function PropertyTitle({entityType, entityId, property}) { | ||
return ( | ||
<> | ||
<Space> | ||
<Typography.Text>{property.type.name}</Typography.Text> | ||
{ | ||
property.editable && <PropertyEditButton | ||
entityType={entityType} | ||
entityId={entityId} | ||
property={property} | ||
/> | ||
} | ||
</Space> | ||
</> | ||
) | ||
} |