Fix localization bug (#747)

* wip provider details

provider details wip

move files wip

wip

wip all provider details

remove controllers

save and update working

address console warnings

remove log stmt

update test

keep aes only

remove comments

remove unused hook and function

remove unused props

revert ldap logs

fix localization bug

remove files

* format
This commit is contained in:
Jenny 2021-07-01 12:44:36 -04:00 committed by GitHub
parent da8bc7c829
commit 1fe7e4ccab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 13 deletions

View file

@ -23,6 +23,7 @@ import { useAdminClient } from "../context/auth/AdminClient";
import { ListEmptyState } from "../components/list-empty-state/ListEmptyState";
import { AddMessageBundleModal } from "./AddMessageBundleModal";
import { useAlerts } from "../components/alert/Alerts";
import { useRealm } from "../context/realm-context/RealmContext";
type LocalizationTabProps = {
save: (realm: RealmRepresentation) => void;
@ -58,8 +59,7 @@ export const LocalizationTab = ({
const themeTypes = useServerInfo().themes!;
const bundleForm = useForm<BundleForm>({ mode: "onChange" });
const { addAlert } = useAlerts();
console.log(realm.supportedLocales);
const { realm: currentRealm } = useRealm();
const watchSupportedLocales = useWatch({
control,
@ -73,14 +73,8 @@ export const LocalizationTab = ({
defaultValue: realm?.internationalizationEnabled,
});
console.log("ok", realm);
const loader = async () => {
if (realm) {
// if(realm.supportedLocales?.length === 0) {
// return [[]];
// }
// else {
const result = await adminClient.realms.getRealmLocalizationTexts({
realm: realm.realm!,
selectedLocale: getValues("defaultLocale") || "en",
@ -88,7 +82,6 @@ export const LocalizationTab = ({
return Object.keys(result).map((key) => [key, result[key]]);
}
// }
return [[]];
};
@ -103,7 +96,7 @@ export const LocalizationTab = ({
});
await adminClient.realms.addLocalization(
{
realm: realm.realm!,
realm: currentRealm!,
selectedLocale: getValues("defaultLocale") || "en",
key: pair.key,
},
@ -111,7 +104,7 @@ export const LocalizationTab = ({
);
adminClient.setConfig({
realmName: realm.realm,
realmName: currentRealm!,
});
refresh();
addAlert(t("realm-settings:pairCreatedSuccess"), AlertVariant.success);

View file

@ -36,8 +36,7 @@ export const RSAModal = ({
handleModalToggle,
open,
refresh,
}: // save,
RSAModalProps) => {
}: RSAModalProps) => {
const { t } = useTranslation("groups");
const serverInfo = useServerInfo();
const adminClient = useAdminClient();