Skip to content

Commit caa2599

Browse files
author
yuning
committed
Merge branch 'fix_obee_audit' into 'develop'
fix: add enableAuditLog See merge request taco/openblocks-oss!13
2 parents 4570028 + b654dea commit caa2599

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

client/packages/openblocks/src/constants/configConstants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
interface FeatureFlag {
22
enableCustomBranding: boolean;
33
enableEnterpriseLogin: boolean;
4+
enableAuditLog: boolean;
45
}
56

67
export interface BrandingConfig {

client/packages/openblocks/src/pages/datasource/datasourceEditPage.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,18 @@ export const DatasourceEditPage = () => {
274274
{trans("query.whitelistTooltip")}
275275
</div>
276276

277-
<span>{trans("query.address")}</span>
278-
{REACT_APP_SERVER_IPS.split(",")
279-
.filter((s) => s)
280-
.map((ip, i) => (
281-
<IPWrapper key={i}>
282-
{ip} <CopyTextButton text={ip} />
283-
</IPWrapper>
284-
))}
277+
{REACT_APP_SERVER_IPS && (
278+
<>
279+
<span>{trans("query.address")}</span>
280+
{REACT_APP_SERVER_IPS.split(",")
281+
.filter((s) => s)
282+
.map((ip, i) => (
283+
<IPWrapper key={i}>
284+
{ip} <CopyTextButton text={ip} />
285+
</IPWrapper>
286+
))}
287+
</>
288+
)}
285289
</Whitelist>
286290
)}
287291
</Body>

client/packages/openblocks/src/pages/setting/settingHome.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AdvancedSetting } from "./advanced/AdvancedSetting";
55
import { currentOrgAdmin } from "util/permissionUtils";
66
import { trans } from "i18n";
77
import AuditSetting from "@openblocks-ee/pages/setting/audit";
8-
import { developEnv, isEE, isEnterpriseMode, isSelfDomain } from "util/envUtils";
8+
import { developEnv, isEE, isEnterpriseMode, isSelfDomain, showAuditLog } from "util/envUtils";
99
import { TwoColumnSettingPageContent } from "./styled";
1010
import SubSideBar from "components/layout/SubSideBar";
1111
import { Menu } from "openblocks-design";
@@ -42,7 +42,7 @@ export function SettingHome() {
4242
key: SettingPageEnum.Organization,
4343
label: trans("settings.organization"),
4444
},
45-
...(isEE() && currentOrgAdmin(user)
45+
...(showAuditLog(config) && currentOrgAdmin(user)
4646
? [
4747
{
4848
key: SettingPageEnum.Audit,

client/packages/openblocks/src/util/envUtils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export function isSelfDomain(config?: SystemConfig) {
2929
return config?.selfDomain;
3030
}
3131

32+
export function showAuditLog(config?: SystemConfig) {
33+
return config?.featureFlag.enableAuditLog;
34+
}
35+
3236
export function useCloudHosting() {
3337
const systemConfig = useSelector(selectSystemConfig);
3438
return systemConfig?.cloudHosting ?? true;

0 commit comments

Comments
 (0)