From bb55110245c395fe7247deebef0858b7877140d9 Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Fri, 12 Jul 2019 10:14:35 +0200 Subject: [PATCH] Fixes dynamic growing cells in workflows - The cells in the table of a workflow are dynamically growing - The colors of the states get new labels - If multiple selection in motion-list is active, the button to change the view won't be seen --- .../app/site/motions/models/view-motion.ts | 4 +- .../app/site/motions/models/view-workflow.ts | 8 - .../motion-list/motion-list.component.html | 2 +- .../workflow-detail.component.html | 154 +++++++++--------- .../workflow-detail.component.scss | 22 +-- .../workflow-detail.component.ts | 14 +- .../motion-block-slide.component.ts | 3 +- .../migrations/0030_state_css_classes_1.py | 15 ++ .../migrations/0031_state_css_classes_2.py | 28 ++++ openslides/motions/models.py | 7 +- openslides/motions/signals.py | 22 +-- tests/unit/motions/test_projector.py | 8 +- 12 files changed, 153 insertions(+), 134 deletions(-) create mode 100644 openslides/motions/migrations/0030_state_css_classes_1.py create mode 100644 openslides/motions/migrations/0031_state_css_classes_2.py diff --git a/client/src/app/site/motions/models/view-motion.ts b/client/src/app/site/motions/models/view-motion.ts index d9f1f494d..a3a8b5409 100644 --- a/client/src/app/site/motions/models/view-motion.ts +++ b/client/src/app/site/motions/models/view-motion.ts @@ -9,7 +9,7 @@ import { ViewUser } from 'app/site/users/models/view-user'; import { ViewTag } from 'app/site/tags/models/view-tag'; import { ViewMediafile } from 'app/site/mediafiles/models/view-mediafile'; import { ViewItem } from 'app/site/agenda/models/view-item'; -import { ViewWorkflow, StateCssClassMapping } from './view-workflow'; +import { ViewWorkflow } from './view-workflow'; import { ViewCategory } from './view-category'; import { ViewMotionBlock } from './view-motion-block'; import { BaseViewModel } from 'app/site/base/base-view-model'; @@ -349,7 +349,7 @@ export class ViewMotion extends BaseViewModelWithAgendaItemAndListOfSpeakers
-
+
diff --git a/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.scss b/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.scss index 9911623c8..5a292a0dc 100644 --- a/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.scss +++ b/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.scss @@ -5,35 +5,25 @@ } table { - .mat-header-cell { - min-width: 150px; - position: relative; - } - + .mat-header-cell, .mat-cell { - min-width: 150px; + min-width: 200px; position: relative; } - // scaled up version of an inner table .clickable-cell { - position: absolute; display: flex; - width: 100%; - height: 100%; - } - - .clickable-cell:hover { cursor: pointer; - background-color: rgba(0, 0, 0, 0.025); + &:hover { + background-color: rgba(0, 0, 0, 0.025); + } } .inner-table { + text-align: center; align-items: center; margin: auto; - white-space: nowrap; overflow: hidden; - text-overflow: ellipsis; padding: 0 10px; } diff --git a/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.ts b/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.ts index 4fb226f21..7e7bc3ab4 100644 --- a/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-workflow/components/workflow-detail/workflow-detail.component.ts @@ -10,7 +10,7 @@ import { Title } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; import { BaseViewComponent } from 'app/site/base/base-view'; -import { ViewWorkflow, StateCssClassMapping } from 'app/site/motions/models/view-workflow'; +import { ViewWorkflow } from 'app/site/motions/models/view-workflow'; import { WorkflowRepositoryService } from 'app/core/repositories/motions/workflow-repository.service'; import { WorkflowState, MergeAmendment } from 'app/shared/models/motions/workflow-state'; import { PromptService } from 'app/core/ui-services/prompt.service'; @@ -93,7 +93,7 @@ export class WorkflowDetailComponent extends BaseViewComponent implements OnInit /** * Determine label colors. Where they should come from is currently now know */ - public labelColors = ['default', 'primary', 'success', 'danger', 'warning']; + public labelColors: string[] = ['grey', 'red', 'green', 'lightblue', 'yellow']; /** * Holds state permissions @@ -396,14 +396,4 @@ export class WorkflowDetailComponent extends BaseViewComponent implements OnInit public trackElement(index: number): number { return index; } - - /** - * Translate the state's css class into a color - * - * @param colorLabel the default color label of a selected workflow - * @returns a string representing a color - */ - public getStateCssColor(colorLabel: string): string { - return StateCssClassMapping[colorLabel] || ''; - } } diff --git a/client/src/app/slides/motions/motion-block/motion-block-slide.component.ts b/client/src/app/slides/motions/motion-block/motion-block-slide.component.ts index dd1408c29..d42b8dc41 100644 --- a/client/src/app/slides/motions/motion-block/motion-block-slide.component.ts +++ b/client/src/app/slides/motions/motion-block/motion-block-slide.component.ts @@ -4,7 +4,6 @@ import { TranslateService } from '@ngx-translate/core'; import { MotionBlockSlideData, MotionBlockSlideMotionRepresentation } from './motion-block-slide-data'; import { MotionRepositoryService } from 'app/core/repositories/motions/motion-repository.service'; -import { StateCssClassMapping } from 'app/site/motions/models/view-workflow'; import { BaseMotionSlideComponent } from '../base/base-motion-slide'; import { SlideData } from 'app/core/core-services/projector-data.service'; @@ -187,6 +186,6 @@ export class MotionBlockSlideComponent extends BaseMotionSlideComponent