Skip to content

Commit

Permalink
Task #220193:Write script to copy all files of webapp in dist except …
Browse files Browse the repository at this point in the history
…index.ejs
  • Loading branch information
ManojNathIC committed May 30, 2024
1 parent 07d89aa commit f9a855e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
6 changes: 6 additions & 0 deletions packages/nulp_elite/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import Message from "pages/connections/message";
import Terms from "pages/terms";
import SelectPreference from "pages/SelectPreference";
import Chat from "pages/connections/chat";
import SampleComponent from "components/SampleComponent";
const urlConfig = require("./configs/urlConfig.json");

function App() {
Expand Down Expand Up @@ -159,6 +160,11 @@ function App() {
path: "/chat",
component: Chat,
},
{
moduleName: "nulp_elite",
path: "/webapp/demo",
component: SampleComponent,
},
];

initializeI18n(
Expand Down
6 changes: 3 additions & 3 deletions packages/nulp_elite/src/pages/profile/learningHistory.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ const LearningHistory = () => {
<Box style={{ margin: "20px 0" }}>
<Filter
options={[
{ label: "Ongoing", value: 0 },
{ label: "Completed", value: 1 },
{ label: "Expired", value: 2 },
{ label: "Ongoing", value: 1 },
{ label: "Completed", value: 2 },
{ label: "Expired", value: 0 },
]}
label="Filter by Status"
onChange={handleFilterChange}
Expand Down
11 changes: 9 additions & 2 deletions scripts/pack-prod-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ cd prod-build && tar -cf ../shiksha-ui.tar . && cd ../
if [ ! -d "../dist" ]; then
mkdir ../dist
fi
cp -r prod-build/* ../dist/
if [ ! -d "../dist/webapp" ]; then
mkdir ../dist/webapp
fi

cp -r prod-build/* ../dist/webapp/

find ../dist -type f -name 'index.html' -exec bash -c 'mv "$1" "${1%.html}.ejs" && sed -i "/<body>/s|<body>|&\
<input type=\"hidden\" id=\"userId\" value=\"<%=userId%>\" />\
<input type=\"hidden\" id=\"userSid\" value=\"<%=userSid%>\" />\
Expand Down Expand Up @@ -46,7 +51,6 @@ find ../dist -type f -name 'index.html' -exec bash -c 'mv "$1" "${1%.html}.ejs"
<input type=\"hidden\" id=\"sunbirdDefaultFileSize\" value=\"<%=sunbirdDefaultFileSize%>\" />\
<input type=\"hidden\" id=\"reportsLocation\" value=\"<%=reportsLocation%>\" />\
<input type=\"hidden\" id=\"previewCdnUrl\" value=\"<%=previewCdnUrl%>\" />\
<input type=\"hidden\" id=\"cdnWorking\" value=\"<%=cdnWorking%>\" />\
<input type=\"hidden\" id=\"offlineDesktopAppTenant\" value=\"<%=offlineDesktopAppTenant%>\" />\
<input type=\"hidden\" id=\"offlineDesktopAppVersion\" value=\"<%=offlineDesktopAppVersion%>\" />\
<input type=\"hidden\" id=\"offlineDesktopAppReleaseDate\" value=\"<%=offlineDesktopAppReleaseDate%>\" />\
Expand All @@ -69,3 +73,6 @@ find ../dist -type f -name 'index.html' -exec bash -c 'mv "$1" "${1%.html}.ejs"
<input type=\"hidden\" id=\"sunbirdCollectionChildrenLimit\" value=\"<%=sunbirdCollectionChildrenLimit%>\" />\
<input type=\"hidden\" id=\"uciBotPhoneNumber\" value=\"<%=uciBotPhoneNumber%>\" />\
|" "${1%.html}.ejs"' _ {} \;

# rm ../dist/webapp/index.ejs # need to uncomment this line when dev deployment
cp -r ../dist/webapp/* ../dist/

0 comments on commit f9a855e

Please sign in to comment.