Skip to content

Commit

Permalink
ADD GITHUB_ORGANIZATION_URL logic
Browse files Browse the repository at this point in the history
  • Loading branch information
lencodes committed Sep 27, 2023
1 parent 8316ce4 commit 3df729b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/opencatalogi-page-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ env: # Change these to your preferences any image url can also be a base encoded
NL_DESIGN_THEME_CLASSNAME: rotterdam-theme
ARROW_BREADCRUMBS: "false"

# ORGANIZATION: ""
GITHUB_ORGANIZATION_URL: "https://github.com/OpenCatalogi"

on:
push:
branches:
- development
- feature/OP-56/deployment-workflow

jobs:
build:
Expand All @@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@v2
with:
repository: OpenCatalogi/web-app
ref: development
ref: feature/OP-56/deployment-workflow

# With special thanxs to https://github.com/SpicyPizza/create-envfile
- name: Make envfile
Expand All @@ -53,7 +53,7 @@ jobs:
envkey_GATSBY_NL_DESIGN_THEME_CLASSNAME: ${{ env.NL_DESIGN_THEME_CLASSNAME }}
envkey_GATSBY_ARROW_BREADCRUMBS: ${{ env.ARROW_BREADCRUMBS }}

# envkey_GATSBY_ORGANIZATION: ${{ env.ORGANIZATION }}
envkey_GATSBY_GITHUB_ORGANIZATION_URL: ${{ env.GITHUB_ORGANIZATION_URL }}
directory: pwa/static
file_name: .env.production
fail_on_empty: true
Expand Down
16 changes: 9 additions & 7 deletions pwa/src/apiService/resources/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ export default class Search {
}

public getSearch = async (filters: IFilters): Promise<any> => {
const { data } = await Send(
this._instance,
"GET",
`/search?page=${
filters.currentPage
}&order[embedded.rating.rating]=desc&limit=10&extend[]=all${filtersToQueryParams(filters)}`,
);
let endpoint = `/search?page=${
filters.currentPage
}&order[embedded.rating.rating]=desc&limit=10&extend[]=all${filtersToQueryParams(filters)}`;

if (process.env.GITHUB_ORGANIZATION_URL) {
endpoint += `&legal.repoOwner.github=${process.env.GITHUB_ORGANIZATION_URL}`;
}

const { data } = await Send(this._instance, "GET", endpoint);

return data;
};
Expand Down
2 changes: 1 addition & 1 deletion pwa/static/.env.development
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ GATSBY_API_URL=https://api.opencatalogi.nl/api
GATSBY_ADMIN_URL=https://api.opencatalogi.nl/admin
GATSBY_BASE_URL=https://api.opencatalogi.nl
GATSBY_FRONTEND_URL=https://api.opencatalogi.nl
# GATSBY_ORGANIZATION=""
GATSBY_LOGIN_REDIRECT=vault
GATSBY_ADMIN_DASHBOARD_URL=https://admin.opencatalogi.nl

# Config
GATSBY_NL_DESIGN_THEME_CLASSNAME=rotterdam-theme
GATSBY_ARROW_BREADCRUMBS=false
# GATSBY_GITHUB_ORGANIZATION_URL=""
4 changes: 2 additions & 2 deletions pwa/static/.env.production
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ GATSBY_API_URL=
GATSBY_ADMIN_URL=
GATSBY_BASE_URL=
GATSBY_FRONTEND_URL=
# GATSBY_ORGANIZATION=
GATSBY_LOGIN_REDIRECT=
GATSBY_ADMIN_DASHBOARD_URL=

# Config
GATSBY_NL_DESIGN_THEME_CLASSNAME=
GATSBY_ARROW_BREADCRUMBS=
GATSBY_ARROW_BREADCRUMBS=
# GATSBY_GITHUB_ORGANIZATION_URL=

0 comments on commit 3df729b

Please sign in to comment.