Skip to content

Commit e218a35

Browse files
authored
Fix: Rename docs to catalog to keep routes consistent (SQLMesh#3391)
1 parent d1ffac0 commit e218a35

18 files changed

Lines changed: 439 additions & 423 deletions

File tree

docs/guides/ui.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ The UI modules are:
5656

5757
- [Code editor](#editor-module)
5858
- [Plan builder](#plan-module)
59-
- [Project documentation](#docs-module)
59+
- [Data catalog](#data-catalog-module)
6060
- [Table and column lineage](#lineage-module)
6161

6262
The screenshots in most examples below use the default `editor` mode.
@@ -75,7 +75,7 @@ The `editor` module will appear by default if the UI is started without specifyi
7575

7676
It also contains nine buttons:
7777

78-
1. Toggle Editor/Docs/Errors/Plan toggles among the editor module (default), docs module, errors view, and plan module. Errors view is only available if an error has occurred.
78+
1. Toggle Editor/Data Catalog/Errors/Plan toggles among the editor module (default), data catalog module, errors view, and plan module. Errors view is only available if an error has occurred.
7979
2. History navigation returns to previous views, similar to the back button in a web browser.
8080
3. Add new tab opens a new code editor window.
8181
4. Plan opens the plan module.
@@ -194,19 +194,19 @@ Click the blue `Apply Changes And Backfill` button to apply the plan and execute
194194

195195
![Plan after applying updated plan with modified model](./ui/ui-quickstart_apply-plan-dev-modified.png){ loading=lazy }
196196

197-
### Docs module
197+
### Data Catalog module
198198

199-
The docs module displays information about all your project's models in one interface.
199+
The data catalog module displays information about all your project's models in one interface.
200200

201201
A list of all models is displayed in the left-hand pane. You can filter models by name by typing in the field at the top of the pane.
202202

203203
When you choose a model, its query, lineage, and attributes are displayed. This example shows information from the [quickstart project](../quick_start.md) incremental model:
204204

205-
![Docs with incremental model selected](./ui/ui-guide_docs.png){ loading=lazy }
205+
![Data Catalog with incremental model selected](./ui/ui-guide_docs.png){ loading=lazy }
206206

207207
By default, the model definition source code is displayed. If you toggle to `Compiled Query`, it will display an example of the model query rendered with macro values substituted:
208208

209-
![Docs with compiled incremental model query](./ui/ui-guide_docs-compiled-query.png){ loading=lazy }
209+
![Data Catalog with compiled incremental model query](./ui/ui-guide_docs-compiled-query.png){ loading=lazy }
210210

211211
### Lineage module
212212

@@ -232,9 +232,9 @@ You may specify the UI mode as an option when you [start the UI on the command l
232232

233233
The UI modes contain these modules:
234234

235-
- `editor`: code editor, plan builder, project documentation, table and column lineage
236-
- `plan`: plan builder, project documentation, table and column lineage
237-
- `docs`: project documentation, table and column lineage
235+
- `editor`: code editor, plan builder, data catalog, table and column lineage
236+
- `plan`: plan builder, data catalog, table and column lineage
237+
- `catalog`: data catalog, table and column lineage
238238

239239
### Working with an IDE
240240

docs/quickstart/ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ The SQLMesh UI default view contains five panes:
166166

167167
It also contains nine buttons:
168168

169-
1. Toggle Editor/Docs/Errors toggles among the Code Editor (default), Docs, and Errors views. Errors view is only available if an error has occurred.
169+
1. Toggle Editor/Data Catalog/Errors toggles among the Code Editor (default), Data Catalog, and Errors views. Errors view is only available if an error has occurred.
170170
2. History navigation returns to previous views, similar to the back button in a web browser.
171171
3. Add new tab opens a new code editor window.
172172
4. Run plan command executes the [`sqlmesh plan` command](../reference/cli.md#plan).

sqlmesh/cli/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,9 @@ def info(obj: Context, skip_connection: bool, verbose: bool) -> None:
702702
)
703703
@click.option(
704704
"--mode",
705-
type=click.Choice(["ide", "default", "docs", "plan"], case_sensitive=False),
706-
default="default",
707-
help="Mode to start the UI in. Default: default",
705+
type=click.Choice(["ide", "catalog", "docs", "plan"], case_sensitive=False),
706+
default="ide",
707+
help="Mode to start the UI in. Default: ide",
708708
)
709709
@click.pass_context
710710
@error_handler

web/client/openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@
15921592
"enum": [
15931593
"editor",
15941594
"files",
1595-
"docs",
1595+
"data-catalog",
15961596
"plans",
15971597
"tests",
15981598
"audits",

web/client/src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function App(): JSX.Element {
3939
}
4040
}, [])
4141

42-
const router = getBrowserRouter(modules.list)
42+
const router = getBrowserRouter(modules)
4343

4444
return (
4545
<>

web/client/src/api/instance.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
import { isNil } from '@utils/index'
1+
import { isNil, isStringEmptyOrNil } from '@utils/index'
22
import { tableFromIPC } from 'apache-arrow'
33

4+
declare global {
5+
interface Window {
6+
__BASE_URL__?: string
7+
}
8+
}
9+
410
export interface ResponseWithDetail {
511
ok: boolean
612
detail?: string
@@ -121,7 +127,7 @@ function toRequestBody(obj: unknown): BodyInit {
121127
}
122128

123129
export function getUrlPrefix(): string {
124-
return (window as any).__BASE_URL__ ?? '/'
130+
return isStringEmptyOrNil(window.__BASE_URL__) ? '/' : window.__BASE_URL__
125131
}
126132

127133
export default fetchAPI

web/client/src/library/components/editor/EditorPreview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function EditorPreview({
5959
const [activeTabIndex, setActiveTabIndex] = useState(-1)
6060

6161
const modelExtensions = useSQLMeshModelExtensions(tab.file.path, model => {
62-
navigate(`${EnumRoutes.DocsModels}/${model.name}`)
62+
navigate(`${EnumRoutes.DataCatalogModels}/${model.name}`)
6363
})
6464

6565
const model = models.get(tab.file.path)

web/client/src/library/components/editor/EditorTabs.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default function EditorTabs(): JSX.Element {
7070
}
7171

7272
selectTab(newTab)
73-
}, [selectedFile])
73+
}, [selectedFile, modules])
7474

7575
useEffect(() => {
7676
if (isNil(lastSelectedModel)) return
@@ -132,7 +132,6 @@ function Tab({ tab, title }: { tab: EditorTab; title: string }): JSX.Element {
132132
const setSelectedFile = useStoreProject(s => s.setSelectedFile)
133133

134134
const activeTab = useStoreEditor(s => s.tab)
135-
const selectTab = useStoreEditor(s => s.selectTab)
136135
const closeTab = useStoreEditor(s => s.closeTab)
137136

138137
useEffect(() => {
@@ -178,7 +177,6 @@ function Tab({ tab, title }: { tab: EditorTab; title: string }): JSX.Element {
178177
onClick={(e: MouseEvent) => {
179178
e.stopPropagation()
180179

181-
selectTab(tab)
182180
setSelectedFile(tab.file)
183181
}}
184182
>

web/client/src/library/components/moduleNavigation/ModuleNavigation.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ export default function ModuleNavigation({
4646
iconActive={<FolderIcon className="min-w-6 w-6" />}
4747
/>
4848
)}
49-
{modules.hasDocs && (
49+
{modules.hasDataCatalog && (
5050
<ModuleLink
51-
title="Docs"
52-
to={EnumRoutes.Docs}
51+
title="Data Catalog"
52+
to={EnumRoutes.DataCatalog}
5353
icon={<OutlineDocumentTextIcon className="min-w-6 w-6" />}
5454
iconActive={<DocumentTextIcon className="min-w-6 w-6" />}
5555
className="relative rounded-xl my-1 px-2 py-1 h-10 hover:bg-neutral-5 dark:hover:bg-neutral-10 text-neutral-600 dark:text-neutral-300"

web/client/src/library/pages/docs/Docs.tsx renamed to web/client/src/library/pages/data-catalog/DataCatalog.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { useApiModel } from '@api/index'
2828
import Loading from '@components/loading/Loading'
2929
import Spinner from '@components/logo/Spinner'
3030

31-
export default function PageDocs(): JSX.Element {
31+
export default function PageDataCatalog(): JSX.Element {
3232
const { modelName = '' } = useParams()
3333

3434
const navigate = useNavigate()
@@ -76,7 +76,7 @@ export default function PageDocs(): JSX.Element {
7676

7777
if (isNil(model)) return
7878

79-
navigate(EnumRoutes.DocsModels + '/' + model.name)
79+
navigate(`${EnumRoutes.DataCatalogModels}/${model.name}`)
8080
}
8181

8282
function handleError(error: ErrorIDE): void {
@@ -87,11 +87,11 @@ export default function PageDocs(): JSX.Element {
8787
<div className="flex overflow-auto w-full h-full">
8888
{isNil(model) ? (
8989
<NotFound
90-
link={EnumRoutes.Docs}
90+
link={EnumRoutes.DataCatalog}
9191
description={
9292
isNil(modelName) ? undefined : `Model ${modelName} Does Not Exist`
9393
}
94-
message="Back To Docs"
94+
message="Back To Data Catalog"
9595
/>
9696
) : (
9797
<LineageFlowProvider

0 commit comments

Comments
 (0)