Skip to content

Commit

Permalink
Merge pull request #291 from suvarnakale/release-1.0.0
Browse files Browse the repository at this point in the history
 Issue #PS-2290 feat: path change in players integration in admin app
  • Loading branch information
itsvick authored Nov 5, 2024
2 parents af50c8f + d23879b commit 40d9763
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
8 changes: 8 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ const nextConfig = {
source: "/assets/pdfjs/:path*", // Match any URL starting with /workspace/content/assets/
destination: `${process.env.WORKSPACE_BASE_URL}/assets/pdfjs/:path*`, // Serve the assets from the public folder
},
{
source: "/play/content/assets/pdfjs/:path*", // Match any URL starting with /workspace/content/assets/
destination: `${process.env.WORKSPACE_BASE_URL}/assets/pdfjs/:path*`, // Serve the assets from the public folder
},
{
source: "/play/content/assets/:path*", // Match any URL starting with /workspace/content/assets/
destination: `${process.env.WORKSPACE_BASE_URL}/assets/:path*`, // Serve the assets from the public folder
},
{
source: "/action/content/v3/upload/url/:identifier*", // Match content upload with 'url' in the path
destination: `${process.env.WORKSPACE_BASE_URL}/api/proxy?path=/action/content/v3/upload/url/:identifier*`, // Forward to proxy route with path as query param
Expand Down
7 changes: 1 addition & 6 deletions src/components/ResourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@ const ResourceCard: React.FC<ResourceCardProps> = ({
identifier,
}) => {
const openPlayers = () => {
console.log("open players");
console.log("identifier", identifier);
router.push({
pathname: "/players",
query: { identifier: identifier },
});
router.push(`/play/content/${identifier}`);
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,20 @@ const players: React.FC<SunbirdPlayerProps> = () => {
return !loading ? <SunbirdPlayers player-config={playerConfig} /> : null;
};

export async function getStaticProps({ locale }: any) {
export async function getStaticPaths() {
return {
paths: [],
fallback: "blocking",
};
}

export async function getStaticProps({ locale, params }: any) {
const { identifier } = params;

return {
props: {
noLayout: true,
identifier,
...(await serverSideTranslations(locale, ["common"])),
},
};
Expand Down

0 comments on commit 40d9763

Please sign in to comment.