diff --git a/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Addresses.csv b/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Addresses.csv new file mode 100644 index 0000000000..bac27500cf --- /dev/null +++ b/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Addresses.csv @@ -0,0 +1,5 @@ +ID,street,town_ID +1,6 Place des Vosges,1 +2,Church Street,2 +3,North Street,3 +4,King Street,4 \ No newline at end of file diff --git a/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Authors.csv b/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Authors.csv index 9b418c17f2..d0f9f0c48c 100644 --- a/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Authors.csv +++ b/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Authors.csv @@ -1,5 +1,6 @@ -ID,name,dateOfBirth,placeOfBirth,dateOfDeath,placeOfDeath -101,Emily Brontë,1818-07-30,"Thornton, Yorkshire",1848-12-19,"Haworth, Yorkshire" -107,Charlotte Brontë,1818-04-21,"Thornton, Yorkshire",1855-03-31,"Haworth, Yorkshire" -150,Edgar Allen Poe,1809-01-19,"Boston, Massachusetts",1849-10-07,"Baltimore, Maryland" -170,Richard Carpenter,1929-08-14,"King’s Lynn, Norfolk",2012-02-26,"Hertfordshire, England" +ID,name,dateOfBirth,placeOfBirth,dateOfDeath,placeOfDeath,address_ID +10,Victor Hugo,1802-02-26,"Besançon, Franche-Comté",1885-05-22,"Paris, Île-de-France",1 +101,Emily Brontë,1818-07-30,"Thornton, Yorkshire",1848-12-19,"Haworth, Yorkshire",2 +107,Charlotte Brontë,1818-04-21,"Thornton, Yorkshire",1855-03-31,"Haworth, Yorkshire",2 +150,Edgar Allen Poe,1809-01-19,"Boston, Massachusetts",1849-10-07,"Baltimore, Maryland",3 +170,Richard Carpenter,1929-08-14,"King’s Lynn, Norfolk",2012-02-26,"Hertfordshire, England",4 diff --git a/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Books.csv b/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Books.csv index d9cc9ee2ee..87ff63081e 100644 --- a/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Books.csv +++ b/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Books.csv @@ -4,3 +4,4 @@ ID,title,descr,author_ID,stock,price,currency_code,genre_ID 251,The Raven,"""The Raven"" is a narrative poem by American writer Edgar Allan Poe. First published in January 1845, the poem is often noted for its musicality, stylized language, and supernatural atmosphere. It tells of a talking raven's mysterious visit to a distraught lover, tracing the man's slow fall into madness. The lover, often identified as being a student, is lamenting the loss of his love, Lenore. Sitting on a bust of Pallas, the raven seems to further distress the protagonist with its constant repetition of the word ""Nevermore"". The poem makes use of folk, mythological, religious, and classical references.",150,333,13.13,USD,16aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa 252,Eleonora,"""Eleonora"" is a short story by Edgar Allan Poe, first published in 1842 in Philadelphia in the literary annual The Gift. It is often regarded as somewhat autobiographical and has a relatively ""happy"" ending.",150,555,14,USD,15aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa 271,Catweazle,"Catweazle is a British fantasy television series, starring Geoffrey Bayldon in the title role, and created by Richard Carpenter for London Weekend Television. The first series, produced and directed by Quentin Lawrence, was screened in the UK on ITV in 1970. The second series, directed by David Reid and David Lane, was shown in 1971. Each series had thirteen episodes, most but not all written by Carpenter, who also published two books based on the scripts.",170,22,150,JPY,13aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa +281,Les Misérables,"Les Misérables (French pronunciation: ​[le mizeʁabl]) is a French historical novel by Victor Hugo, first published in 1862, that is considered one of the greatest novels of the 19th century. In the English-speaking world, the novel is usually referred to by its original French title, although it is sometimes translated as The Miserable Ones, The Wretched, or The Poor Ones. The story examines the nature of law and grace, and expounds upon the history of France, the architecture and urban design of Paris, politics, moral philosophy, antimonarchism, justice, religion, and the types and nature of romantic and familial love.",10,33,20.20,EUR,12aaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa \ No newline at end of file diff --git a/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Towns.csv b/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Towns.csv new file mode 100644 index 0000000000..882b2840a3 --- /dev/null +++ b/.vitepress/lib/cds-playground/templates/bookshop/db/data/sap.capire.bookshop-Towns.csv @@ -0,0 +1,5 @@ +ID,name,zip,country +1,Paris,75000,France +2,Thornton,NN14,UK +3,Boston,02108,USA +4,King’s Lynn,PE30,UK \ No newline at end of file diff --git a/.vitepress/lib/cds-playground/templates/bookshop/db/schema.cds b/.vitepress/lib/cds-playground/templates/bookshop/db/schema.cds index 8c510a3599..763744a288 100644 --- a/.vitepress/lib/cds-playground/templates/bookshop/db/schema.cds +++ b/.vitepress/lib/cds-playground/templates/bookshop/db/schema.cds @@ -27,6 +27,23 @@ entity Authors { age = years_between(dateOfBirth, coalesce(dateOfDeath, date( $now ))); } +extend Authors with { + address : Association to Addresses; +} + +entity Addresses { + key ID : Integer; + street : String; + town : Association to Towns; +} + +entity Towns { + key ID : Integer; + name : String; + zip : String; + country : String; +} + /** Hierarchically organized Code List for Genres */ entity Genres : cuid, sap.common.CodeList { parent : Association to Genres; diff --git a/.vitepress/lib/code-groups/restoreCodeGroupPreferences.js b/.vitepress/lib/code-groups/restoreCodeGroupPreferences.js index 1268e3823b..f7cd50bad1 100644 --- a/.vitepress/lib/code-groups/restoreCodeGroupPreferences.js +++ b/.vitepress/lib/code-groups/restoreCodeGroupPreferences.js @@ -44,6 +44,10 @@ if (tabs.length === 0) return + // Skip code groups unrelated to the OS/runtime/cloud-runtime dimensions (e.g. file-path + // tabs), otherwise they'd be forced back to their first tab on every re-init. + if (!tabs.some((tab) => getTabDimension(tab))) return // eslint-disable-line no-undef + const selectedTab = getBestTab(tabs, activeTabs) // eslint-disable-line no-undef const selectedIndex = tabs.indexOf(selectedTab) diff --git a/.vitepress/lib/code-groups/useCodeGroupSync.ts b/.vitepress/lib/code-groups/useCodeGroupSync.ts index 8efdbbd3c7..f2a9544e1a 100644 --- a/.vitepress/lib/code-groups/useCodeGroupSync.ts +++ b/.vitepress/lib/code-groups/useCodeGroupSync.ts @@ -12,6 +12,7 @@ import { addActiveTab, getActiveTabsByDimension, getBestTab, + getTabDimension, setActiveTab, tabsMatch } from './shared.js' @@ -47,6 +48,11 @@ function findCodeGroups(): CodeGroupInfo[] { function applyPreference(codeGroup: CodeGroupInfo): void { const { element, tabs } = codeGroup + + // Skip code groups unrelated to the OS/runtime/cloud-runtime dimensions (e.g. file-path + // tabs), otherwise they'd be forced back to their first tab on every re-init. + if (!tabs.some((tab) => getTabDimension(tab))) return + const selectedTab = getBestTab( tabs, getActiveTabsByDimension((window as any).__CODE_GROUP_ACTIVE_TABS__) @@ -88,6 +94,12 @@ function handleDocumentClick(event: Event): void { const tabLabel = (label.textContent || '').trim() if (!tabLabel) return + // Only tabs that belong to a recognized dimension (OS/runtime/cloud-runtime) should be + // synced across the page. Otherwise unrelated code groups sharing a "/" path segment + // (e.g. "srv/admin-service.cds" vs. "srv/cat-service.cds") get fuzzy-matched and forced + // into the wrong active tab. + if (!getTabDimension(tabLabel)) return + const clickedRect = label.getBoundingClientRect() syncTabs(tabLabel) diff --git a/.vitepress/theme/components/cds-playground/LiveCode.vue b/.vitepress/theme/components/cds-playground/LiveCode.vue index d10b51179f..4706fbdf5f 100644 --- a/.vitepress/theme/components/cds-playground/LiveCode.vue +++ b/.vitepress/theme/components/cds-playground/LiveCode.vue @@ -28,6 +28,14 @@
+
@@ -56,15 +64,40 @@
+ +
+
+ +
+ +
+
+ + {{ tab.kind }} + +
+
+
+