Skip to content

Commit

Permalink
Merge pull request #1294 from swissgeol/GSNGM-1160_update_scroll
Browse files Browse the repository at this point in the history
Update scroll for geometries panel
  • Loading branch information
vladyslav-tk authored Jun 7, 2024
2 parents bc05c6d + ba7c76b commit cefc0cd
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 37 deletions.
8 changes: 4 additions & 4 deletions ui/cypress/e2e/toolbox.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ describe('Toolbox', () => {
cy.get('.ngm-slice-types > div:nth-child(2) .ngm-slice-side > div:first-child').click();
cy.get('.ngm-slice-types > div:nth-child(2) .ngm-slice-side > div:first-child').should('have.class', 'active');
cy.get('.ngm-slice-types > div:nth-child(2) .ngm-slice-to-draw button').click();
cy.get('ngm-slicer .ngm-geom-list .ngm-action-list-item:first-child').click();
cy.get('ngm-slicer .ngm-geom-list .ngm-action-list-item:first-child > .ngm-action-list-item-header > div:first-child').should('have.class', 'active');
cy.get('ngm-slicer .ngm-geom-filter').click();
cy.get('ngm-slicer .ngm-geom-filter > .ngm-action-list-item-header > div:first-child').should('have.class', 'active');
cy.get('.ngm-slice-types > div:first-child').click();
cy.get('.ngm-slice-types > div:first-child').click();
cy.get('.cesium-widget > canvas').click(450, 280);
Expand All @@ -66,7 +66,7 @@ describe('Toolbox', () => {
cy.get('.ngm-geom-edit-actions > button:first-child').click();
cy.get('.ngm-back-icon').click();
cy.get('.ngm-gst-icon').click();
cy.get('ngm-gst-interaction .ngm-geom-list .ngm-point-draw-icon').click();
cy.get('ngm-gst-interaction .ngm-geom-filter .ngm-point-draw-icon').click();
testGstOutput();
});

Expand All @@ -79,7 +79,7 @@ describe('Toolbox', () => {
cy.get('.cesium-widget > canvas').dblclick(450, 200);
cy.get('.ngm-back-icon').click();
cy.get('.ngm-gst-icon').click();
cy.get('ngm-gst-interaction .ngm-geom-list .ngm-line-draw-icon').click();
cy.get('ngm-gst-interaction .ngm-geom-filter .ngm-line-draw-icon').click();
testGstOutput();
});
});
5 changes: 2 additions & 3 deletions ui/src/style/ngm-side-bar.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ngm-auth:hover {

.ngm-side-bar-panel {
width: 250px;
height: 100%;
height: calc(100vh - var(--ngm-header-height));
max-width: 1028px;
background-color: #F1F3F5;
box-shadow: 4px 0 4px #00000029;
Expand All @@ -96,7 +96,7 @@ ngm-auth:hover {
}

.ngm-panel-header {
height: 34px;
height: var(--ngm-panel-header-height);
border-bottom: 2px solid #DFE2E6;
display: flex;
align-items: center;
Expand Down Expand Up @@ -124,7 +124,6 @@ ngm-auth:hover {
display: flex;
flex-direction: column;
margin-top: 9px;
max-height: calc(100% - 124px);
overflow-y: auto;
overflow-x: hidden;
padding-bottom: 40px;
Expand Down
24 changes: 21 additions & 3 deletions ui/src/style/ngm-toolbox.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
ngm-tools {
height: 100%;
}

ngm-draw-tool,
ngm-slicer,
ngm-gst-interaction,
ngm-measure,
data-download {
height: calc(100vh - 142px);
display: block;
height: calc(100% - (var(--ngm-panel-header-height) + 10px));
display: flex;
flex-direction: column;
}

ngm-geometries-list {
min-height: 140px;
}

ngm-geometries-simple-list {
display: flex;
flex-direction: column;
overflow: hidden;
height: 100%;
}

.ngm-geom-list {
overflow-y: auto;
overflow-x: hidden;
}

.ngm-draw-list-item,
Expand Down
1 change: 1 addition & 0 deletions ui/src/style/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
--ngm-header-height: 88px;
--ngm-header-height-mobile: 48px;
--ngm-bottom-menu-height: 72px;
--ngm-panel-header-height: 34px;
}
54 changes: 27 additions & 27 deletions ui/src/toolbox/ngm-geometries-simple-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,35 +182,35 @@ export default class NgmGeometriesSimpleList extends LitElementI18n {
}
return html`
<div .hidden="${!this.listTitle}" class="ngm-geom-label">${this.listTitle}</div>
<div class="ngm-geom-list">
<div class="ngm-action-list-item ngm-geom-filter">
<div class="ngm-action-list-item-header">
<div class=${classMap({active: !this.selectedFilter})} @click=${() => this.selectFilter()}>
${i18next.t('tbx_all_label')}
</div>
<div class="ngm-point-draw-icon ${classMap({active: this.selectedFilter === 'point'})}"
title=${i18next.t('tbx_filter_point')}
@click=${() => this.selectFilter('point')}>
</div>
<div class="ngm-line-draw-icon ${classMap({active: this.selectedFilter === 'line'})}"
title=${i18next.t('tbx_filter_line')}
@click=${() => this.selectFilter('line')}>
</div>
<div class="ngm-polygon-draw-icon ${classMap({active: this.selectedFilter === 'polygon'})}"
title=${i18next.t('tbx_filter_polygon')}
@click=${() => this.selectFilter('polygon')}>
</div>
<div class="ngm-rectangle-draw-icon ${classMap({active: this.selectedFilter === 'rectangle'})}"
title=${i18next.t('tbx_filter_rectangle')}
@click=${() => this.selectFilter('rectangle')}>
</div>
${this.viewMode ? '' : html`
<div class="ui dropdown right pointing ngm-action-menu">
<div class="ngm-action-menu-icon"></div>
${this.filterMenuTemplate()}
</div>`}
<div class="ngm-action-list-item ngm-geom-filter">
<div class="ngm-action-list-item-header">
<div class=${classMap({active: !this.selectedFilter})} @click=${() => this.selectFilter()}>
${i18next.t('tbx_all_label')}
</div>
<div class="ngm-point-draw-icon ${classMap({active: this.selectedFilter === 'point'})}"
title=${i18next.t('tbx_filter_point')}
@click=${() => this.selectFilter('point')}>
</div>
<div class="ngm-line-draw-icon ${classMap({active: this.selectedFilter === 'line'})}"
title=${i18next.t('tbx_filter_line')}
@click=${() => this.selectFilter('line')}>
</div>
<div class="ngm-polygon-draw-icon ${classMap({active: this.selectedFilter === 'polygon'})}"
title=${i18next.t('tbx_filter_polygon')}
@click=${() => this.selectFilter('polygon')}>
</div>
<div class="ngm-rectangle-draw-icon ${classMap({active: this.selectedFilter === 'rectangle'})}"
title=${i18next.t('tbx_filter_rectangle')}
@click=${() => this.selectFilter('rectangle')}>
</div>
${this.viewMode ? '' : html`
<div class="ui dropdown right pointing ngm-action-menu">
<div class="ngm-action-menu-icon"></div>
${this.filterMenuTemplate()}
</div>`}
</div>
</div>
<div class="ngm-geom-list">
${geometries.map((geom, index) => {
const disabled = (this.disabledCallback && this.disabledCallback(geom)) || this.disabledTypes.includes(geom.type) || this.editingEnabled;
const active = !disabled && this.selectedId === geom.id;
Expand Down

0 comments on commit cefc0cd

Please sign in to comment.