-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(admin-ui): Enable ui language config & selection
Relates to #264
- Loading branch information
1 parent
df88d58
commit aa4452e
Showing
29 changed files
with
193 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
packages/admin-ui/src/lib/core/src/common/utilities/get-default-currency.ts
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
packages/admin-ui/src/lib/core/src/common/utilities/get-default-language.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { DEFAULT_LANGUAGE } from '../../app.config'; | ||
import { getAppConfig } from '../../app.config'; | ||
import { LanguageCode } from '../generated-types'; | ||
|
||
export function getDefaultLanguage(): LanguageCode { | ||
return DEFAULT_LANGUAGE; | ||
return getAppConfig().defaultLanguage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
packages/admin-ui/src/lib/core/src/components/app-shell/app-shell.component.spec.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ore/src/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<ng-template vdrDialogTitle>{{ 'common.select-display-language' | translate }}</ng-template> | ||
|
||
<button *ngFor="let code of availableLanguages" class="btn btn-link btn-sm" (click)="setLanguage(code)"> | ||
<clr-icon [attr.shape]="code === currentLanguage ? 'dot-circle' : 'circle'"></clr-icon> | ||
{{ code | uppercase }} ({{ 'lang.' + code | translate }}) | ||
</button> |
3 changes: 3 additions & 0 deletions
3
...ore/src/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:host { | ||
} | ||
|
20 changes: 20 additions & 0 deletions
20
.../core/src/components/ui-language-switcher-dialog/ui-language-switcher-dialog.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
|
||
import { LanguageCode } from '../../common/generated-types'; | ||
import { Dialog } from '../../providers/modal/modal.service'; | ||
|
||
@Component({ | ||
selector: 'vdr-ui-language-switcher', | ||
templateUrl: './ui-language-switcher-dialog.component.html', | ||
styleUrls: ['./ui-language-switcher-dialog.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class UiLanguageSwitcherDialogComponent implements Dialog<LanguageCode> { | ||
resolveWith: (result?: LanguageCode) => void; | ||
currentLanguage: LanguageCode; | ||
availableLanguages: LanguageCode[] = []; | ||
|
||
setLanguage(languageCode: LanguageCode) { | ||
this.resolveWith(languageCode); | ||
} | ||
} |
8 changes: 0 additions & 8 deletions
8
...n-ui/src/lib/core/src/components/ui-language-switcher/ui-language-switcher.component.html
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
...n-ui/src/lib/core/src/components/ui-language-switcher/ui-language-switcher.component.scss
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
...min-ui/src/lib/core/src/components/ui-language-switcher/ui-language-switcher.component.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
packages/admin-ui/src/lib/core/src/components/user-menu/user-menu.component.spec.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.