Remove work-related terminology by renaming "workspace" to "instance" across the entire application. This change better reflects that Memos is a self-hosted tool suitable for personal and non-work use cases. Breaking Changes: - API endpoints: /api/v1/workspace/* → /api/v1/instance/* - gRPC service: WorkspaceService → InstanceService - Proto types: WorkspaceSetting → InstanceSetting - Frontend translation keys: workspace-section → instance-section Backend Changes: - Renamed proto definitions and regenerated code - Updated all store layer methods and database drivers - Renamed service implementations and API handlers - Updated cache from workspaceSettingCache to instanceSettingCache Frontend Changes: - Renamed service client: workspaceServiceClient → instanceServiceClient - Updated all React components and state management - Refactored stores: workspace.ts → instance.ts - Updated all 32 locale translation files All tests pass and both backend and frontend build successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
789 B
Go
31 lines
789 B
Go
package test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
storepb "github.com/usememos/memos/proto/gen/store"
|
|
"github.com/usememos/memos/store"
|
|
)
|
|
|
|
func TestInstanceSettingV1Store(t *testing.T) {
|
|
ctx := context.Background()
|
|
ts := NewTestingStore(ctx, t)
|
|
instanceSetting, err := ts.UpsertInstanceSetting(ctx, &storepb.InstanceSetting{
|
|
Key: storepb.InstanceSettingKey_GENERAL,
|
|
Value: &storepb.InstanceSetting_GeneralSetting{
|
|
GeneralSetting: &storepb.InstanceGeneralSetting{
|
|
AdditionalScript: "",
|
|
},
|
|
},
|
|
})
|
|
require.NoError(t, err)
|
|
setting, err := ts.GetInstanceSetting(ctx, &store.FindInstanceSetting{
|
|
Name: storepb.InstanceSettingKey_GENERAL.String(),
|
|
})
|
|
require.NoError(t, err)
|
|
require.Equal(t, instanceSetting, setting)
|
|
ts.Close()
|
|
}
|