Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/OC-813/themes #333

Merged
merged 3 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To set up your own project, you will need a GitHub account and be logged in. Sim
To develop locally, clone your new repository to your local machine. Open the terminal, navigate to the folder containing your repository, and make a choice to run the app in Node.js/npm or docker.

### Node.js / NPM
You will need a Git client(optional), and have Node.js and NPM installed. This will run the front-end on port :9000 so make sure nothing runs on that.
You will need a Git client(optional), and have Node.js and NPM installed. This will run the frontend on port :9000 so make sure nothing runs on that.

```cli
$ cd /pwa
Expand All @@ -27,7 +27,7 @@ $ npm run serve

### Docker

You will need to have docker installed. This will run the front-end on port :81 so make sure nothing runs on that.
You will need to have docker installed. This will run the frontend on port :81 so make sure nothing runs on that.

```cli
$ docker-compose pull
Expand All @@ -46,32 +46,32 @@ $ docker-compose up
After succesfully setting up your dev environment, navigate to [http://localhost:81/](http://localhost:81/) to view the app in your browser.

### Configure back-end connection
To connect to front-end to your local back-end you will first need to set up your back-end, you can follow the installation guide provided [here](https://github.com/OpenCatalogi/OpenCatalogiBundle#opencatalogibundle-).
To connect to frontend to your local back-end you will first need to set up your back-end, you can follow the installation guide provided [here](https://github.com/OpenCatalogi/OpenCatalogiBundle#opencatalogibundle-).

To connect the app to your local gateway, you will need to change the environment variables in the `env.js` file. Replace the content of the file with the following:
To connect the app to your local gateway, you will need to change the environment variables in the `.env.development` file. Replace the content below Backend-config with the following:
```
window.sessionStorage.setItem("GATSBY_ME_URL", "http://localhost/api/users/me");
window.sessionStorage.setItem("GATSBY_API_URL", "http://localhost/api");
window.sessionStorage.setItem("GATSBY_ADMIN_URL", "http://localhost/admin");
window.sessionStorage.setItem("GATSBY_BASE_URL", "http://localhost");
window.sessionStorage.setItem("GATSBY_FRONTEND_URL", "http://localhost");
window.sessionStorage.setItem("GATSBY_ORGANIZATION", "");
window.sessionStorage.setItem("GATSBY_LOGIN_REDIRECT", "vault");
window.sessionStorage.setItem("ADMIN_DASHBOARD_URL", "http://localhost:8000");
GATSBY_ME_URL=http://localhost/me
GATSBY_API_URL=http://localhost/api
GATSBY_ADMIN_URL=http://localhost/admin
GATSBY_BASE_URL=http://localhost
GATSBY_FRONTEND_URL=http://localhost:8000
GATSBY_ORGANIZATION=http://webresourcecatalogus.conduction.svc.cluster.local/organizations/b2d3176e-f1c6-4365-ab86-dd253c65fc43
GATSBY_LOGIN_REDIRECT=vault
GATSBY_ADMIN_DASHBOARD_URL=https://admin.opencatalogi.nl
remko48 marked this conversation as resolved.
Show resolved Hide resolved
```

After editing this file restart the front-end
After editing this file restart the frontend

#### Node.js / NPM
Stop the server by pressing `CTRL + C` and rebuild the front-end:
Stop the server by pressing `CTRL + C` and rebuild the frontend:

```cli
$ npm run build
$ npm run serve
```

#### Docker
Stop the server by pressing `CTRL + C` and restart the front-end:
Stop the server by pressing `CTRL + C` and restart the frontend:
```cli
$ docker-compose down
$ docker-compose up
Expand Down
43 changes: 0 additions & 43 deletions helm/templates/configmap.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions pwa/.env.development

This file was deleted.

2 changes: 1 addition & 1 deletion pwa/gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env node */
/* eslint-disable @typescript-eslint/no-var-requires */
require("dotenv").config({
path: `.env.${process.env.NODE_ENV}`,
path: `static/.env.${process.env.NODE_ENV}`,
});

module.exports = {
Expand Down
10 changes: 9 additions & 1 deletion pwa/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pwa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
},
"dependencies": {
"@conduction/components": "2.2.9",
"@conduction/theme": "1.0.38",
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.1.18",
Expand Down
6 changes: 3 additions & 3 deletions pwa/src/apiService/apiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class APIService {
const authorization = this.JWT ? { Authorization: "Bearer " + this.JWT } : {};

return axios.create({
baseURL: window.sessionStorage.getItem("GATSBY_API_URL") ?? undefined,
baseURL: process.env.GATSBY_API_URL ?? undefined,
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Expand All @@ -43,7 +43,7 @@ export default class APIService {

public get LoginClient(): AxiosInstance {
return axios.create({
baseURL: window.sessionStorage.getItem("GATSBY_API_URL") ?? undefined,
baseURL: process.env.GATSBY_API_URL ?? undefined,
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Expand All @@ -53,7 +53,7 @@ export default class APIService {

public get BaseClient(): AxiosInstance {
return axios.create({
baseURL: window.sessionStorage.getItem("GATSBY_BASE_URL") ?? undefined,
baseURL: process.env.GATSBY_BASE_URL ?? undefined,
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Expand Down
9 changes: 6 additions & 3 deletions pwa/src/components/categoryCard/CategoryCard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@

.titleLink {
font-size: var(--web-app-font-size-lg);
--denhaag-link-icon-gap: var(--web-app-size-xs);
}

.titleLink > :first-child > span > svg {
.titleLink > span > svg {
width: var(--web-app-font-size-lg);
height: var(--web-app-font-size-lg);
}

.titleLink > :first-child {
.icon {
margin-inline-end: var(--web-app-size-xs);
}

.titleLink > span {
display: flex;
}

Expand Down
10 changes: 4 additions & 6 deletions pwa/src/components/categoryCard/CategoryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ export const CategoryCard: React.FC<CategoryCardProps> = ({ title, description,
<CardWrapper className={styles.container}>
<CardHeader>
<CardHeaderTitle>
<div className={styles.titleLink}>
<Link to={title.href}>
<Icon className="utrecht-icon--conduction-start">{icon}</Icon>
{title.label}
</Link>
</div>
<Link className={styles.titleLink} to={title.href}>
<Icon className={styles.icon}>{icon}</Icon>
{title.label}
</Link>
</CardHeaderTitle>
</CardHeader>
<Paragraph className={domain ?? styles.description}>{description}</Paragraph>
Expand Down
18 changes: 0 additions & 18 deletions pwa/src/context/theme.ts

This file was deleted.

Loading
Loading