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

feat(ontology): display description for default and existing props (DSP-1154) #475

Merged
merged 8 commits into from Jun 30, 2021
57 changes: 38 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 40 additions & 30 deletions src/app/project/ontology/default-data/default-properties.ts
Expand Up @@ -25,6 +25,7 @@ export interface PropertyCategory {
export interface DefaultProperty {
icon: string;
label: string;
description: string;
subPropOf: string;
objectType?: string;
guiEle: string;
Expand All @@ -39,6 +40,7 @@ export class DefaultProperties {
{
icon: 'short_text',
label: 'Short',
description: 'Short text such as title or name',
subPropOf: Constants.HasValue,
objectType: Constants.TextValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'SimpleText', // 'Input',
Expand All @@ -47,14 +49,16 @@ export class DefaultProperties {
{
icon: 'subject',
label: 'Paragraph',
description: 'Long text such as description; could have line breaks',
subPropOf: Constants.HasValue,
objectType: Constants.TextValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Textarea',
group: 'Text'
},
{
icon: 'line_style',
label: 'Editor',
label: 'Rich Text',
description: 'A rich text editor with formatting options',
subPropOf: Constants.HasValue,
objectType: Constants.TextValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Richtext',
Expand All @@ -68,39 +72,43 @@ export class DefaultProperties {
{
icon: 'arrow_drop_down_circle',
label: 'Dropdown',
description: 'Dropdown menu with values from predefined list',
subPropOf: Constants.HasValue,
objectType: Constants.ListValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'List', // 'Pulldown'
group: 'List'
},
{
icon: 'check_box',
label: 'Checkboxes',
subPropOf: Constants.HasValue,
objectType: Constants.ListValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Checkbox',
group: 'List'
},
{
icon: 'radio_button_checked',
label: 'Multiple choice',
subPropOf: Constants.HasValue,
objectType: Constants.ListValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Radio',
group: 'List'
}
// {
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this code still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if we have to reactivate it one day!?

// icon: 'check_box',
// label: 'Checkboxes',
// description: 'Select multiple values from predefined short list',
// subPropOf: Constants.HasValue,
// objectType: Constants.ListValue,
// guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Checkbox',
// group: 'List'
// },
// {
// icon: 'radio_button_checked',
// label: 'Multiple choice',
// description: 'Select only one value from predefined short list',
// subPropOf: Constants.HasValue,
// objectType: Constants.ListValue,
// guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Radio',
// group: 'List'
// }
]
},
{
group: 'Selection (boolean)',
group: 'Boolean',
elements: [
{
icon: 'toggle_off',
label: 'Yes / No',
description: 'Yes or no, 1 or 0, true or false',
subPropOf: Constants.HasValue,
objectType: Constants.BooleanValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Checkbox', // should be 'Toggle' but it's not supported in DSP-Tangoh,
group: 'Selection (boolean)'
group: 'Boolean'
}
]
},
Expand All @@ -110,6 +118,7 @@ export class DefaultProperties {
{
icon: 'calendar_today',
label: 'Date',
description: 'A date picker with day, month and year',
subPropOf: Constants.HasValue,
objectType: Constants.DateValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Date',
Expand All @@ -118,6 +127,7 @@ export class DefaultProperties {
{
icon: 'date_range',
label: 'Period',
description: 'A period of time between two dates',
subPropOf: Constants.HasValue,
objectType: Constants.DateValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Date',
Expand All @@ -126,14 +136,16 @@ export class DefaultProperties {
{
icon: 'access_time',
label: 'Timestamp',
description: 'A single timestamp on a timeline',
subPropOf: Constants.HasValue,
objectType: Constants.TimeValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'TimeStamp',
group: 'Date / Time'
},
{
icon: 'timelapse',
label: 'Duration',
label: 'Time sequence',
description: 'A time sequence with start and end point on a timeline',
subPropOf: Constants.HasValue,
objectType: Constants.TimeValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Interval',
Expand All @@ -147,6 +159,7 @@ export class DefaultProperties {
{
icon: 'money',
label: 'Integer',
description: 'Integer value',
subPropOf: Constants.HasValue,
objectType: Constants.IntValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Spinbox', // 'Number',
Expand All @@ -155,6 +168,7 @@ export class DefaultProperties {
{
icon: 'functions',
label: 'Decimal',
description: 'Decimal value',
subPropOf: Constants.HasValue,
objectType: Constants.DecimalValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Spinbox', // 'Number',
Expand All @@ -163,15 +177,16 @@ export class DefaultProperties {
]
},
{
group: 'Link',
group: 'Link / Relation',
elements: [
{
icon: 'link',
label: 'Resource class',
description: 'Refers to a resource class',
subPropOf: Constants.HasLinkTo,
objectType: Constants.LinkValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Searchbox', // 'Autocomplete',
group: 'Link'
group: 'Link / Relation'
},
// {
// icon: 'picture_in_picture',
Expand All @@ -192,6 +207,7 @@ export class DefaultProperties {
{
icon: 'language',
label: 'External URL',
description: 'Link to an external website',
subPropOf: Constants.HasValue,
objectType: Constants.UriValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'SimpleText',
Expand All @@ -205,6 +221,7 @@ export class DefaultProperties {
{
icon: 'place',
label: 'Place',
description: 'Geographical location',
subPropOf: Constants.HasValue,
objectType: Constants.GeonameValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Geonames',
Expand All @@ -218,18 +235,11 @@ export class DefaultProperties {
{
icon: 'palette',
label: 'Color',
description: 'A simple color value',
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should probably clarify that this is a hexadecimal value. Ex: "A hexadecimal color value"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure if everyone understands the term "hexadecimal". Apart from that, in the GUI we have the color picker only and the hexadecimal value itself is not displayed anymore (s. DSP-1667)

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's fair :)

subPropOf: Constants.HasValue,
objectType: Constants.ColorValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Colorpicker',
group: 'Shape'
},
{
icon: 'format_shapes',
label: 'Geometry',
subPropOf: Constants.HasValue,
objectType: Constants.GeomValue,
guiEle: Constants.SalsahGui + Constants.HashDelimiter + 'Geometry',
group: 'Shape'
}
]
}
Expand Down
1 change: 1 addition & 0 deletions src/app/project/ontology/ontology.component.html
Expand Up @@ -165,6 +165,7 @@ <h2 class="mat-title">
<mat-menu #sub_menu="matMenu" class="switch-nested-sub-menu">
<!-- <button *ngFor="let subItem of my_menu[mainItem]" mat-menu-item>{{ subItem }}</button> -->
<button mat-menu-item *ngFor="let ele of type.elements" [value]="ele"
[matTooltip]="ele.description" matTooltipPosition="before"
(click)="openPropertyForm('createProperty', {propType: ele})">
<mat-icon>{{ele.icon}}</mat-icon> {{ele.label}}
</button>
Expand Down