Skip to content

Commit

Permalink
Merge pull request #487 from OpenCatalogi/feature/DIMOC-298/OC-public…
Browse files Browse the repository at this point in the history
…ation-detail-page

feature/DIMOC-298/OC-publication-detail-page
  • Loading branch information
remko48 authored Sep 13, 2024
2 parents 46bccc3 + c482970 commit ab27281
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 701 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/opencatalogi-page-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ env: # Change these to your preferences any image url can also be a base encoded

ME_URL: "https://api.opencatalogi.nl/api/users/me"
API_URL: "https://api.opencatalogi.nl/api"
NEXTCLOUD_API_URL: "https://nextcloud.test.commonground.nu/index.php/apps/opencatalogi/api"
ADMIN_URL: "https://api.opencatalogi.nl/admin"
BASE_URL: "https://api.opencatalogi.nl"
FRONTEND_URL: "https://api.opencatalogi.nl"
Expand Down Expand Up @@ -83,6 +84,7 @@ jobs:
envkey_GATSBY_SHOW_THEME_SWITCHER: ${{ env.SHOW_THEME_SWITCHER }}
envkey_GATSBY_ME_URL: ${{ env.ME_URL }}
envkey_GATSBY_API_URL: ${{ env.API_URL }}
envkey_NEXTCLOUD_API_URL: ${{ env.NEXTCLOUD_API_URL }}
envkey_GATSBY_ADMIN_URL: ${{ env.ADMIN_URL }}
envkey_GATSBY_BASE_URL: ${{ env.BASE_URL }}
envkey_GATSBY_FRONTEND_URL: ${{ env.FRONTEND_URL }}
Expand Down
2 changes: 1 addition & 1 deletion pwa/src/apiService/apiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default class APIService {
const authorization = this.JWT ? { Authorization: "Bearer " + this.JWT } : {};

return axios.create({
baseURL: "http://localhost:8080/index.php/apps/opencatalogi/api",
baseURL: window.sessionStorage.getItem("NEXTCLOUD_API_URL") ?? "",
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Expand Down
8 changes: 8 additions & 0 deletions pwa/src/hooks/useEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export const useEnvironment = () => {
);
window.sessionStorage.setItem("API_URL", process.env.GATSBY_API_URL ?? "");
window.sessionStorage.setItem("BASE_URL", process.env.GATSBY_BASE_URL ?? "");
window.sessionStorage.setItem(
"NEXTCLOUD_API_URL",
process.env.GATSBY_NEXTCLOUD_BASE_URL ?? "http://nextcloud.local/index.php/apps/opencatalogi/api",
);
window.sessionStorage.setItem("NL_DESIGN_THEME_CLASSNAME", process.env.GATSBY_NL_DESIGN_THEME_CLASSNAME ?? "");
window.sessionStorage.setItem("GITHUB_ORGANIZATION_URL", process.env.GATSBY_GITHUB_ORGANIZATION_URL ?? "");
window.sessionStorage.setItem("FAVICON_URL", process.env.GATSBY_FAVICON_URL ?? "");
Expand Down Expand Up @@ -80,6 +84,10 @@ export const useEnvironment = () => {
config.GATSBY_USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX ?? "",
);
window.sessionStorage.setItem("API_URL", config.GATSBY_API_URL ?? "");
window.sessionStorage.setItem(
"NEXTCLOUD_API_URL",
config.GATSBY_NEXTCLOUD_BASE_URL ?? "http://nextcloud.local/index.php/apps/opencatalogi/api",
);
window.sessionStorage.setItem("BASE_URL", config.GATSBY_BASE_URL ?? "");
window.sessionStorage.setItem("NL_DESIGN_THEME_CLASSNAME", config.GATSBY_NL_DESIGN_THEME_CLASSNAME ?? "");
window.sessionStorage.setItem("GITHUB_ORGANIZATION_URL", config.GATSBY_GITHUB_ORGANIZATION_URL ?? "");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const ComponentsDetailTemplate: React.FC<ComponentsDetailTemplateProps> =
const imageHasValidSource = (src: string): boolean => {
try {
const url = new URL(src);
return url.protocol === "htpp:" || url.protocol === "https:";
return url.protocol === "http:" || url.protocol === "https:";
} catch (_) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@

.cardsContainer {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-columns: 1fr 1fr 1fr;
}

.cardsContainer > :not(:last-child) {
Expand Down
Loading

0 comments on commit ab27281

Please sign in to comment.