Design fixes to include projects (#10501)

* Design fixes to include projects

* Full-width `spot-list` inside `spot-container`
* Remove button margin from include all subprojects toggle
* Dynamic `spot-tooltip` alignment in project include list
* Add dark `spot-tooltip` version

* Add mobile action-bar wrapping rules

* Try fixing spec

* Increase wait times

* Move margins of spot-list inside to accomodate space for the tooltip

* Only work with top margins by default in spot-container

* Fix mobile margins of action-bar
pull/10549/head
Benjamin Bädorf 3 years ago committed by GitHub
parent 0cdc8f0dbd
commit 7a6a8d3196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      frontend/src/app/shared/components/project-include/project-include.component.html
  2. 5
      frontend/src/app/shared/components/project-include/project-list.component.html
  3. 15
      frontend/src/app/shared/components/project-include/project-list.component.ts
  4. 4
      frontend/src/app/spot/components/tooltip/tooltip.component.ts
  5. 12
      frontend/src/app/spot/spot-docs.component.html
  6. 14
      frontend/src/app/spot/styles/sass/common/container.sass
  7. 16
      frontend/src/app/spot/styles/sass/components/action-bar.sass
  8. 9
      frontend/src/app/spot/styles/sass/components/tooltip.sass
  9. 4
      frontend/src/app/spot/styles/tokens/dist/tokens.json
  10. 4
      frontend/src/app/spot/styles/tokens/dist/tokens.sass
  11. 3
      frontend/src/app/spot/styles/tokens/media-queries.yml

@ -53,6 +53,7 @@
[selected]="selectedProjects" [selected]="selectedProjects"
[includeSubprojects]="includeSubprojects$ | async" [includeSubprojects]="includeSubprojects$ | async"
[searchText]="searchText" [searchText]="searchText"
[root]="true"
(update)="selectedProjects = $event" (update)="selectedProjects = $event"
data-qa-selector="project-include-list" data-qa-selector="project-include-list"
></ul> ></ul>

@ -1,14 +1,15 @@
<li <li
class="spot-list--item" class="spot-list--item"
*ngFor="let project of projects" *ngFor="let project of projects; index as i; first as isFirst; last as isLast"
> >
<label <label
class="spot-list--item-action op-project-list--item-action" class="spot-list--item-action op-project-list--item-action"
[ngClass]="{ 'spot-list--item-action_disabled': isDisabled(project) }" [ngClass]="{ 'spot-list--item-action_disabled': isDisabled(project) }"
> >
<spot-tooltip <spot-tooltip
alignment="top-left" [alignment]="getAlignment(project, isFirst, isLast)"
[disabled]="!isDisabled(project)" [disabled]="!isDisabled(project)"
[dark]="true"
> >
<ng-container slot="trigger"> <ng-container slot="trigger">
<spot-checkbox <spot-checkbox

@ -9,6 +9,7 @@ import {
} from '@angular/core'; } from '@angular/core';
import { IProjectData } from './project-data'; import { IProjectData } from './project-data';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service'; import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import SpotDropAlignmentOption from 'core-app/spot/drop-alignment-options';
@Component({ @Component({
selector: '[op-project-list]', selector: '[op-project-list]',
@ -23,6 +24,8 @@ export class OpProjectListComponent {
@Output() update = new EventEmitter<string[]>(); @Output() update = new EventEmitter<string[]>();
@Input() root:boolean = false;
@Input() projects:IProjectData[] = []; @Input() projects:IProjectData[] = [];
@Input() selected:string[] = []; @Input() selected:string[] = [];
@ -77,4 +80,16 @@ export class OpProjectListComponent {
]); ]);
} }
} }
public getAlignment(project:IProjectData, isFirst:boolean, isLast:boolean):SpotDropAlignmentOption {
if (this.root && isFirst) {
if (isLast && !project.children.length) {
return SpotDropAlignmentOption.RightCenter;
}
return SpotDropAlignmentOption.BottomLeft;
}
return SpotDropAlignmentOption.TopLeft;
}
} }

@ -14,7 +14,9 @@ import SpotDropAlignmentOption from '../../drop-alignment-options';
export class SpotTooltipComponent { export class SpotTooltipComponent {
@HostBinding('class.spot-tooltip') public className = true; @HostBinding('class.spot-tooltip') public className = true;
@Input() disabled = false; @Input() @HostBinding('class.spot-tooltip_dark') public dark = false;
@Input() public disabled = false;
@Input() public alignment:SpotDropAlignmentOption = SpotDropAlignmentOption.BottomCenter; @Input() public alignment:SpotDropAlignmentOption = SpotDropAlignmentOption.BottomCenter;

@ -311,6 +311,7 @@ Currently selected value is {{ toggleValue }}
<h1>Tooltip</h1> <h1>Tooltip</h1>
<section class="space-children">
<select [(ngModel)]="tooltipAlignment"> <select [(ngModel)]="tooltipAlignment">
<option>left-top</option> <option>left-top</option>
<option>left-center</option> <option>left-center</option>
@ -341,6 +342,17 @@ Currently selected value is {{ toggleValue }}
</ng-container> </ng-container>
</spot-tooltip> </spot-tooltip>
<spot-tooltip
[alignment]="tooltipAlignment"
[dark]="true"
>
<ng-container slot="trigger">Dark tooltip trigger</ng-container>
<ng-container slot="body">
<p class="spot-body-small">This is a dark tooltip</p>
</ng-container>
</spot-tooltip>
</section>
<h1>Action Bar</h1> <h1>Action Bar</h1>
<div class="spot-action-bar"> <div class="spot-action-bar">

@ -9,12 +9,18 @@
> .spot-body-big, > .spot-body-big,
> .spot-body-small, > .spot-body-small,
> .spot-caption, > .spot-caption,
> .spot-text-field, > .spot-text-field
margin: 0 $spot-spacing-1
margin-top: $spot-spacing-1
&:last-child
margin-bottom: $spot-spacing-1
> .spot-list > .spot-list
margin: $spot-spacing-0_5 $spot-spacing-1 padding: $spot-spacing-1 0
&:first-child &:first-child
margin-top: $spot-spacing-1 padding-top: $spot-spacing-1
&:last-child &:last-child
margin-bottom: $spot-spacing-1 padding-bottom: $spot-spacing-1

@ -1,9 +1,10 @@
.spot-action-bar .spot-action-bar
display: flex display: flex
flex-direction: row flex-direction: column
flex-wrap: nowrap flex-wrap: nowrap
justify-content: space-between justify-content: space-between
padding: $spot-spacing-1 padding: $spot-spacing-1
padding-bottom: $spot-spacing-0_5
background-color: $spot-color-basic-gray-6 background-color: $spot-color-basic-gray-6
&--left, &--left,
@ -12,6 +13,19 @@
flex-direction: row flex-direction: row
flex-wrap: wrap flex-wrap: wrap
align-items: center align-items: center
justify-content: flex-end
> *
margin-bottom: $spot-spacing-0_5
margin-left: $spot-spacing-0_5
@media #{$spot-mq-action-bar-change}
flex-direction: row
&--left,
&--right
> *
margin-left: 0
&--left &--left
justify-content: flex-start justify-content: flex-start

@ -16,6 +16,7 @@
box-shadow: $spot-shadow-light-low box-shadow: $spot-shadow-light-low
background: $spot-color-main-light background: $spot-color-main-light
color: $spot-color-basic-gray-1
display: flex display: flex
flex-direction: column flex-direction: column
@ -140,3 +141,11 @@
&:hover &--body &:hover &--body
pointer-events: all pointer-events: all
opacity: 1 opacity: 1
&_dark &--body
color: $spot-color-basic-white
background: $spot-color-basic-gray-1
&::before
border-bottom-color: $spot-color-basic-gray-1

@ -54,7 +54,7 @@
"spot-shadow-hard-low": "2px 2px 5px rgba(0, 0, 0, 0.25)", "spot-shadow-hard-low": "2px 2px 5px rgba(0, 0, 0, 0.25)",
"spot-shadow-hard-mid": "4px 4px 10px rgba(0, 0, 0, 0.25)", "spot-shadow-hard-mid": "4px 4px 10px rgba(0, 0, 0, 0.25)",
"spot-shadow-hard-high": "6px 6px 20px rgba(0, 0, 0, 0.25)", "spot-shadow-hard-high": "6px 6px 20px rgba(0, 0, 0, 0.25)",
"spot-mq-portrait": "'(orientation: portrait)'",
"spot-mq-landscape": "'(orientation: landscape)'", "spot-mq-landscape": "'(orientation: landscape)'",
"spot-mq-drop-modal-in-context": "'(min-width: 680px) and (min-height: 500px)'" "spot-mq-drop-modal-in-context": "'(min-width: 1000px) and (min-height: 500px)'",
"spot-mq-action-bar-change": "'(min-width: 768px)'"
} }

@ -54,6 +54,6 @@ $spot-shadow-light-high: 6px 6px 20px rgba(0, 0, 0, 0.15)
$spot-shadow-hard-low: 2px 2px 5px rgba(0, 0, 0, 0.25) $spot-shadow-hard-low: 2px 2px 5px rgba(0, 0, 0, 0.25)
$spot-shadow-hard-mid: 4px 4px 10px rgba(0, 0, 0, 0.25) $spot-shadow-hard-mid: 4px 4px 10px rgba(0, 0, 0, 0.25)
$spot-shadow-hard-high: 6px 6px 20px rgba(0, 0, 0, 0.25) $spot-shadow-hard-high: 6px 6px 20px rgba(0, 0, 0, 0.25)
$spot-mq-portrait: '(orientation: portrait)'
$spot-mq-landscape: '(orientation: landscape)' $spot-mq-landscape: '(orientation: landscape)'
$spot-mq-drop-modal-in-context: '(min-width: 680px) and (min-height: 500px)' $spot-mq-drop-modal-in-context: '(min-width: 1000px) and (min-height: 500px)'
$spot-mq-action-bar-change: '(min-width: 768px)'

@ -5,6 +5,9 @@ props:
spot-mq-drop-modal-in-context: spot-mq-drop-modal-in-context:
value: "'(min-width: 1000px) and (min-height: 500px)'" value: "'(min-width: 1000px) and (min-height: 500px)'"
spot-mq-action-bar-change:
value: "'(min-width: 768px)'"
global: global:
type: media-query type: media-query
category: media-query category: media-query

Loading…
Cancel
Save