Skip to content

Commit 3431b19

Browse files
Fix geosolutions-it#10954 Update the style of the square buttons and add border radius in all buttons, inputs, selectors (geosolutions-it#11425)
--------- Co-authored-by: allyoucanmap <stefano.bovio@geosolutionsgroup.com>
1 parent 5a7953b commit 3431b19

181 files changed

Lines changed: 628 additions & 490 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/developer-guide/mapstore-migration-guide.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ As part of improving the authentication rules to make dynamic request configurat
7979
| `header` | `headers: { ... }` |
8080
| `browserWithCredentials` | `withCredentials: true` |
8181

82+
### Replace square-button-md and square-button-sm with square-button class
83+
84+
The CSS classes `square-button-md` and `square-button-sm` have been deprecated and replaced by the unified `square-button` class. Update your custom components and themes to use the new class name.
85+
86+
```diff
87+
- <Button className="square-button-md">Action</Button>
88+
- <Button className="square-button-sm">Action</Button>
89+
+ <Button className="square-button">Action</Button>
90+
```
91+
8292
### Replace filterAllowedCRS and additionalCRS with availableProjections
8393

8494
As part of extending the functionalities of the CRS selector, we have deprecated the use of `filterAllowedCRS` and `additionalCRS` in favor of new configuration `availableProjections`. The new configuration provides the support to add both filterAllowedCRS and additionalCRS in a single configuration. The configuration in `localConfig.json` should be updated as follow:

web/client/components/I18N/LangBar.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class LangBar extends React.Component {
4242
pullRight
4343
noCaret
4444
id={this.props.id}
45-
className="square-button-md _border-transparent"
45+
className="square-button _border-transparent"
4646
title={
4747
<FlagButton
4848
componentAsButton={false}

web/client/components/TOC/TOCItemsSettings.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const TOCItemSettings = (props) => {
9191
{ToolbarComponent ?
9292
<ToolbarComponent buttons={toolbarButtons}/>
9393
: <Toolbar
94-
btnDefaultProps={{ bsStyle: 'primary', className: 'square-button-md' }}
94+
btnDefaultProps={{ bsStyle: 'primary', className: 'square-button' }}
9595
buttons={toolbarButtons}/>}
9696
</Col>
9797
</Row>,

web/client/components/TOC/fragments/LayerFields/Fields.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const Fields = ({fields = [], onLoadFields = () => {}, onChange = () => {}, onCl
4040
className="layer-fields"
4141
header={<div key="row-header" className="layer-fields-header">
4242
<div key="row-toolbar" className="layer-fields-toolbar">
43-
<Toolbar key="toolbar" btnDefaultProps={{ className: 'square-button-md', bsStyle: 'primary', disabled: loading }}
43+
<Toolbar key="toolbar" btnDefaultProps={{ className: 'square-button', bsStyle: 'primary', disabled: loading }}
4444
buttons={[{
4545
glyph: 'refresh',
4646
disabled: loading,
@@ -53,7 +53,7 @@ const Fields = ({fields = [], onLoadFields = () => {}, onChange = () => {}, onCl
5353
disabled={loading}
5454
bsStyle="primary"
5555
confirmContent={<Message msgId="layerProperties.fields.clearCustomizationConfirm"/>}
56-
className="square-button-md"
56+
className="square-button"
5757
onClick={() => onClear()}>
5858
<Glyphicon
5959
glyph="clear-brush" />

web/client/components/TOC/fragments/settings/Display.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export default class extends React.Component {
174174
<Button
175175
disabled={!!this.state.formatLoading}
176176
tooltipId="layerProperties.format.refresh"
177-
className="square-button-md no-border format-refresh"
177+
className="square-button no-border format-refresh"
178178
onClick={() => {this.onFormatOptionsFetch(this.props.element?.url);}}
179179
key="format-refresh">
180180
<Glyphicon glyph="refresh" />

web/client/components/TOC/fragments/settings/VisibilityLimitsForm.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ function VisibilityLimitsForm({
260260
<div style={{ flex: 1 }}>{title}</div>
261261
<Toolbar
262262
btnDefaultProps={{
263-
className: 'square-button-md no-border'
263+
className: 'square-button no-border'
264264
}}
265265
buttons={[
266266
{

web/client/components/TOC/fragments/settings/WMSCacheOptions.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ function WMSCacheOptions({
303303
? 'layerProperties.updateTileGrids'
304304
: 'layerProperties.checkAvailableTileGridsInfo'
305305
}
306-
className="square-button-md no-border format-refresh"
306+
className="square-button no-border format-refresh"
307307
onClick={() => {
308308
onTileMatrixSetsFetch({ ...layer, force: true }).then((value) => handleOnChange(value, layer.tileGridStrategy !== 'custom'));
309309
}}
@@ -319,7 +319,7 @@ function WMSCacheOptions({
319319
active={layer.tileGridStrategy === 'custom'}
320320
glyph={layer.tileGridStrategy === 'custom' ? 'grid-custom' : 'grid-regular'}
321321
bsStyle={layer.tileGridStrategy === 'custom' ? 'success' : 'primary'}
322-
className="square-button-md"
322+
className="square-button"
323323
onClick={() => {
324324
const newTileGridStrategy = layer.tileGridStrategy !== 'custom'
325325
? 'custom'

web/client/components/TOC/fragments/settings/__tests__/ThematicLayer-test.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ describe('test ThematicLayer module component', () => {
228228
expect(domNode).toExist();
229229
expect(document.getElementsByClassName('thematic_layer').length).toBe(1);
230230
expect(document.getElementsByClassName('thematic_layer')[0].childNodes.length).toBe(1);
231-
expect(domNode.getElementsByClassName('mapstore-switch-panel')[0].querySelector('button.square-button-sm')).toExist();
231+
expect(domNode.getElementsByClassName('mapstore-switch-panel')[0].querySelector('button.square-button')).toExist();
232232
});
233233

234234
it('tests ThematicLayer component with configured thematic thema style admin buttons for no admin', () => {
@@ -238,7 +238,7 @@ describe('test ThematicLayer module component', () => {
238238
expect(domNode).toExist();
239239
expect(document.getElementsByClassName('thematic_layer').length).toBe(1);
240240
expect(document.getElementsByClassName('thematic_layer')[0].childNodes.length).toBe(1);
241-
expect(domNode.getElementsByClassName('mapstore-switch-panel')[0].querySelector('button.square-button-sm')).toNotExist();
241+
expect(domNode.getElementsByClassName('mapstore-switch-panel')[0].querySelector('button.square-button')).toNotExist();
242242
});
243243

244244
it('tests ThematicLayer component with configured thematic thema style toggle configuration', () => {
@@ -254,7 +254,7 @@ describe('test ThematicLayer module component', () => {
254254
expect(domNode).toExist();
255255
expect(document.getElementsByClassName('thematic_layer').length).toBe(1);
256256
expect(document.getElementsByClassName('thematic_layer')[0].childNodes.length).toBe(1);
257-
const cfgButton = domNode.getElementsByClassName('mapstore-switch-panel')[0].querySelector('button.square-button-sm');
257+
const cfgButton = domNode.getElementsByClassName('mapstore-switch-panel')[0].querySelector('button.square-button');
258258
TestUtils.Simulate.click(cfgButton);
259259
expect(spyConfigurationChange.calls.length).toBe(2);
260260
});

web/client/components/TOC/fragments/settings/__tests__/VisibilityLimitsForm-test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ describe('VisibilityLimitsForm', () => {
9393
/>, document.getElementById('container'));
9494
});
9595
expect(document.querySelector('.ms-visibility-limits-form')).toBeTruthy();
96-
const buttons = document.querySelectorAll('.square-button-md');
96+
const buttons = document.querySelectorAll('.square-button');
9797
expect(buttons.length).toBe(1);
9898
});
9999

web/client/components/TOC/fragments/template/MetadataTemplate.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class MetadataTemplate extends React.Component {
4949
{content}
5050
<Button
5151
style={{margin: '4px 0 0 4px'}}
52-
className="square-button-md no-border"
52+
className="square-button no-border"
5353
onClick={() => collapsePanel(id, !this.state.collapsed[id])}>
5454
<Glyphicon glyph={this.state.collapsed[id] ? 'plus' : 'minus'}/>
5555
</Button>

0 commit comments

Comments
 (0)