Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSP-652 FIX: Boolean add button #182

Merged
merged 7 commits into from Sep 21, 2020
Expand Up @@ -36,9 +36,13 @@
</div>
<!-- Add button -->
<!-- temporary hack to hide add button for an XML value -->
<!-- ngIf:
- user has write permissions
- the property does not have a cardinality of 0-1 (enum for this case is 1) or if the property does have this cardinility, ensure there isn't already a value
- the property id is not the same as a property with a add-value component currently open to prevent users from continuously opening add-value forms on the same property -->
<div *ngIf="prop.guiDef.propertyIndex !== 'http://0.0.0.0:3333/ontology/0001/anything/v2#hasRichtext' &&
addButtonIsVisible &&
prop.guiDef.cardinality !== 1 &&
(prop.guiDef.cardinality !== 1 || prop.guiDef.cardinality === 1 && prop.values.length === 0 ) &&
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tobiasschweizer this ngIf is quite unmanageable but I don't currently have a way to do it in the TS file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you use the cardinality util provided by dsp-js?

if not, could we somehow add what you need to it?

propID !== prop.propDef.id">
<button class="create" (click)="showAddValueForm(prop)" title="Add a new value">
<mat-icon>add_box</mat-icon>
Expand Down
Expand Up @@ -53,7 +53,6 @@ export class PropertyViewComponent implements OnInit, OnDestroy {
addButtonIsVisible: boolean; // used to toggle add value button
addValueFormIsVisible: boolean; // used to toggle add value form field
propID: string; // used in template to show only the add value form of the corresponding value
readOnlyProp: boolean; // used in template to not show an "add" button for properties we do not yet have a way to create/edit

valueOperationEventSubscription: Subscription;

Expand Down