Skip to content

Commit

Permalink
feat(ontology): display description for default and existing props (D…
Browse files Browse the repository at this point in the history
…SP-1154) (#475)

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

* chore(ontology): disable the checkboxes and radio inputs

* test(ontology): bug fix in tests

* chore(deps): update package-lock after running `npm i`

* chore(ontology): better description for short text

* chore(ontology): better descriptions in default props

* chore(ontology): better description for short text
  • Loading branch information
kilchenmann committed Jun 30, 2021
1 parent 927237d commit 8be7e55
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 52 deletions.
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'
}
// {
// 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',
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

0 comments on commit 8be7e55

Please sign in to comment.