diff --git a/client/src/app/shared/models/motions/motion.ts b/client/src/app/shared/models/motions/motion.ts index f9050033b..3a398df3b 100644 --- a/client/src/app/shared/models/motions/motion.ts +++ b/client/src/app/shared/models/motions/motion.ts @@ -144,7 +144,7 @@ export class Motion extends BaseModel { /** * return the workflow state * - * Right now only the default workflow is assumes + * Right now only the default workflow is assumed * TODO: Motion workflow needs to be specific on the server */ get stateName() { @@ -157,6 +157,37 @@ export class Motion extends BaseModel { return selectedWorkflow.getStateNameById(this.state_id); } + /** + * Returns the name of the recommendation. + * + * Right now only the default workflow is assumed + * TODO: Motion workflow needs to be specific on the server + */ + get recommendation() { + //get the default workflow + const motionsWorkflowConfig = this.DS.filter(Config, config => config.key === 'motions_workflow')[0] as Config; + const workflowId = +motionsWorkflowConfig.value; + const selectedWorkflow = this.DS.get(Workflow, workflowId) as Workflow; + const stateName = selectedWorkflow.getStateNameById(this.recommendation_id); + if (stateName !== 'NULL') { + return stateName; + } else { + return ''; + } + } + + /** + * returns the value of 'config.motions_recommendations_by' + */ + get recomBy() { + const motionsRecommendationsByConfig = this.DS.filter( + Config, + config => config.key === 'motions_recommendations_by' + )[0] as Config; + const recomByString = motionsRecommendationsByConfig.value; + return recomByString; + } + deserialize(input: any): this { Object.assign(this, input); diff --git a/client/src/app/site/motions/motion-detail/motion-detail.component.html b/client/src/app/site/motions/motion-detail/motion-detail.component.html index 4d05dd860..8ef118542 100644 --- a/client/src/app/site/motions/motion-detail/motion-detail.component.html +++ b/client/src/app/site/motions/motion-detail/motion-detail.component.html @@ -7,7 +7,7 @@