Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
maciaszczykm committed Feb 27, 2024
1 parent ab80045 commit efbb357
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
5 changes: 1 addition & 4 deletions modules/web/pkg/locale/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,18 @@ func handleAny(c *gin.Context) {
}

func getSupportedLocales() (tags []language.Tag) {
// read config file
localesFile, err := os.ReadFile(args.LocaleConfig())
if err != nil {
klog.Warningf("Error when loading the localization configuration. Dashboard will not be localized. %s", err)
klog.Warningf("Dashboard will not be localized, cannot load config: %s", err)
return
}

// unmarshall
localization := Localization{}
err = json.Unmarshal(localesFile, &localization)
if err != nil {
klog.Warningf("%s %s", string(localesFile), err)
}

// filter locale keys
for _, translation := range localization.Translations {
tags = append(tags, language.Make(translation))
}
Expand Down
1 change: 0 additions & 1 deletion modules/web/pkg/settings/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ func init() {
router.Root().GET("/settings/cani", handleGetSettingsGlobalCanI)
router.Root().GET("/settings", handleGetSettingGlobal)
router.Root().PUT("/settings", handleSettingsGlobalSave)

router.Root().GET("/settings/pinnedresources/cani", handleGetSettingsGlobalCanI)
router.Root().GET("/settings/pinnedresources", handleSettingsGetPinned)
router.Root().PUT("/settings/pinnedresources", handleSettingsSavePinned)
Expand Down
2 changes: 1 addition & 1 deletion modules/web/src/common/services/global/globalsettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class GlobalSettingsService {
onSettingsUpdate = new ReplaySubject<void>();
onPageVisibilityChange = new EventEmitter<boolean>();

private readonly endpoint_ = '/settings';
private readonly endpoint_ = 'settings';
private settings_: GlobalSettings = DEFAULT_SETTINGS;
private unsubscribe_ = new Subject<void>();
private isInitialized_ = false;
Expand Down
2 changes: 1 addition & 1 deletion modules/web/src/common/services/global/pinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class PinnerService {
onPinUpdate = new Subject<void>();
private isInitialized_ = false;
private pinnedResources_: PinnedResource[] = [];
private readonly endpoint_ = '/settings/pinnedresources';
private readonly endpoint_ = 'settings/pinnedresources';

constructor(
private readonly dialog_: MatDialog,
Expand Down

0 comments on commit efbb357

Please sign in to comment.