Skip to content

Commit 7425815

Browse files
committed
feat: update migration handling and improve episode annotations
- Updated the migration script to ensure proper exit on completion. - Enhanced the Episode entity with additional annotations for better i18n support. - Bumped package versions in package.json and package-lock.json for dependencies. - Refactored Fiori annotations in show-fiori.cds to remove unnecessary facets. - Adjusted edit URLs in show-service.js for standalone app navigation. - Updated tests to reflect changes in edit URL structure. - Cleaned up shows.json by removing outdated entries and unnecessary data. - Removed commented-out code in scraper/index.js to streamline the script.
1 parent 849cb59 commit 7425815

13 files changed

Lines changed: 148 additions & 669 deletions

File tree

cap/_i18n/i18n.properties

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,9 @@ network = Network
107107
seasons = Seasons
108108
episode_count = Episode Count
109109
episodes = Episodes
110+
season_number = Season
111+
episode_number = Episode
112+
air_date = Air Date
113+
writer = Writer
114+
runtime = Runtime (min)
115+
timeline = Timeline

cap/app/init.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/* eslint-disable no-undef */
2+
/*eslint no-console: 0, no-unused-vars: 0, no-use-before-define: 0, no-redeclare: 0, no-shadow:0 */
3+
/*eslint-env es6 */
4+
sap.ui.require(["sap/ui/core/Core", "sap/ui/core/Component"], (oCore, Component) => {
5+
6+
sap.ushell.Container.createRenderer().placeAt('content')
7+
sap.ui
8+
.getCore()
9+
.getConfiguration()
10+
.setFlexibilityServices([{
11+
connector: "SessionStorageConnector"
12+
}])
13+
14+
})

cap/app/launchpadPage.html

Lines changed: 40 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,33 @@
1010
<script>
1111
window['sap-ushell-config'] = {
1212
defaultRenderer: 'fiori2',
13-
services: {
14-
NavTargetResolution: {
15-
config: {
16-
enableClientSideTargetResolution: true,
17-
applications: {
18-
'star-wars-people-Display': {
19-
additionalInformation: 'SAPUI5.Component=star.wars.people',
20-
applicationType: 'URL',
21-
url: './people/webapp/',
22-
navigationMode: 'embedded'
23-
},
24-
'star-wars-media-Display': {
25-
additionalInformation: 'SAPUI5.Component=star.wars.media',
26-
applicationType: 'URL',
27-
url: './media/webapp/',
28-
navigationMode: 'embedded'
29-
},
30-
'star-wars-film-Display': {
31-
additionalInformation: 'SAPUI5.Component=star.wars.film',
32-
applicationType: 'URL',
33-
url: './film/webapp/',
34-
navigationMode: 'embedded'
35-
},
36-
'star-wars-show-Display': {
37-
additionalInformation: 'SAPUI5.Component=star.wars.show',
38-
applicationType: 'URL',
39-
url: './show/webapp/',
40-
navigationMode: 'embedded'
41-
}
42-
}
43-
}
13+
applications: {
14+
'star-wars-people-Display': {
15+
additionalInformation: 'SAPUI5.Component=star.wars.people',
16+
applicationType: 'URL',
17+
url: './people/webapp/',
18+
navigationMode: 'embedded'
4419
},
20+
'star-wars-media-Display': {
21+
additionalInformation: 'SAPUI5.Component=star.wars.media',
22+
applicationType: 'URL',
23+
url: './media/webapp/',
24+
navigationMode: 'embedded'
25+
},
26+
'star-wars-film-Display': {
27+
additionalInformation: 'SAPUI5.Component=star.wars.film',
28+
applicationType: 'URL',
29+
url: './film/webapp/',
30+
navigationMode: 'embedded'
31+
},
32+
'star-wars-show-Display': {
33+
additionalInformation: 'SAPUI5.Component=star.wars.show',
34+
applicationType: 'URL',
35+
url: './show/webapp/',
36+
navigationMode: 'embedded'
37+
}
38+
},
39+
services: {
4540
LaunchPage: {
4641
adapter: {
4742
config: {
@@ -102,35 +97,21 @@
10297
}
10398
</script>
10499
<script src="https://ui5.sap.com/1.141.3/test-resources/sap/ushell/bootstrap/sandbox.js"></script>
100+
<script
101+
src="https://ui5.sap.com/1.141.3/resources/sap-ui-core.js"
102+
id="sap-ui-bootstrap"
103+
data-sap-ui-libs="sap.m, sap.ushell, sap.fe.templates"
104+
data-sap-ui-compatVersion="edge"
105+
data-sap-ui-frameOptions="allow"
106+
data-sapui-bindingSyntax="complex"
107+
data-sap-ui-async="true"
108+
></script>
105109
<script>
106-
function themeCalc() {
107-
try {
108-
let theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "sap_horizon_dark" :
109-
"sap_horizon"
110-
return theme
111-
} catch (ex) {
112-
console.warn("window.matchMedia not supported - keep default theme")
113-
return "sap_horizon"
114-
}
115-
}
116-
117-
function ui5Bootstrap() {
118-
const s = document.createElement('script')
119-
s.setAttribute('src', "https://ui5.sap.com/1.141.3/resources/sap-ui-core.js")
120-
s.setAttribute('id', "sap-ui-bootstrap")
121-
s.setAttribute('data-sap-ui-libs', "sap.m, sap.ushell, sap.fe.templates")
122-
s.setAttribute('data-sap-ui-compatVersion', "edge")
123-
s.setAttribute('data-sapui-frameOptions', "allow")
124-
s.setAttribute('data-sapui-bindingSyntax', "complex")
125-
s.setAttribute('data-sap-ui-async', "true")
126-
s.setAttribute('data-sap-ui-theme', themeCalc())
127-
document.head.appendChild(s)
128-
}
129-
try {
130-
ui5Bootstrap()
131-
} catch (error) {
132-
console.log(error)
133-
}
110+
sap.ui.getCore().attachInit(function () {
111+
sap.ushell.Container.createRenderer("fiori2", true).then(function (oRenderer) {
112+
oRenderer.placeAt('content')
113+
})
114+
})
134115
</script>
135116
</head>
136117

cap/convertData.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,9 @@ async function runMigration(options = {}) {
618618
}
619619

620620
if (require.main === module) {
621-
runMigration().catch(error => {
621+
runMigration().then(() => {
622+
process.exit(0)
623+
}).catch(error => {
622624
const log = cds.log('migration')
623625
log.error('Migration failed')
624626
log.error(error)

cap/db/schema.cds

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,17 @@ entity Episode : cuid, managed {
589589
timeline : String; // e.g. "19 BBY"
590590
}
591591

592+
annotate Episode with {
593+
title @title : '{i18n>title}';
594+
season_number @title : '{i18n>season_number}';
595+
episode_number @title : '{i18n>episode_number}';
596+
air_date @title : '{i18n>air_date}';
597+
director @title : '{i18n>director}';
598+
writer @title : '{i18n>writer}';
599+
runtime @title : '{i18n>runtime}';
600+
timeline @title : '{i18n>timeline}';
601+
}
602+
592603
entity Episode2People : cuid, managed { episode: Association to Episode; people: Association to People; }
593604
entity Episode2Planets : cuid, managed { episode: Association to Episode; planet: Association to Planet; }
594605
entity Episode2Starships : cuid, managed { episode: Association to Episode; starship: Association to Starship; }

cap/package-lock.json

Lines changed: 55 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)