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

overwrote old main with vue3 files #528

Merged
merged 1 commit into from
Jan 22, 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
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![img](https://img.shields.io/badge/Lifecycle-Experimental-339999)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)  
[![Build](https://github.com/bcgov/EDUC-GRAD-ADMIN/actions/workflows/main.yml/badge.svg)](https://github.com/bcgov/EDUC-GRAD-ADMIN/actions/workflows/main.yml)  
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/bcgov/EDUC-GRAD-ADMIN/Build)    
[![CI](https://github.com/bcgov/EDUC-GRAD-ADMIN/actions/workflows/CI.yml/badge.svg)](https://github.com/bcgov/EDUC-GRAD-ADMIN/actions/workflows/CI.yml)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=bcgov_EDUC-GRAD-ADMIN&metric=bugs)](https://sonarcloud.io/summary/new_code?id=bcgov_EDUC-GRAD-ADMIN)  
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=bcgov_EDUC-GRAD-ADMIN&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=bcgov_EDUC-GRAD-ADMIN)  
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=bcgov_EDUC-GRAD-ADMIN&metric=coverage)](https://sonarcloud.io/summary/new_code?id=bcgov_EDUC-GRAD-ADMIN)  
Expand All @@ -14,6 +15,3 @@

# EDUC-GRAD-ADMIN
Admin UI for Graduation Records and Assessment Data (GRAD)

![GitHub repo size](https://img.shields.io/github/repo-size/bcgov/EDUC-GRAD-ADMIN)  
![GitHub Tag](https://img.shields.io/github/v/tag/bcgov/EDUC-GRAD-ADMIN)  
3 changes: 1 addition & 2 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"version": "0.0.1",
"description": "The backend portion of the GRAD Administration web app",
"scripts": {
"serve": "npm run setlocal && npm run setEnvironment && npm run servecmd",
"setEnvironment": "set EDUC_GRAD_ENV=DEV",
"serve": "npm run setlocal && npm run servecmd",
"setlocal": "set NODE_ENV=local",
"servecmd": "nodemon --max-old-space-size=250 ./src/server.js",
"serve-linux": "export NODE_ENV=local && nodemon ./src/server.js",
Expand Down
1 change: 1 addition & 0 deletions backend/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,5 @@ app.use((_req, res) => {
process.on('unhandledRejection', err => {
log.error('Unhandled Rejection at:', err?.stack || err);
});
const date = new Date();
module.exports = app;
5 changes: 3 additions & 2 deletions backend/src/components/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,18 @@ const auth = {
generateUiToken() {
const i = config.get('tokenGenerate:issuer');
const s = '[email protected]';
const a = config.get('tokenGenerate:audience');
const a = config.get('server:frontend');
const signOptions = {
issuer: i,
subject: s,
audience: a,
expiresIn: config.get('tokenGenerate:expiresIn') || '30m',
expiresIn: '30m',
algorithm: 'RS256'
};

const privateKey = config.get('tokenGenerate:privateKey');
const uiToken = jsonwebtoken.sign({}, privateKey, signOptions);

return uiToken;
},
isValidUiTokenWithRoles: partial(isValidUiToken, isUserHasRoles),
Expand Down
1 change: 1 addition & 0 deletions backend/src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const path = require('path');
dotenv.config();

const env = process.env.NODE_ENV || 'local';

nconf.argv()
.env()
.file({ file: path.join(__dirname, `${env}.json`) });
Expand Down
4 changes: 0 additions & 4 deletions frontend/.env

This file was deleted.

81 changes: 67 additions & 14 deletions frontend/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,72 @@
# EDUC-GRAD-ADMIN
Admin UI for Graduation Records and Assessment Data (GRAD)
# ECC GRAD ADMIN

[![img](https://img.shields.io/badge/Lifecycle-Experimental-339999)](https://github.com/bcgov/repomountie/blob/master/doc/lifecycle-badges.md)
Requirements
Working:
VULIDATE UPDATED
Updated vuelidate for vue 3
-updated validations on advanced search to new syntax.


## GRAD Admin Frontend
The Node.js Frontend for GRAD Administration application.
VUE3/VITE
Vite-dev proxy working with backend
- /api will be redirected to localhost:8080 (set in vite.config.js)
- updated port to 8081
BootstrapVue
is running in compatibility mode
https://stackblitz.com/edit/bootstrap-vue-with-compat-8p2z4u?file=vite.config.js

### Local Setup
**`Step 1`**. make sure you have Node.js 16.17.1 installed in your local machine. if not download from here https://nodejs.org/en/

**`Step 2`**. run `npm i --save-dev` in command line from frontend folder, to install required dependencies.
had to add to vite.config.js
alias: {
vue: '@vue/compat',
},

**`Step 3`**. run `npm run serve` in command line from frontend folder, to install required dependencies.

`Unit Tests`
run `npm run test` in command line from frontend folder, to execute unit tests.
ADDED BCGOV STYLES

KEYCloak - auth - setup
localhost:8080/api/auth/login - to login in with idir

APIService - can connect and get a repsonse from api


Auth.js
-updated

To do:
remove vue compat
connect to api / vuex / keycloak
displaytable (need to rename to dataTable) component VUE 3 Compatibility
upgrade router -add routes
vue3 forms



## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Compile and Minify for Production

```sh
npm run build
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
```
13 changes: 13 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Graduation Records and Achievement Data</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
Loading
Loading