-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5434 from bcgov/dev-rook
merge historical search to dev
- Loading branch information
Showing
97 changed files
with
4,797 additions
and
685 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: Historical Search API CD | ||
|
||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- dev-marshal | ||
- test-marshal | ||
- dev-rook | ||
- test-rook | ||
- main | ||
paths: | ||
- "historical-search-api/**" | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./historical-search-api | ||
|
||
env: | ||
APP_NAME: "historical-search-api" | ||
|
||
jobs: | ||
historical-search-api-cd-by-push: | ||
runs-on: ubuntu-20.04 | ||
|
||
if: github.event_name == 'push' && github.repository == 'bcgov/foi-flow' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set ENV variables | ||
id: set-variable | ||
run: | | ||
if [ ${{ github.ref_name }} == 'dev' ]; then | ||
echo "For ${{ github.ref_name }} branch" | ||
echo "TOOLS_NAME=${{secrets.OPENSHIFT4_FRONTEND_REPOSITORY}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="dev"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="dev"" >> $GITHUB_ENV | ||
echo "ENV_NAME="dev"" >> $GITHUB_ENV | ||
elif [ ${{ github.ref_name }} == 'dev-marshal' ]; then | ||
echo "For ${{ github.ref_name }} branch" | ||
echo "TOOLS_NAME=${{secrets.OPENSHIFT4_FRONTEND_REPOSITORY}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="dev-marshal"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="dev-marshal"" >> $GITHUB_ENV | ||
echo "ENV_NAME="dev"" >> $GITHUB_ENV | ||
elif [ ${{ github.ref_name }} == 'test-marshal' ]; then | ||
echo "For ${{ github.ref_name }} branch" | ||
echo "TOOLS_NAME=${{secrets.OPENSHIFT4_FRONTEND_REPOSITORY}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="test-marshal"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="test-marshal"" >> $GITHUB_ENV | ||
echo "ENV_NAME="test"" >> $GITHUB_ENV | ||
elif [ ${{ github.ref_name }} == 'dev-rook' ]; then | ||
echo "For ${{ github.ref_name }} branch" | ||
echo "TOOLS_NAME=${{secrets.OPENSHIFT4_FRONTEND_REPOSITORY}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="dev-rook"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="dev-rook"" >> $GITHUB_ENV | ||
echo "ENV_NAME="dev"" >> $GITHUB_ENV | ||
elif [ ${{ github.ref_name }} == 'test-rook' ]; then | ||
echo "For ${{ github.ref_name }} branch" | ||
echo "TOOLS_NAME=${{secrets.OPENSHIFT4_FRONTEND_REPOSITORY}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="test-rook"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="test-rook"" >> $GITHUB_ENV | ||
echo "ENV_NAME="test"" >> $GITHUB_ENV | ||
elif [ ${{ github.ref_name }} == 'main' ]; then | ||
echo "For ${{ github.ref_name }} branch" | ||
echo "TOOLS_NAME=${{secrets.OPENSHIFT4_FRONTEND_REPOSITORY}}" >> $GITHUB_ENV | ||
echo "TAG_NAME="test"" >> $GITHUB_ENV | ||
echo "BRANCH_NAME="main"" >> $GITHUB_ENV | ||
echo "ENV_NAME="test"" >> $GITHUB_ENV | ||
else | ||
echo "For ${{ github.ref_name }} branch" | ||
fi | ||
shell: bash | ||
|
||
- name: Login Openshift | ||
shell: bash | ||
run: | | ||
oc login --server=${{secrets.OPENSHIFT4_LOGIN_REGISTRY}} --token=${{secrets.OPENSHIFT4_SA_TOKEN}} | ||
- name: Tools project | ||
shell: bash | ||
run: | | ||
oc project ${{ env.TOOLS_NAME }}-tools | ||
- name: Build from ${{ env.BRANCH_NAME }} branch | ||
shell: bash | ||
run: | | ||
oc patch bc/${{ env.APP_NAME }}-build -p '{"spec":{"source":{"git":{"ref":"${{ env.BRANCH_NAME }}"}}}}' | ||
- name: Start Build Openshift | ||
shell: bash | ||
run: | | ||
oc start-build ${{ env.APP_NAME }}-build --wait | ||
- name: Tag+Deploy for ${{ env.TAG_NAME }} | ||
shell: bash | ||
run: | | ||
oc tag ${{ env.APP_NAME }}:latest ${{ env.APP_NAME }}:${{ env.TAG_NAME }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
forms-flow-web/src/apiManager/services/FOI/foiHistoricalSearchServices.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { httpGETRequest } from "../../httpRequestHandler"; | ||
import API from "../../endpoints"; | ||
import { catchError } from "./foiServicesUtil"; | ||
import UserService from "../../../services/UserService"; | ||
|
||
export const fetchHistoricalSearchData = ({ | ||
page = 1, | ||
size = 10, | ||
sort = [{ field: "receivedDate", sort: "desc" }], | ||
search = "", | ||
keywords = [], | ||
requestType = [], | ||
requestFlags = [], | ||
dateRangeType = null, | ||
fromDate = null, | ||
toDate = null, | ||
publicBodies = [], | ||
callback, | ||
errorCallback, | ||
dispatch, | ||
}) => { | ||
// let sortingItems = []; | ||
// let sortingOrders = []; | ||
// sort.forEach((item) => { | ||
// sortingItems.push(item.field); | ||
// sortingOrders.push(item.sort); | ||
// }); | ||
|
||
httpGETRequest( | ||
API.FOI_HISTORICAL_SEARCH_API, | ||
{ | ||
page: page, | ||
size: size, | ||
sortingitem: sort[0]['field'], | ||
sortingorder: sort[0]['sort'], | ||
search: search, | ||
keywords: keywords, | ||
requestType: requestType, | ||
requestFlags: requestFlags, | ||
dateRangeType: dateRangeType, | ||
fromDate: fromDate, | ||
toDate: toDate, | ||
publicBodies: publicBodies, | ||
}, | ||
UserService.getToken() | ||
) | ||
.then((res) => { | ||
if (res.data) { | ||
callback(res.data); | ||
} else { | ||
throw new Error(); | ||
} | ||
}) | ||
.catch((error) => { | ||
catchError(error, dispatch); | ||
errorCallback("Error in fetching historicalsearch for IAO"); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.