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.
Fix #1847 Implement the client UI for the Resource management settings (
#1848) * Fix #1847 Implement the client UI for the Resource management settings * review labels * review labels translations * fix casing
- Loading branch information
1 parent
ccf6811
commit c25cfaa
Showing
28 changed files
with
287 additions
and
50 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
32 changes: 32 additions & 0 deletions
32
geonode_mapstore_client/client/js/components/DetailsPanel/DetailsManagement.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 @@ | ||
import React from 'react'; | ||
import { Checkbox } from 'react-bootstrap'; | ||
import Message from '@mapstore/framework/components/I18N/Message'; | ||
import { RESOURCE_MANAGEMENT_PROPERTIES } from '@js/utils/ResourceUtils'; | ||
|
||
function DetailsManagement({ resource, onChange }) { | ||
const perms = resource?.perms || []; | ||
return ( | ||
<div className="gn-details-management"> | ||
<div className="gn-details-info-fields"> | ||
<Message msgId={"gnviewer.resourceManagement"} /> | ||
{Object.keys(RESOURCE_MANAGEMENT_PROPERTIES).map((key) => { | ||
const { labelId, disabled } = RESOURCE_MANAGEMENT_PROPERTIES[key]; | ||
return ( | ||
<div key={key} className="gn-details-info-row gn-details-flex-field"> | ||
<Checkbox | ||
style={{ margin: 0 }} | ||
disabled={disabled(perms)} | ||
checked={!!resource?.[key]} | ||
onChange={(event) => onChange({ [key]: !!event.target.checked })} | ||
> | ||
<Message msgId={labelId} /> | ||
</Checkbox> | ||
</div> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default DetailsManagement; |
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
25 changes: 25 additions & 0 deletions
25
geonode_mapstore_client/client/js/plugins/detailviewer/tabComponents.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,25 @@ | ||
/* | ||
* 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 { connect } from 'react-redux'; | ||
import DetailsLocations from '@js/components/DetailsPanel/DetailsLocations'; | ||
import DetailsAssets from '@js/components/DetailsPanel/DetailsAssets'; | ||
import DetailsAttributeTable from '@js/components/DetailsPanel/DetailsAttributeTable'; | ||
import DetailsLinkedResources from '@js/components/DetailsPanel/DetailsLinkedResources'; | ||
import DetailsManagement from '@js/components/DetailsPanel/DetailsManagement'; | ||
import { updateResourceProperties } from '@js/actions/gnresource'; | ||
|
||
const tabComponents = { | ||
'attribute-table': DetailsAttributeTable, | ||
'linked-resources': DetailsLinkedResources, | ||
'locations': DetailsLocations, | ||
'assets': DetailsAssets, | ||
'management': connect(() => ({}), { onChange: updateResourceProperties })(DetailsManagement) | ||
}; | ||
|
||
export default tabComponents; |
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
Oops, something went wrong.