Skip to content

Commit

Permalink
Merge branch 'main' into feature/dev-2490-refactor-sessionservice-to-…
Browse files Browse the repository at this point in the history
…return-true-observables-that-also

* main:
  chore(main): release 11.1.0 (#1249)
  chore: update dsp-js to v9.0.2 (#1258)
  refactor(ontology-class-item): change how long labels are handled (#1257)

# Conflicts:
#	apps/dsp-app/src/app/project/ontology-classes/ontology-class-item/ontology-class-item.component.ts
  • Loading branch information
irmastnt committed Nov 13, 2023
2 parents 6fbc915 + 45bc211 commit 0a6cfc2
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 23 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# Changelog

## [11.1.0](https://github.com/dasch-swiss/dsp-das/compare/v11.0.0...v11.1.0) (2023-11-10)


### Enhancements

* **advanced-search:** allow ordering by URI value ([#1248](https://github.com/dasch-swiss/dsp-das/issues/1248)) ([e5cfebe](https://github.com/dasch-swiss/dsp-das/commit/e5cfebe723ddda057ee7e01dec749f9d27f5f253))
* **expert search:** implement default gravsearch as placeholder ([#1247](https://github.com/dasch-swiss/dsp-das/issues/1247)) ([5132f4d](https://github.com/dasch-swiss/dsp-das/commit/5132f4d48215cb53a8468dd8431a131f42bcad83))
* **list-value:** make list menu resemble a dropdrown ([#1256](https://github.com/dasch-swiss/dsp-das/issues/1256)) ([f7a7a8c](https://github.com/dasch-swiss/dsp-das/commit/f7a7a8c802fb55c744c0b7c4fefdefa9d2129301))
* **project description:** order project descriptions by language ([#1250](https://github.com/dasch-swiss/dsp-das/issues/1250)) ([f2c5dc9](https://github.com/dasch-swiss/dsp-das/commit/f2c5dc92a677929aba2aaa61f342d0da69c3cfac))


### Bug Fixes

* **app/help:** fix links to releases ([#1253](https://github.com/dasch-swiss/dsp-das/issues/1253)) ([e2ddcdd](https://github.com/dasch-swiss/dsp-das/commit/e2ddcddfbca0e79ae6cb436deb8769e6fe6bc6f5))
* **app/resource:** removed developer feature that created annotation bug ([#1254](https://github.com/dasch-swiss/dsp-das/issues/1254)) ([7b908b0](https://github.com/dasch-swiss/dsp-das/commit/7b908b0e646918f091aefa7881472578d92b51d4))
* **type errors:** fix type errors ([#1255](https://github.com/dasch-swiss/dsp-das/issues/1255)) ([389eccb](https://github.com/dasch-swiss/dsp-das/commit/389eccbbe68caf0c5419e1f017adadabdda34e15))


### Maintenance

* **date picker:** implement date picker as standalone component ([#1251](https://github.com/dasch-swiss/dsp-das/issues/1251)) ([e89dba8](https://github.com/dasch-swiss/dsp-das/commit/e89dba8b862eec8eb4c6c8985d3fa9d15a0bdfce))
* **ontology-class-item:** change how long labels are handled ([#1257](https://github.com/dasch-swiss/dsp-das/issues/1257)) ([f6d42dc](https://github.com/dasch-swiss/dsp-das/commit/f6d42dc50181cd2be6f10124455138597c880405))
* update dsp-js to v9.0.2 ([#1258](https://github.com/dasch-swiss/dsp-das/issues/1258)) ([cb86ebf](https://github.com/dasch-swiss/dsp-das/commit/cb86ebf695ddbdd0f6dc8de59b79d50fa4b200a1))

## [11.0.0](https://github.com/dasch-swiss/dsp-das/compare/v10.24.2...v11.0.0) (2023-10-27)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="class-item-container">
<div class="content" [routerLinkActive]="['is-active']" (click)="selectItem()">
<div class="box link" [routerLink]="classLink">
<div class="label" matTooltip="{{resClass.label}}" matTooltipShowDelay="750" [matTooltipPosition]="'above'"
[matTooltipDisabled]="resClass.label.length < MAX_LABEL_CHAR">{{trimLabel(resClass.label)}}</div>
<div #resClassLabel class="label" matTooltip="{{resClass.label}}" matTooltipShowDelay="750" [matTooltipPosition]="'above'"
[matTooltipDisabled]="tooltipDisabled">{{resClass.label}}</div>
<div class="entry-container">
<mat-icon>{{icon}}</mat-icon>
<ngx-skeleton-loader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@
}

.box {
padding-left: 10px;
padding-top: 10px;
padding: 6px 10px;
border-radius: 7px 0 0 7px;
flex-grow: 1;

.label {
width: 200px;
color: $secondary;
padding-left: 4px;
height: 36px;
overflow: hidden;
display: -webkit-box;
line-height: 17px;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}

.entry-container {
Expand All @@ -42,7 +47,13 @@
}

.entry {
font-size: 20px;
font-size: 14px;
}

mat-icon {
height: 23px;
width: 23px;
font-size: 23px;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, Input, OnDestroy, OnInit } from '@angular/core';
import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Inject, Input, OnDestroy, OnInit, ViewChild } from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {
ClassDefinition,
Expand All @@ -23,12 +23,12 @@ import { OntologyService } from '@dsp-app/src/app/project/ontology/ontology.serv
templateUrl: './ontology-class-item.component.html',
styleUrls: ['./ontology-class-item.component.scss'],
})
export class OntologyClassItemComponent implements OnInit, OnDestroy {
export class OntologyClassItemComponent implements OnInit, AfterViewInit, OnDestroy {
@Input() resClass: ClassDefinition;

@Input() projectMember: boolean;

readonly MAX_LABEL_CHAR = 25;
@ViewChild('resClassLabel') resClassLabel: ElementRef;

gravsearch: string;

Expand All @@ -40,6 +40,8 @@ export class OntologyClassItemComponent implements OnInit, OnDestroy {

componentCommsSubscriptions: Subscription[] = [];

tooltipDisabled = true;

// i18n setup
itemPluralMapping = {
entry: {
Expand All @@ -55,7 +57,7 @@ export class OntologyClassItemComponent implements OnInit, OnDestroy {
private _errorHandler: AppErrorHandler,
private _route: ActivatedRoute,
private _componentCommsService: ComponentCommunicationEventService,
private _cd: ChangeDetectorRef,
private _cdr: ChangeDetectorRef,
) {}

ngOnInit(): void {
Expand All @@ -82,6 +84,12 @@ export class OntologyClassItemComponent implements OnInit, OnDestroy {
this._getSearchCount();
})
);

}

ngAfterViewInit(): void {
this.tooltipDisabled = !this.isTextOverflowing(this.resClassLabel.nativeElement);
this._cdr.detectChanges();
}

ngOnDestroy(): void {
Expand All @@ -94,10 +102,10 @@ export class OntologyClassItemComponent implements OnInit, OnDestroy {
);
}

trimLabel(fullString: string) {
return fullString.length > this.MAX_LABEL_CHAR
? `${fullString.slice(0, this.MAX_LABEL_CHAR)}...`
: fullString;
isTextOverflowing(element: HTMLElement): boolean {
if (element) {
return element.scrollHeight > element.clientHeight;
}
}

private _setGravsearch(iri: string): string {
Expand Down Expand Up @@ -148,7 +156,7 @@ export class OntologyClassItemComponent implements OnInit, OnDestroy {
.subscribe(
(res: CountQueryResponse) => {
this.results = res.numberOfResults;
this._cd.markForCheck();
this._cdr.markForCheck();
},
(error: ApiResponseError) => {
this._errorHandler.showMessage(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import {
} from './default-data/default-resource-classes';
import { OntologyService } from './ontology.service';
import { Actions, Select, Store, ofActionSuccessful } from '@ngxs/store';
import { ClearCurrentOntologyAction, ClearProjectOntologiesAction, CurrentOntologyCanBeDeletedAction, CurrentProjectSelectors, DefaultClass, LoadListsInProjectAction, LoadOntologyAction, LoadProjectOntologiesAction, OntologiesSelectors, OntologyProperties, ProjectsSelectors, RemoveProjectOntologyAction, SetCurrentOntologyAction, SetCurrentProjectOntologyPropertiesAction, SetOntologiesLoadingAction, UpdateProjectOntologyAction, UserSelectors } from '@dasch-swiss/vre/shared/app-state';
import { ClearCurrentOntologyAction, ClearProjectOntologiesAction, CurrentOntologyCanBeDeletedAction, CurrentProjectSelectors, DefaultClass, LoadListsInProjectAction, LoadOntologyAction, LoadProjectOntologiesAction, OntologiesSelectors, OntologyProperties, ProjectsSelectors, SetCurrentOntologyAction, SetCurrentProjectOntologyPropertiesAction, UserSelectors } from '@dasch-swiss/vre/shared/app-state';
import { Observable, Subject, combineLatest } from 'rxjs';
import { map, take, takeUntil } from 'rxjs/operators';
import { ProjectBase } from '../project-base';
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dsp-app",
"version": "11.0.0",
"version": "11.1.0",
"repository": {
"type": "git",
"url": "https://github.com/dasch-swiss/dsp-app.git"
Expand Down Expand Up @@ -40,7 +40,7 @@
"@angular/platform-browser-dynamic": "^16.1.5",
"@angular/router": "^16.1.5",
"@ckeditor/ckeditor5-angular": "^5.2.0",
"@dasch-swiss/dsp-js": "^9.0.1",
"@dasch-swiss/dsp-js": "^9.0.2",
"@datadog/browser-logs": "^4.42.2",
"@datadog/browser-rum": "^4.42.2",
"@ngrx/component-store": "^16.1.0",
Expand Down

0 comments on commit 0a6cfc2

Please sign in to comment.