Skip to content

Commit 000ac30

Browse files
committed
Use caret instead of plus/minus icon
Also remove the border of button which don't need a user feedback on click, like for example the caret, checkbox and cog icon, as they are animated then don't require any feedback.
1 parent e4f478d commit 000ac30

File tree

8 files changed

+33
-37
lines changed

8 files changed

+33
-37
lines changed

src/modules/menu/components/LayerCatalogueItem.vue

+4-5
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ function containsLayer(layers, searchText) {
228228
>
229229
<button
230230
v-if="canBeAddedToTheMap"
231-
class="btn"
231+
class="btn border-0"
232232
:class="{
233233
'text-primary': isPresentInActiveLayers,
234234
'btn-lg': !compact,
@@ -242,21 +242,20 @@ function containsLayer(layers, searchText) {
242242
</button>
243243
<button
244244
v-if="hasChildren"
245-
class="btn btn-rounded"
245+
class="btn border-0"
246246
:class="{
247247
'text-primary': isPresentInActiveLayers,
248248
'btn-lg': !compact,
249249
}"
250250
:data-cy="`catalogue-collapse-layer-button-${item.id}`"
251251
@click.stop="onCollapseClick"
252252
>
253-
<!-- TODO change to the regular icons once we have bought fontawesome fonts -->
254-
<FontAwesomeIcon :icon="['fas', showChildren ? 'circle-minus' : 'circle-plus']" />
253+
<FontAwesomeIcon :icon="['fas', showChildren ? 'caret-down' : 'caret-right']" />
255254
</button>
256255
257256
<TextTruncate
258257
:text="item.name"
259-
class="menu-catalogue-item-name"
258+
class="menu-catalogue-item-name px-1"
260259
:class="{ 'text-primary': isPresentInActiveLayers }"
261260
:data-cy="`catalogue-tree-item-name-${item.id}`"
262261
:tippy-options="{ placement: isPhoneMode ? 'top' : 'right' }"

src/modules/menu/components/activeLayers/MenuActiveLayersListItem.vue

+5-5
Original file line numberDiff line numberDiff line change
@@ -118,23 +118,23 @@ function duplicateLayer() {
118118
>
119119
<div class="menu-layer-item-title">
120120
<button
121-
class="btn d-flex align-items-center"
121+
class="btn border-0 d-flex align-items-center"
122122
:class="{ 'btn-lg': !compact }"
123123
:data-cy="`button-remove-layer-${id}-${index}`"
124124
@click="onRemoveLayer"
125125
>
126126
<FontAwesomeIcon icon="times-circle" />
127127
</button>
128128
<button
129-
class="btn d-flex align-items-center"
129+
class="btn border-0 d-flex align-items-center"
130130
:class="{ 'btn-lg': !compact }"
131131
:data-cy="`button-toggle-visibility-layer-${id}-${index}`"
132132
@click="onToggleLayerVisibility"
133133
>
134134
<FontAwesomeIcon :icon="`far fa-${layer.visible ? 'check-' : ''}square`" />
135135
</button>
136136
<TextTruncate
137-
class="menu-layer-item-name"
137+
class="menu-layer-item-name p-1"
138138
:class="{ 'text-body-tertiary fst-italic': showSpinner }"
139139
:data-cy="`active-layer-name-${id}-${index}`"
140140
:tippy-options="{ placement: isPhoneMode ? 'top' : 'right' }"
@@ -143,7 +143,7 @@ function duplicateLayer() {
143143
>
144144
<button
145145
v-if="showSpinner"
146-
class="loading-button btn"
146+
class="loading-button btn border-0"
147147
:class="{
148148
'btn-lg': !compact,
149149
}"
@@ -178,7 +178,7 @@ function duplicateLayer() {
178178
/>
179179
</ThirdPartDisclaimer>
180180
<button
181-
class="btn"
181+
class="btn border-0"
182182
:class="{
183183
'btn-lg': !compact,
184184
'flip text-primary': showLayerDetail,

src/modules/menu/components/activeLayers/MenuActiveLayersListItemTimeSelector.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function hidePopover() {
100100
<button
101101
v-if="hasMultipleTimestamps"
102102
ref="timeSelectorButton"
103-
class="btn btn-secondary"
103+
class="btn btn-secondary me-2"
104104
:class="{
105105
'btn-sm': compact,
106106
}"

src/modules/menu/components/advancedTools/MenuAdvancedToolsListItem.vue

+3-8
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ onUnmounted(() => {
6262
@click="emit('toggleMenu')"
6363
>
6464
<FontAwesomeIcon
65-
class="dropdown-icon me-2"
66-
:class="{ invisible: !dropdownMenu }"
65+
class="btn border-0 px-2"
66+
:class="{ invisible: !dropdownMenu, 'text-primary': isSelected }"
6767
:icon="`caret-${isSelected ? 'down' : 'right'}`"
6868
/>
69-
<span ref="tippyTooltip" class="pe-1">{{ i18n.t(title) }} </span>
69+
<span ref="tippyTooltip" class="px-1">{{ i18n.t(title) }} </span>
7070
</a>
7171
<slot />
7272
</div>
@@ -76,11 +76,6 @@ onUnmounted(() => {
7676
@import 'src/scss/webmapviewer-bootstrap-theme';
7777
@import 'src/modules/menu/scss/menu-items';
7878
.advanced-tools-item {
79-
.dropdown-icon {
80-
// The min-width here is to avoid size changes when toggling the dropdown, the caret-down
81-
// icon is wider than the caret right
82-
min-width: 8.5px;
83-
}
8479
.advanced-tools-title {
8580
// Here we add the menu-item styling to the title only to avoid hover
8681
// on the content once the item has been opened

src/modules/menu/components/menu/MenuSection.vue

+7-8
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,12 @@
1616
data-toggle="collapse"
1717
@click="toggleShowBody"
1818
>
19-
<span class="menu-section-title">
20-
<button class="btn menu-section-title-icon" type="button" :disabled="disabled">
19+
<span class="menu-section-title d-flex align-items-center">
20+
<button
21+
class="btn border-0 menu-section-title-icon"
22+
type="button"
23+
:disabled="disabled"
24+
>
2125
<font-awesome-icon :icon="['fas', titleCaretIcon]" />
2226
</button>
2327
<span class="ms-2 menu-section-title-text">{{ title }}</span>
@@ -132,7 +136,7 @@ $section-border: 1px;
132136
display: flex;
133137
flex: none;
134138
overflow: visible;
135-
padding: 0.5rem 1rem;
139+
padding: 0.5rem 0.6rem;
136140
line-height: 1.5;
137141
border-top: $section-border solid $gray-400;
138142
background-color: $light;
@@ -177,11 +181,6 @@ $section-border: 1px;
177181
}
178182
}
179183
180-
.menu-section-title-icon {
181-
&:disabled {
182-
border-color: transparent;
183-
}
184-
}
185184
.menu-section-body {
186185
background-color: $white;
187186
overflow: auto;

src/modules/menu/components/share/MenuShareEmbed.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
data-cy="menu-share-embed-button"
77
@click="toggleEmbedSharing"
88
>
9-
<FontAwesomeIcon :icon="`caret-${showEmbedSharing ? 'down' : 'right'}`" />
10-
<span class="ms-2">{{ $t('share_more') }}</span>
9+
<FontAwesomeIcon
10+
class="btn border-0 px-2"
11+
:class="{ 'text-primary': showEmbedSharing }"
12+
:icon="`caret-${showEmbedSharing ? 'down' : 'right'}`"
13+
/>
14+
<span class="px-1">{{ $t('share_more') }}</span>
1115
</a>
1216
<CollapseTransition :duration="200">
1317
<div v-show="showEmbedSharing" class="p-2 ps-4 card border-light">

src/modules/menu/scss/menu-items.scss

+4-5
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@
1616
.menu-title {
1717
display: flex;
1818
align-items: center;
19-
justify-content: space-between;
20-
gap: 0.5rem;
21-
22-
padding: 0 0.8rem;
19+
padding-left: 8px;
20+
padding-right: 8px;
2321
height: 2.5rem;
2422

2523
.compact & {
2624
height: 2.2rem;
2725
}
2826

2927
& > button {
30-
padding: 0;
28+
padding-left: 6px;
29+
padding-right: 6px;
3130
}
3231
}
3332

tests/cypress/tests-e2e/importToolMaps.cy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@ describe('The Import Maps Tool', () => {
108108
cy.get(`[data-cy="catalogue-collapse-layer-button-${itemFullId}"]`)
109109
.should('be.visible')
110110
.find('svg')
111-
.should('have.class', 'fa-circle-plus')
111+
.should('have.class', 'fa-caret-right')
112112
cy.get(`[data-cy="catalogue-collapse-layer-button-${itemFullId}"]`)
113113
.should('be.visible')
114114
.click()
115115
cy.get(`[data-cy="catalogue-collapse-layer-button-${itemFullId}"]`)
116116
.should('be.visible')
117117
.find('svg')
118-
.should('have.class', 'fa-circle-minus')
118+
.should('have.class', 'fa-caret-down')
119119
cy.get(`[data-cy="catalogue-tree-item-${firstSubItemId}"]`).contains(firstSubItemName)
120120
cy.get(`[data-cy="catalogue-collapse-layer-button-${itemFullId}"]`)
121121
.should('be.visible')
122122
.click()
123123
cy.get(`[data-cy="catalogue-collapse-layer-button-${itemFullId}"]`)
124124
.should('be.visible')
125125
.find('svg')
126-
.should('have.class', 'fa-circle-plus')
126+
.should('have.class', 'fa-caret-right')
127127
cy.get(`[data-cy="catalogue-tree-item-${firstSubItemId}"]`).should('not.be.visible')
128128
cy.get(`[data-cy="catalogue-collapse-layer-button-${itemFullId}"]`)
129129
.should('be.visible')

0 commit comments

Comments
 (0)