[Maps] fix edit layer settings action showing when readonly (#109321)

* [Maps] fix edit layer settings action showing when readonly

* remove unneeded file

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Nathan Reese 2021-08-20 06:10:14 -06:00 committed by GitHub
parent ca6bb4b6d1
commit c635216a6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 22 deletions

View file

@ -535,17 +535,6 @@ exports[`TOCEntryActionsPopover should not show edit actions in read only mode 1
"onClick": [Function],
"toolTipContent": null,
},
Object {
"data-test-subj": "layerSettingsButton",
"disabled": false,
"icon": <EuiIcon
size="m"
type="pencil"
/>,
"name": "Edit layer settings",
"onClick": [Function],
"toolTipContent": null,
},
],
"title": "Layer actions",
},

View file

@ -174,19 +174,19 @@ export class TOCEntryActionsPopover extends Component<Props, State> {
},
});
}
actionItems.push({
disabled: this.props.isEditButtonDisabled,
name: EDIT_LAYER_SETTINGS_LABEL,
icon: <EuiIcon type="pencil" size="m" />,
'data-test-subj': 'layerSettingsButton',
toolTipContent: null,
onClick: () => {
this._closePopover();
this.props.openLayerSettings();
},
});
if (!this.props.isReadOnly) {
actionItems.push({
disabled: this.props.isEditButtonDisabled,
name: EDIT_LAYER_SETTINGS_LABEL,
icon: <EuiIcon type="pencil" size="m" />,
'data-test-subj': 'layerSettingsButton',
toolTipContent: null,
onClick: () => {
this._closePopover();
this.props.openLayerSettings();
},
});
if (this.state.supportsFeatureEditing) {
actionItems.push({
name: EDIT_FEATURES_LABEL,