Skip to content

Commit

Permalink
DS-257: cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
videoeero committed Apr 10, 2024
1 parent 4c2813b commit 691f197
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { hasAtLeastOneRequiredOrMinValidator } from '../../../utilities/form/get
import { FormComponent } from '../form/form.component';
import { FudisIdService } from '../../../services/id/id.service';
import { FudisTranslationService } from '../../../services/translation/translation.service';
import { FudisFocusService } from '../../../services/focus/focus.service';

@Component({
selector: 'fudis-checkbox-group',
Expand All @@ -32,10 +31,9 @@ export class CheckboxGroupComponent extends FieldSetBaseDirective implements OnI
@Host() @Optional() protected _parentForm: FormComponent | null,
_idService: FudisIdService,
_translationService: FudisTranslationService,
_focusService: FudisFocusService,
_changeDetectorRef: ChangeDetectorRef,
) {
super(_idService, _translationService, _focusService, _changeDetectorRef);
super(_idService, _translationService, _changeDetectorRef);
}
/**
* FormGroup for Checkbox group. If provided, provide also `controlName` for each Checkbox children.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ export class FieldSetComponent
constructor(
@Host() @Optional() private _parentForm: FormComponent | null,
private _errorSummaryService: FudisInternalErrorSummaryService,
private _focusService: FudisFocusService,
_idService: FudisIdService,
_translationService: FudisTranslationService,
_focusService: FudisFocusService,
_changeDetectorRef: ChangeDetectorRef,
) {
super(_idService, _translationService, _focusService, _changeDetectorRef);
super(_idService, _translationService, _changeDetectorRef);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ import { TooltipApiDirective } from '../../directives/tooltip/tooltip-api.direct
styleUrls: ['./language-badge-group.component.scss'],
})
export class LanguageBadgeGroupComponent extends TooltipApiDirective implements OnInit {
constructor(
private _translationService: FudisTranslationService,

) {
constructor(private _translationService: FudisTranslationService) {
super();
effect(() => {
this._languageOptions = _translationService.getBadgeGroupLanguages();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ng-container *ngIf="externalLink">
<a
fudisLink
[id]="id"
[color]="color"
[size]="size"
[classes]="['fudis-link__external']"
Expand Down Expand Up @@ -45,6 +46,7 @@
<ng-container *ngIf="(link || fragmentId) && !externalLink">
<a
fudisLink
[id]="id"
[color]="color"
[size]="size"
[classes]="['fudis-link__router']"
Expand All @@ -61,6 +63,7 @@
<ng-container *ngIf="href && !link && !externalLink">
<a
fudisLink
[id]="id"
[color]="color"
[size]="size"
[classes]="['fudis-link__href']"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { ContentDirective } from '../../content-projection/content/content.direc
import { getElement } from '../../../utilities/tests/utilities';
import { FudisGroupValidators } from '../../../utilities/form/groupValidators';
import { ValidatorErrorMessageComponent } from '../../../components/form/error-message/validator-error-message/validator-error-message.component';
import { FudisFocusService } from '../../../services/focus/focus.service';

@Component({
selector: 'fudis-mock-checkbox-group-component',
Expand Down Expand Up @@ -54,7 +53,6 @@ describe('FieldSetBaseDirective', () => {
let idService: FudisIdService;
let translationService: FudisTranslationService;
let changeDetectorRef: ChangeDetectorRef;
let focusService: FudisFocusService;

beforeEach(() => {
TestBed.configureTestingModule({
Expand Down Expand Up @@ -82,15 +80,13 @@ describe('FieldSetBaseDirective', () => {
idService = TestBed.inject(FudisIdService);
translationService = TestBed.inject(FudisTranslationService);
changeDetectorRef = TestBed.inject(ChangeDetectorRef);
focusService = TestBed.inject(FudisFocusService);
});

it('should create an instance', () => {
TestBed.runInInjectionContext(() => {
const directive: FieldSetBaseDirective = new FieldSetBaseDirective(
idService,
translationService,
focusService,
changeDetectorRef,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { FudisTranslationService } from '../../../services/translation/translati
import { FudisIdService } from '../../../services/id/id.service';
import { FudisIdParent } from '../../../types/id';
import { FormGroup } from '@angular/forms';
import { FudisFocusService } from '../../../services/focus/focus.service';

@Directive({
selector: '[fudisFieldSetBase]',
Expand All @@ -14,7 +13,6 @@ export class FieldSetBaseDirective extends TooltipApiDirective {
constructor(
protected _idService: FudisIdService,
protected _translationService: FudisTranslationService,
protected _focusService: FudisFocusService,
protected _changeDetectorRef: ChangeDetectorRef,
) {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export class LinkDirective extends LinkApiDirective implements OnInit, OnChanges
} else {
this.id = this._idService.getNewId('link');
}

this._bindedElement.nativeElement.setAttribute('id', this.id);
}

ngOnChanges(changes: FudisComponentChanges<LinkDirective>): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FudisFocusService } from './focus.service';
import { Component } from '@angular/core';
// import { getElement } from '../../utilities/tests/utilities';
import { ButtonComponent } from '../../components/button/button.component';
import { LinkComponent } from '../../components/link/link.component';
import { IconComponent } from '../../components/icon/icon.component';
Expand Down Expand Up @@ -29,7 +28,6 @@ class MockFocusComponent {
focusedId: string;

handleFocus(id: string) {
console.log('hellou!!!!!!!!');
this.focusedId = id;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ describe('TranslationService', () => {
it('should be created', () => {
expect(service).toBeTruthy();
});

// describe('default values', () => {
// it('should ', () => {});

// it('should ', () => {});
// });
});

0 comments on commit 691f197

Please sign in to comment.