diff --git a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.html b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.html index d176a9c19..86be55629 100644 --- a/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.html +++ b/client/src/app/site/motions/components/motion-block-detail/motion-block-detail.component.html @@ -52,15 +52,7 @@ State - + {{ getStateLabel(motion) }} diff --git a/client/src/app/site/motions/components/motion-detail/motion-detail.component.html b/client/src/app/site/motions/components/motion-detail/motion-detail.component.html index 2ed4be551..1a0dfba8e 100644 --- a/client/src/app/site/motions/components/motion-detail/motion-detail.component.html +++ b/client/src/app/site/motions/components/motion-detail/motion-detail.component.html @@ -231,7 +231,7 @@
- + {{ stateLabel }}
@@ -242,7 +242,7 @@
- {{ stateLabel }} + {{ stateLabel }}
diff --git a/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts index 58510e1a4..901a9d1f1 100644 --- a/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/components/motion-detail/motion-detail.component.ts @@ -38,7 +38,7 @@ import { StatuteParagraphRepositoryService } from 'app/core/repositories/motions import { Tag } from 'app/shared/models/core/tag'; import { UserRepositoryService } from 'app/core/repositories/users/user-repository.service'; import { ViewMotionBlock } from '../../models/view-motion-block'; -import { ViewWorkflow, StateCssClassMapping } from '../../models/view-workflow'; +import { ViewWorkflow } from '../../models/view-workflow'; import { ViewUser } from 'app/site/users/models/view-user'; import { ViewCategory } from '../../models/view-category'; import { ViewCreateMotion } from '../../models/view-create-motion'; @@ -1448,19 +1448,6 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, } } - /** - * Translate the state's css class into a color - * - * @returns a string representing a color - */ - public getStateCssColor(): string { - if (!this.motion.state) { - return ''; - } - - return StateCssClassMapping[this.motion.state.css_class] || ''; - } - public swipe(e: TouchEvent, when: string): void { const coord: [number, number] = [e.changedTouches[0].pageX, e.changedTouches[0].pageY]; const time = new Date().getTime(); diff --git a/client/src/app/site/motions/components/motion-list/motion-list.component.html b/client/src/app/site/motions/components/motion-list/motion-list.component.html index 1efdb3474..05c09bfa4 100644 --- a/client/src/app/site/motions/components/motion-list/motion-list.component.html +++ b/client/src/app/site/motions/components/motion-list/motion-list.component.html @@ -78,16 +78,7 @@
- + {{ getStateLabel(motion) }}
diff --git a/client/src/app/site/motions/components/workflow-detail/workflow-detail.component.ts b/client/src/app/site/motions/components/workflow-detail/workflow-detail.component.ts index 7f43bda9f..bfbe40820 100644 --- a/client/src/app/site/motions/components/workflow-detail/workflow-detail.component.ts +++ b/client/src/app/site/motions/components/workflow-detail/workflow-detail.component.ts @@ -7,7 +7,7 @@ import { Title } from '@angular/platform-browser'; import { TranslateService } from '@ngx-translate/core'; import { BaseViewComponent } from 'app/site/base/base-view'; -import { ViewWorkflow } from '../../models/view-workflow'; +import { ViewWorkflow, StateCssClassMapping } from '../../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'; @@ -90,7 +90,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']; + public labelColors = ['default', 'primary', 'success', 'danger', 'warning']; /** * Holds state permissions @@ -385,17 +385,6 @@ export class WorkflowDetailComponent extends BaseViewComponent implements OnInit * @returns a string representing a color */ public getStateCssColor(colorLabel: string): string { - switch (colorLabel) { - case 'success': - return 'green'; - case 'danger': - return 'red'; - case 'default': - return 'grey'; - case 'primary': - return 'lightblue'; - default: - return ''; - } + return StateCssClassMapping[colorLabel] || ''; } } diff --git a/client/src/app/site/motions/models/view-motion.ts b/client/src/app/site/motions/models/view-motion.ts index 7dfb62345..8c1059815 100644 --- a/client/src/app/site/motions/models/view-motion.ts +++ b/client/src/app/site/motions/models/view-motion.ts @@ -11,7 +11,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 } from './view-workflow'; +import { ViewWorkflow, StateCssClassMapping } from './view-workflow'; import { ViewCategory } from './view-category'; import { ViewMotionBlock } from './view-motion-block'; import { BaseViewModel } from 'app/site/base/base-view-model'; @@ -327,6 +327,15 @@ export class ViewMotion extends BaseAgendaViewModel implements Searchable { return this.personalNote && this.personalNote.note ? true : false; } + /** + * Translate the state's css class into a color + * + * @returns a string representing a color + */ + public get stateCssColor(): string { + return StateCssClassMapping[this.state.css_class] || ''; + } + /** * This is set by the repository */ diff --git a/client/src/app/site/motions/models/view-workflow.ts b/client/src/app/site/motions/models/view-workflow.ts index 1e138c74b..1149c81a9 100644 --- a/client/src/app/site/motions/models/view-workflow.ts +++ b/client/src/app/site/motions/models/view-workflow.ts @@ -6,7 +6,8 @@ export const StateCssClassMapping = { success: 'green', danger: 'red', default: 'grey', - primary: 'lightblue' + primary: 'lightblue', + warning: 'yellow' }; /**