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

code formatting and stablishing develop branch and enabling build workflow trigger #226

Merged
merged 1 commit into from
Apr 26, 2024
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: deploy
name: Deploy

on:
workflow_dispatch:
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build artifacts

on:
push:
branches:
- main
- develop
workflow_dispatch:

env:
REGISTRY: ghcr.io
REPOSITORY_OWNER: wkspower
KEYCLOAK_URL: http://localhost:8082
WKS_API_URL: http://localhost:8081
WKS_STORAGE_API_URL: http://localhost:8085
WEBSOCKET_ENABLED: false
WEBSOCKET_URL: ws://localhost:8484
TOPIC_CASE_CREATE: case-create
TOPIC_CREATE_HUMAN_TASK: human-task-create
NOVU_ENABLED: false
NOVU_PUBLISHER_API_URL: http://localhost:3002

jobs:
build-java:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v3
- name: Set up jdk 18
uses: actions/setup-java@v3
with:
java-version: "18"
distribution: "temurin"

- name: Set up maven
uses: stCarolas/[email protected]
with:
maven-version: 3.8.2

- name: Build all for backend api
run: mvn -B package --file apps/java/pom.xml

build-react:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
id: checkout
uses: actions/checkout@v3

- name: Install dependencies for case-portal
run: yarn --cwd apps/react/case-portal install

- name: Build for case-portal
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
export REACT_APP_KEYCLOAK_URL="${{ env.KEYCLOAK_URL }}"
export REACT_APP_API_URL="${{ env.WKS_API_URL }}"
export REACT_APP_STORAGE_URL="${{ env.WKS_STORAGE_API_URL }}"
export REACT_APP_WEBSOCKETS_ENABLED="${{ env.WEBSOCKET_ENABLED }}"
export REACT_APP_WEBSOCKETS_URL="${{ env.WEBSOCKET_URL }}"
export REACT_APP_WEBSOCKETS_CASE_CREATED="${{ env.TOPIC_CASE_CREATE }}"
export REACT_APP_WEBSOCKETS_HUMAN_TASK_CREATED="${{ env.TOPIC_CREATE_HUMAN_TASK }}"
export REACT_APP_NOVU_ENABLED="${{ env.NOVU_ENABLED }}"
export REACT_APP_NOVU_PUBLISHER_API_URL="${{ env.NOVU_PUBLISHER_API_URL }}"
yarn --cwd apps/react/case-portal build
33 changes: 0 additions & 33 deletions .github/workflows/jarDeploy.yml

This file was deleted.

33 changes: 12 additions & 21 deletions .github/workflows/tags.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Extract tag name
id: extract_tag
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})"

- name: Set up jdk 18
uses: actions/setup-java@v3
with:
Expand All @@ -44,13 +40,6 @@ jobs:
with:
maven-version: 3.8.2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build all for backend api
run: mvn -B package --file apps/java/pom.xml

Expand All @@ -72,6 +61,17 @@ jobs:
export REACT_APP_NOVU_PUBLISHER_API_URL="${{ env.NOVU_PUBLISHER_API_URL }}"
yarn --cwd apps/react/case-portal build

- name: Extract tag name
id: extract_tag
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})"

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand Down Expand Up @@ -132,15 +132,6 @@ jobs:
push: true
tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal:${{ steps.extract_tag.outputs.tag }}"

- name: Build and push Docker image for case-portal
uses: docker/build-push-action@v2
with:
context: ./apps/react/case-portal
platforms: linux/amd64,linux/arm64
file: apps/react/case-portal/deployments/Dockerfile
push: true
tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/case-portal:${{ steps.extract_tag.outputs.tag }}"

- name: Build and push Docker image for websocket-publisher
uses: docker/build-push-action@v2
with:
Expand All @@ -166,4 +157,4 @@ jobs:
platforms: linux/amd64,linux/arm64
file: apps/node/email-sender/Dockerfile
push: true
tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/email-sender:${{ steps.extract_tag.outputs.tag }}"
tags: "${{ env.REGISTRY }}/${{ env.REPOSITORY_OWNER }}/email-sender:${{ steps.extract_tag.outputs.tag }}"
13 changes: 7 additions & 6 deletions apps/react/case-portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@
"simplebar-react": "^3.2.4"
},
"scripts": {
"start": "webpack serve --mode=development --port 3001",
"build": "eslint --fix . && webpack --mode=production",
"test": "jest",
"lint": "eslint --fix .",
"format": "prettier --write \"**/*.{js,jsx,json,css,scss,md}\"",
"format:check": "prettier --check \"**/*.{js,jsx,json,css,scss,md}\""
"start": "echo 'Starting development server...' && webpack serve --mode=development --port 3001",
"build": "echo 'Running ESLint...' && eslint . && echo 'Checking code formatting...' && prettier --check \"**/*.{js,jsx,json,css,scss,md}\" && echo 'Building for production...' && webpack --mode=production",
"lint:fix": "echo 'Fixing linting issues...' && eslint --fix .",
"lint:check": "echo 'Checking for linting issues...' && eslint .",
"format:fix": "echo 'Fixing code formatting...' && prettier --write \"**/*.{js,jsx,json,css,scss,md}\"",
"format:check": "echo 'Checking code formatting...' && prettier --check \"**/*.{js,jsx,json,css,scss,md}\"",
"test": "echo 'Running tests...' && jest"
},
"babel": {
"presets": [
Expand Down
32 changes: 16 additions & 16 deletions apps/react/case-portal/src/SessionStoreContext.js
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import React, { useContext } from 'react';
import React, { useContext } from 'react'

const SessionStoreContext = React.createContext({});
export const SessionStoreProvider = SessionStoreContext.Provider;
export const SessionStoreConsumer = SessionStoreContext.Consumer;
const SessionStoreContext = React.createContext({})
export const SessionStoreProvider = SessionStoreContext.Provider
export const SessionStoreConsumer = SessionStoreContext.Consumer

export function withStore(WrappedComponent) {
function WithStoreComponent(props) {
return (
<SessionStoreConsumer>
{(stores) => <WrappedComponent {...props} {...stores} />}
</SessionStoreConsumer>
);
)
}
return WithStoreComponent;
return WithStoreComponent
}

export const useSession = () => {
const attrs = useContext(SessionStoreContext);
return attrs['keycloak'];
};
const attrs = useContext(SessionStoreContext)
return attrs['keycloak']
}

export const useMenu = () => {
const attrs = useContext(SessionStoreContext);
return attrs['menu'];
};
const attrs = useContext(SessionStoreContext)
return attrs['menu']
}

export const useBpmEngine = () => {
const attrs = useContext(SessionStoreContext);
return attrs['bpmEngine'];
};
const attrs = useContext(SessionStoreContext)
return attrs['bpmEngine']
}

export default SessionStoreContext;
export default SessionStoreContext
12 changes: 6 additions & 6 deletions apps/react/case-portal/src/assets/images/auth/AuthBackground.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// material-ui
import { useTheme } from '@mui/material/styles';
import { Box } from '@mui/material';
import { useTheme } from '@mui/material/styles'
import { Box } from '@mui/material'

// ==============================|| AUTH BLUR BACK SVG ||============================== //

const AuthBackground = () => {
const theme = useTheme();
const theme = useTheme()
return (
<Box
sx={{ position: 'absolute', filter: 'blur(18px)', zIndex: -1, bottom: 0 }}
Expand Down Expand Up @@ -33,7 +33,7 @@ const AuthBackground = () => {
/>
</svg>
</Box>
);
};
)
}

export default AuthBackground;
export default AuthBackground
2 changes: 1 addition & 1 deletion apps/react/case-portal/src/common/caseStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export const CaseStatus = {
WipCaseStatus: Symbol('WIP_CASE_STATUS'),
ClosedCaseStatus: Symbol('CLOSED_CASE_STATUS'),
ArchivedCaseStatus: Symbol('ARCHIVED_CASE_STATUS'),
};
}
10 changes: 5 additions & 5 deletions apps/react/case-portal/src/components/@extended/AnimateButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types';
import PropTypes from 'prop-types'

// third-party
import { motion } from 'framer-motion';
import { motion } from 'framer-motion'

// ==============================|| ANIMATION BUTTON ||============================== //

Expand All @@ -15,15 +15,15 @@ export default function AnimateButton({ children, type }) {
<motion.div whileHover={{ scale: 1 }} whileTap={{ scale: 0.9 }}>
{children}
</motion.div>
);
)
}
}

AnimateButton.propTypes = {
children: PropTypes.node,
type: PropTypes.oneOf(['slide', 'scale', 'rotate']),
};
}

AnimateButton.defaultProps = {
type: 'scale',
};
}
Loading
Loading