Skip to content
Snippets Groups Projects
Commit 8c349cb4 authored by Bernhard Fürst's avatar Bernhard Fürst
Browse files

OZG-7418 Replace matTooltip by tooltip directive

parent ae5cf1bc
Branches
Tags
1 merge request!4OZG-7418 Ersetze matTooltip durch die neue tooltip Directive
Showing
with 37 additions and 78 deletions
......@@ -48,7 +48,7 @@
<dd class="mt-1" data-test-id="organisations-einheit-sync-error">
<ods-exclamation-icon
*ngIf="organisationsEinheitResource.syncResult === AdminOrganisationsEinheitSyncResult.NOT_FOUND_IN_PVOG"
matTooltip="Organisationseinheit wurde nicht in den PVOG-Daten gefunden."
tooltip="Organisationseinheit wurde nicht in den PVOG-Daten gefunden."
size="small"
/>
<ods-exclamation-icon
......
......@@ -31,16 +31,15 @@ import {
} from '@alfa-client/test-utils';
import { CommonModule } from '@angular/common';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatTooltipModule } from '@angular/material/tooltip';
import { ActivatedRoute } from '@angular/router';
import { ExclamationIconComponent, ListComponent, ListItemComponent } from '@ods/system';
import { ExclamationIconComponent, ListComponent, ListItemComponent, TooltipDirective } from '@ods/system';
import {
AdminOrganisationsEinheitResource,
AdminOrganisationsEinheitSyncResult,
} from 'libs/admin/organisations-einheit-shared/src/lib/organisations-einheit.model';
import { createAdminOrganisationsEinheitResource } from 'libs/admin/organisations-einheit-shared/src/test/organisations-einheit';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockComponent, MockModule } from 'ng-mocks';
import { MockComponent, MockDirective } from 'ng-mocks';
import { OrganisationsEinheitListComponent } from './organisations-einheit-list.component';
describe('OrganisationsEinheitListComponent', () => {
......@@ -71,7 +70,7 @@ describe('OrganisationsEinheitListComponent', () => {
MockComponent(ListComponent),
MockComponent(ListItemComponent),
MockComponent(ExclamationIconComponent),
MockModule(MatTooltipModule),
MockDirective(TooltipDirective),
],
}).compileComponents();
......
......@@ -28,14 +28,13 @@ import {
import { TechSharedModule } from '@alfa-client/tech-shared';
import { CommonModule } from '@angular/common';
import { Component, Input } from '@angular/core';
import { MatTooltip } from '@angular/material/tooltip';
import { ExclamationIconComponent, ListComponent, ListItemComponent } from '@ods/system';
import { ExclamationIconComponent, ListComponent, ListItemComponent, TooltipDirective } from '@ods/system';
@Component({
selector: 'admin-organisations-einheit-list',
templateUrl: './organisations-einheit-list.component.html',
standalone: true,
imports: [CommonModule, ListComponent, ListItemComponent, ExclamationIconComponent, MatTooltip, TechSharedModule],
imports: [CommonModule, ListComponent, ListItemComponent, ExclamationIconComponent, TooltipDirective, TechSharedModule],
})
export class OrganisationsEinheitListComponent {
private _organisationsEinheitResources: AdminOrganisationsEinheitResource[] = [];
......
......@@ -23,12 +23,7 @@
unter der Lizenz sind dem Lizenztext zu entnehmen.
-->
<div
class="container"
[class.deletable]="deletable"
[matTooltip]="file.name"
matTooltipClass="word-break"
>
<div class="container" [class.deletable]="deletable" [tooltip]="file.name">
<div
class="download-container"
[class.downloadable]="file | hasLink: fileLinkRel.DOWNLOAD"
......
......@@ -28,11 +28,11 @@ import { getElementFromFixture } from '@alfa-client/test-utils';
import { IconButtonWithSpinnerComponent, SpinnerComponent } from '@alfa-client/ui';
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
import { faker } from '@faker-js/faker';
import { TooltipDirective } from '@ods/system';
import { createBinaryFileResource } from 'libs/binary-file-shared/test/binary-file';
import { getDataTestClassOf } from 'libs/tech-shared/test/data-test';
import { MockComponent, MockModule } from 'ng-mocks';
import { MockComponent, MockDirective } from 'ng-mocks';
import { BinaryFileComponent } from './binary-file.component';
describe('BinaryFileComponent', () => {
......@@ -49,9 +49,9 @@ describe('BinaryFileComponent', () => {
MatIcon,
FileSizePipe,
HasLinkPipe,
MockModule(MatTooltipModule),
MockComponent(SpinnerComponent),
MockComponent(IconButtonWithSpinnerComponent),
MockDirective(TooltipDirective),
],
});
});
......
......@@ -32,6 +32,7 @@ import {
AttachmentWrapperComponent,
CloseIconComponent,
SpinnerIconComponent,
TooltipDirective,
} from '@ods/system';
import { BinaryFileAttachmentContainerComponent } from './binary-file-attachment-container/binary-file-attachment-container.component';
import { BinaryFileContainerComponent } from './binary-file-container/binary-file-container.component';
......@@ -56,6 +57,7 @@ import { VerticalBinaryFileListComponent } from './vertical-binary-file-list/ver
SpinnerIconComponent,
CloseIconComponent,
DownloadButtonComponent,
TooltipDirective,
],
declarations: [
BinaryFileAttachmentContainerComponent,
......
......@@ -29,7 +29,7 @@
data-test-id="back-button"
class="back-button"
[attr.aria-label]="label"
[matTooltip]="label"
[tooltip]="label"
>
<mat-icon>arrow_back</mat-icon>
</a>
......@@ -24,11 +24,11 @@
import { getElementFromFixture } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon';
import { MatTooltipModule } from '@angular/material/tooltip';
import { RouterTestingModule } from '@angular/router/testing';
import { faker } from '@faker-js/faker';
import { TooltipDirective } from '@ods/system';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockModule } from 'ng-mocks';
import { MockDirective } from 'ng-mocks';
import { BackButtonComponent } from './back-button.component';
describe('BackButtonComponent', () => {
......@@ -41,7 +41,7 @@ describe('BackButtonComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [BackButtonComponent, MockModule(MatTooltipModule)],
declarations: [BackButtonComponent, MockDirective(TooltipDirective)],
imports: [MatIcon, RouterTestingModule],
}).compileComponents();
......
......@@ -28,7 +28,7 @@
data-test-id="open-url-in-new-window"
[href]="url"
[attr.aria-label]="text"
[matTooltip]="text"
[tooltip]="text"
[download]="targetName"
[color]="'primary'"
>
......
......@@ -30,7 +30,7 @@
toolTip ? toolTip : 'Icon Button mit einem ' + (icon ? icon : svgIcon) + ' Icon'
"
[disabled]="isDisabled"
[matTooltip]="toolTip"
[tooltip]="toolTip"
[matMenuTriggerFor]="matMenuTriggerFor"
(click)="clickEmitter.emit($event)"
type="button"
......
......@@ -25,8 +25,8 @@ import { createEmptyStateResource } from '@alfa-client/tech-shared';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
import { MatTooltipModule } from '@angular/material/tooltip';
import { MockComponent, MockModule } from 'ng-mocks';
import { TooltipDirective } from '@ods/system';
import { MockComponent, MockDirective, MockModule } from 'ng-mocks';
import { SpinnerComponent } from '../spinner/spinner.component';
import { IconButtonWithSpinnerComponent } from './icon-button-with-spinner.component';
......@@ -43,7 +43,7 @@ describe('IconButtonWithSpinnerComponent', () => {
IconButtonWithSpinnerComponent,
MatIcon,
MockComponent(SpinnerComponent),
MockModule(MatTooltipModule),
MockDirective(TooltipDirective),
MockModule(MatMenuModule),
],
});
......
/*
* Copyright (C) 2024 Das Land Schleswig-Holstein vertreten durch den
* Ministerpräsidenten des Landes Schleswig-Holstein
* Staatskanzlei
* Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
*
* Lizenziert unter der EUPL, Version 1.2 oder - sobald
* diese von der Europäischen Kommission genehmigt wurden -
* Folgeversionen der EUPL ("Lizenz");
* Sie dürfen dieses Werk ausschließlich gemäß
* dieser Lizenz nutzen.
* Eine Kopie der Lizenz finden Sie hier:
*
* https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
*
* Sofern nicht durch anwendbare Rechtsvorschriften
* gefordert oder in schriftlicher Form vereinbart, wird
* die unter der Lizenz verbreitete Software "so wie sie
* ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN -
* ausdrücklich oder stillschweigend - verbreitet.
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
import { MatTooltipDefaultOptions } from '@angular/material/tooltip';
export const matTooltipDefaultOptions: MatTooltipDefaultOptions = {
showDelay: 1500,
hideDelay: 0,
touchendHideDelay: 1500,
positionAtOrigin: true,
disableTooltipInteractivity: true,
};
......@@ -29,7 +29,7 @@
[href]="url"
[target]="targetName"
[attr.aria-label]="text"
[matTooltip]="tooltip"
[tooltip]="tooltip"
[color]="'primary'"
[title]="tooltip"
class="button"
......
......@@ -30,7 +30,7 @@
[color]="color"
[type]="type"
[disabled]="isDisabled"
[matTooltip]="toolTip"
[tooltip]="toolTip"
[class.with-text]="text"
(click)="clickEmitter.emit($event)"
>
......
......@@ -24,13 +24,13 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatButton } from '@angular/material/button';
import { MatRipple } from '@angular/material/core';
import { MatTooltipModule } from '@angular/material/tooltip';
import { createCommandResource } from 'libs/command-shared/test/command';
import { getDataTestClassOf } from 'libs/tech-shared/test/data-test';
import { MockComponent, MockModule } from 'ng-mocks';
import { MockComponent, MockDirective } from 'ng-mocks';
import { OzgcloudButtonContentComponent } from '../shared/ozgcloud-button-content/ozgcloud-button-content.component';
import { OzgcloudButtonWithSpinnerComponent } from './ozgcloud-button-with-spinner.component';
import { TooltipDirective } from '@ods/system';
import * as ResourceUtils from 'libs/tech-shared/src/lib/resource/resource.util';
describe('OzgcloudButtonWithSpinnerComponent', () => {
......@@ -45,7 +45,7 @@ describe('OzgcloudButtonWithSpinnerComponent', () => {
MatButton,
MatRipple,
OzgcloudButtonWithSpinnerComponent,
MockModule(MatTooltipModule),
MockDirective(TooltipDirective),
MockComponent(OzgcloudButtonContentComponent),
],
}).compileComponents();
......
......@@ -27,7 +27,7 @@
mat-icon-button
data-test-class="icon-button-primary"
[attr.aria-label]="ariaLabel"
[matTooltip]="tooltip"
[tooltip]="tooltip"
(click)="clickEmitter.emit($event)"
color="primary"
type="button"
......
......@@ -26,9 +26,9 @@ import { getElementFromFixture } from '@alfa-client/test-utils';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon';
import { MatIconTestingModule } from '@angular/material/icon/testing';
import { MatTooltipModule } from '@angular/material/tooltip';
import { TooltipDirective } from '@ods/system';
import { getDataTestClassOf } from 'libs/tech-shared/test/data-test';
import { MockComponent, MockModule } from 'ng-mocks';
import { MockComponent, MockDirective } from 'ng-mocks';
import { OzgcloudIconButtonPrimaryComponent } from './ozgcloud-icon-button-primary.component';
jest.mock('@alfa-client/tech-shared');
......@@ -41,11 +41,7 @@ describe('IconButtonPrimaryWithSpinnerComponent', () => {
beforeEach(() => {
TestBed.configureTestingModule({
imports: [MatIconTestingModule],
declarations: [
OzgcloudIconButtonPrimaryComponent,
MockComponent(MatIcon),
MockModule(MatTooltipModule),
],
declarations: [OzgcloudIconButtonPrimaryComponent, MockComponent(MatIcon), MockDirective(TooltipDirective)],
});
});
......
......@@ -30,7 +30,7 @@
[color]="color"
[type]="type"
[disabled]="isDisabled"
[matTooltip]="toolTip"
[tooltip]="toolTip"
[class.with-text]="text"
(click)="clickEmitter.emit($event)"
>
......
......@@ -24,13 +24,13 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatButton } from '@angular/material/button';
import { MatRipple } from '@angular/material/core';
import { MatTooltipModule } from '@angular/material/tooltip';
import { createCommandResource } from 'libs/command-shared/test/command';
import { getDataTestClassOf } from 'libs/tech-shared/test/data-test';
import { MockComponent, MockModule } from 'ng-mocks';
import { MockComponent, MockDirective } from 'ng-mocks';
import { OzgcloudButtonContentComponent } from '../shared/ozgcloud-button-content/ozgcloud-button-content.component';
import { OzgcloudStrokedButtonWithSpinnerComponent } from './ozgcloud-stroked-button-with-spinner.component';
import { TooltipDirective } from '@ods/system';
import * as ResourceUtils from 'libs/tech-shared/src/lib/resource/resource.util';
describe('OzgcloudStrokedButtonWithSpinnerComponent', () => {
......@@ -45,7 +45,7 @@ describe('OzgcloudStrokedButtonWithSpinnerComponent', () => {
MatButton,
MatRipple,
OzgcloudStrokedButtonWithSpinnerComponent,
MockModule(MatTooltipModule),
MockDirective(TooltipDirective),
MockComponent(OzgcloudButtonContentComponent),
],
}).compileComponents();
......
......@@ -28,9 +28,9 @@ import { EventEmitter } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatIcon } from '@angular/material/icon';
import { MatIconTestingModule } from '@angular/material/icon/testing';
import { MatTooltipModule } from '@angular/material/tooltip';
import { TooltipDirective } from '@ods/system';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockComponent, MockModule } from 'ng-mocks';
import { MockComponent, MockDirective } from 'ng-mocks';
import { OzgcloudPasteTextButtonComponent } from './ozgcloud-paste-text-button.component';
jest.mock('@alfa-client/tech-shared');
......@@ -55,7 +55,7 @@ describe('OzgcloudPasteTextButtonComponent', () => {
OzgcloudPasteTextButtonComponent,
MockComponent(MatIcon),
MockComponent(OzgcloudIconButtonPrimaryComponent),
MockModule(MatTooltipModule),
MockDirective(TooltipDirective),
],
}).compileComponents();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment