forked from geosolutions-it/geonode-mapstore-client
-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Title field with help interactive icon
- Loading branch information
Showing
6 changed files
with
107 additions
and
2 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
32 changes: 32 additions & 0 deletions
32
...lient/client/js/plugins/MetadataEditor/components/_templates/DescriptionFieldTemplate.jsx
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,32 @@ | ||
/* | ||
* Copyright 2024, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from "react"; | ||
import isEmpty from "lodash/isEmpty"; | ||
|
||
import FaIcon from "@js/components/FaIcon/FaIcon"; | ||
import tooltip from "@mapstore/framework/components/misc/enhancers/tooltip"; | ||
|
||
const IconWithTooltip = tooltip((props) => <div {...props}><FaIcon name="info-circle" /></div>); | ||
|
||
const DescriptionFieldTemplate = (props) => { | ||
const { description, id } = props; | ||
if (isEmpty(description)) { | ||
return null; | ||
} | ||
return ( | ||
<IconWithTooltip | ||
className="gn-metadata-form-description" | ||
id={id} | ||
tooltip={description} | ||
tooltipPosition={"right"} | ||
/> | ||
); | ||
}; | ||
|
||
export default DescriptionFieldTemplate; |
21 changes: 21 additions & 0 deletions
21
...tore_client/client/js/plugins/MetadataEditor/components/_templates/TitleFieldTemplate.jsx
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,21 @@ | ||
/* | ||
* Copyright 2024, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
const TitleFieldTemplate = (props) => { | ||
const { id, required, title } = props; | ||
return ( | ||
<div className="gn-metadata-form-title" id={id}> | ||
{title} | ||
{required && <mark>*</mark>} | ||
</div> | ||
); | ||
}; | ||
|
||
export default TitleFieldTemplate; |
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