Skip to content

Commit

Permalink
Remove Template View Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrozadotdev committed Nov 10, 2023
1 parent f80c8f7 commit 0023349
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export interface BrandingConfig {
favicon?: string;
brandName?: string;
headerColor?: string;
enableTemplateViewMode?: boolean;
}

export type ConfigBaseInfo = {
Expand Down
10 changes: 0 additions & 10 deletions client/packages/openblocks/src/util/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import { checkIsMobile } from "util/commonUtils";
import { EditorContext } from "comps/editorState";
import { getDataSourceStructures } from "redux/selectors/datasourceSelectors";
import { DatasourceStructure } from "api/datasourceApi";
import { selectSystemConfig } from "redux/selectors/configSelectors";
import { getUser } from "redux/selectors/usersSelectors";

export const ForceViewModeContext = React.createContext<boolean>(false);

Expand Down Expand Up @@ -48,16 +46,8 @@ export function useMaxWidth() {
}

export function useTemplateViewMode() {
const systemConfig = useSelector(selectSystemConfig);
const user = useSelector(getUser);
const search = useLocation().search;

if(
systemConfig?.branding?.enableTemplateViewMode
&& user && user.isAnonymous
) {
return true
}
if (!useUserViewMode) {
return false;
}
Expand Down
1 change: 0 additions & 1 deletion proxy/src/api/pocketbase/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ export interface PBSettings<E = ConfigExpanded> extends BaseModel<E> {
logo: string;
icon: string;
header_color: string;
anon_template_view?: boolean;
home_page: string | null;
themes: string;
theme: string; // id
Expand Down
4 changes: 1 addition & 3 deletions proxy/src/mocks/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ export default [
mocker.get("/api/v1/configs", async () => {
const settingsResponse = await settings.get();
if (settingsResponse.data) {
const { org_name, header_color, logo, icon, anon_template_view } =
settingsResponse.data;
const { org_name, header_color, logo, icon } = settingsResponse.data;
return createDefaultResponse({
authConfigs: await getAuthConfigs(),
workspaceMode: "ENTERPRISE",
Expand All @@ -26,7 +25,6 @@ export default [
favicon: icon,
brandName: org_name,
headerColor: header_color,
enableTemplateViewMode: anon_template_view,
},
});
}
Expand Down
1 change: 0 additions & 1 deletion proxy/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export interface Settings extends BaseModel {
logo?: string;
icon?: string;
header_color?: string;
anon_template_view?: boolean;
home_page: Application | string | null;
themes: string;
theme: string; // id
Expand Down
10 changes: 0 additions & 10 deletions server/pb_hooks/pbl_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,6 @@ module.exports = {
pattern: "^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$",
},
},
{
system: false,
id: "bjehlimo",
name: "anon_template_view",
type: "bool",
required: false,
presentable: false,
unique: false,
options: {},
},
{
system: false,
id: "jzvxz6oh",
Expand Down

0 comments on commit 0023349

Please sign in to comment.