From 9215eda6d2b7ec74fe4a424d54ee18cb778efb01 Mon Sep 17 00:00:00 2001
From: rhenck <richard.henck@iqb.hu-berlin.de>
Date: Fri, 22 Oct 2021 13:20:40 +0200
Subject: [PATCH] Use likert-row interface instead of the class in some places

This is to avoid circle imports.
---
 .../common/models/compound-elements/likert-element-row.ts     | 3 ++-
 projects/editor/src/app/dialog.service.ts                     | 2 +-
 projects/editor/src/app/unit.service.ts                       | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/projects/common/models/compound-elements/likert-element-row.ts b/projects/common/models/compound-elements/likert-element-row.ts
index 70e6323da..de57211a8 100644
--- a/projects/common/models/compound-elements/likert-element-row.ts
+++ b/projects/common/models/compound-elements/likert-element-row.ts
@@ -1,6 +1,7 @@
 import { InputElement, UIElement } from '../uI-element';
+import { LikertRow } from '../../interfaces/UIElementInterfaces';
 
-export class LikertElementRow extends InputElement {
+export class LikertElementRow extends InputElement implements LikertRow {
   text: string = '';
   columnCount: number = 0;
 
diff --git a/projects/editor/src/app/dialog.service.ts b/projects/editor/src/app/dialog.service.ts
index 571a7a869..5b7ee0e0c 100644
--- a/projects/editor/src/app/dialog.service.ts
+++ b/projects/editor/src/app/dialog.service.ts
@@ -2,9 +2,9 @@
 import { Component, Inject, Injectable } from '@angular/core';
 import { Observable } from 'rxjs';
 import { MAT_DIALOG_DATA, MatDialog } from '@angular/material/dialog';
-import { AnswerOption } from '../../../common/models/uI-element';
 import { FileService } from '../../../common/file.service';
 import { LikertElementRow } from '../../../common/models/compound-elements/likert-element-row';
+import { AnswerOption } from '../../../common/interfaces/UIElementInterfaces';
 
 @Injectable({
   providedIn: 'root'
diff --git a/projects/editor/src/app/unit.service.ts b/projects/editor/src/app/unit.service.ts
index 34ea72d84..9ea76759e 100644
--- a/projects/editor/src/app/unit.service.ts
+++ b/projects/editor/src/app/unit.service.ts
@@ -13,7 +13,7 @@ import { InputElement, UIElement } from '../../../common/models/uI-element';
 import { TextElement } from '../../../common/models/text-element';
 import { LikertElement } from '../../../common/models/compound-elements/likert-element';
 import { LikertElementRow } from '../../../common/models/compound-elements/likert-element-row';
-import { AnswerOption } from '../../../common/interfaces/UIElementInterfaces';
+import { AnswerOption, LikertRow } from '../../../common/interfaces/UIElementInterfaces';
 
 @Injectable({
   providedIn: 'root'
@@ -167,7 +167,7 @@ export class UnitService {
 
   updateElementProperty(elements: UIElement[], property: string,
                         value: string | number | boolean | string[] |
-                        AnswerOption[] | LikertElementRow[] | null): boolean {
+                        AnswerOption[] | LikertRow[] | null): boolean {
     for (const element of elements) {
       if (property === 'id') {
         if (!IdService.getInstance().isIdAvailable((value as string))) { // prohibit existing IDs
-- 
GitLab