Skip to content

Commit

Permalink
Merge branch 'main' into DS-265-language-badge-check
Browse files Browse the repository at this point in the history
  • Loading branch information
videoeero committed Apr 11, 2024
2 parents d3a0e47 + 94767e8 commit 4f5d9ec
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class MultiselectOptionComponent extends SelectOptionBaseDirective implem

this._parent = this._parentMultiselect;

this._id = this._idService.getNewSelectOptionid(
this._id = this._idService.getNewSelectOptionId(
'multiselect',
this._parent.id,
this._parentGroup?.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class SelectOptionComponent extends SelectOptionBaseDirective implements

this._parent = _parentSelect;

this._id = this._idService.getNewSelectOptionid(
this._id = this._idService.getNewSelectOptionId(
'select',
this._parent.id,
this._parentGroup?.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('FudisIdServiceService', () => {

expect(detailsId).toEqual(`${groupId}-details-${index}`);
} else {
const optionId = idService.getNewSelectOptionid(parentType, parentId, groupId);
const optionId = idService.getNewSelectOptionId(parentType, parentId, groupId);

expect(optionId).toEqual(`${groupId}-option-${index}`);
}
Expand Down Expand Up @@ -146,14 +146,13 @@ describe('FudisIdServiceService', () => {

if (grandParentType !== 'description-list') {
for (let index = 1; index <= 3; index += 1) {
const nonGroupedOptionId = idService.getNewSelectOptionid(grandParentType, newId);
const nonGroupedOptionId = idService.getNewSelectOptionId(grandParentType, newId);
expect(nonGroupedOptionId).toEqual(`${newId}-option-${index}`);
}
}
}
});
};
// TODO: Write tests for getNewGrandChildId

beforeEach(() => {
TestBed.configureTestingModule({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export class FudisIdService {
/**
* Get an id and add it to collection for Select Options --> fudis-select-4-group-2-option-1
*/
public getNewSelectOptionid(
public getNewSelectOptionId(
selectType: 'select' | 'multiselect',
selectParentId: string,
groupParentId?: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { TestBed } from '@angular/core/testing';
import { FudisTranslationService } from './translation.service';
import { en, fi, sv } from './translationKeys';

// TODO: Write tests
describe('TranslationService', () => {
let service: FudisTranslationService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export class FudisTranslationService {
*/
private _appLanguage = signal<FudisLanguageAbbr>('en');

/**
* Currently available languages in Fudis are Finnish, Swedish and English
*/
private _selectableLanguages = signal<FudisLanguageAbbr[]>(['fi', 'sv', 'en']);

/**
* Set language of repeated texts Fudis uses for its components. E. g. 'required' text of form components or help texts for screen readers for various buttons.
* Also as Error Summary Component reloads its errors if error's language has changed, here is defined component to NOT focus to the updated list on only language change.
Expand Down Expand Up @@ -49,11 +54,6 @@ export class FudisTranslationService {
return this._appTranslations.asReadonly();
}

/**
* Currently available languages in Fudis are Finnish, Swedish and English
*/
private _selectableLanguages = signal<FudisLanguageAbbr[]>(['fi', 'sv', 'en']);

/**
* Set which languages are visible in Language Badges
*/
Expand Down

0 comments on commit 4f5d9ec

Please sign in to comment.