chore: update demo site

main
Johnny 1 day ago
parent 47b41bce85
commit 5562282822

@ -0,0 +1,3 @@
# Memos API Design
This API design should follow the guidelines and best practices outlined in the [Google API Improvement Proposals (AIPs)](https://google.aip.dev/).

@ -70,12 +70,6 @@ func (s *APIV1Service) SetWorkspaceSetting(ctx context.Context, request *v1pb.Se
}
updateSetting := convertWorkspaceSettingToStore(request.Setting)
// Don't allow to update workspace general setting in demo mode.
// Such as disallow user registration, disallow password auth, etc.
if s.Profile.Mode == "demo" && updateSetting.Key == storepb.WorkspaceSettingKey_GENERAL {
return nil, status.Errorf(codes.InvalidArgument, "setting workspace setting is not allowed in demo mode")
}
workspaceSetting, err := s.Store.UpsertWorkspaceSetting(ctx, updateSetting)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to upsert workspace setting: %v", err)

@ -120,6 +120,7 @@ const WorkspaceSection = () => {
<div className="w-full flex flex-row justify-between items-center">
<span>{t("setting.workspace-section.disallow-user-registration")}</span>
<Switch
disabled={workspaceStore.state.profile.mode === "demo"}
checked={workspaceGeneralSetting.disallowUserRegistration}
onChange={(event) => updatePartialSetting({ disallowUserRegistration: event.target.checked })}
/>
@ -127,7 +128,7 @@ const WorkspaceSection = () => {
<div className="w-full flex flex-row justify-between items-center">
<span>{t("setting.workspace-section.disallow-password-auth")}</span>
<Switch
disabled={identityProviderList.length === 0 ? true : false}
disabled={workspaceStore.state.profile.mode === "demo" || identityProviderList.length === 0}
checked={workspaceGeneralSetting.disallowPasswordAuth}
onChange={(event) => updatePartialSetting({ disallowPasswordAuth: event.target.checked })}
/>

Loading…
Cancel
Save