Skip to content

Commit

Permalink
Merge pull request #10 from dacoaster/jira-integration
Browse files Browse the repository at this point in the history
JIRA integration, config rework, and bug fixes
  • Loading branch information
dacoaster authored Jan 25, 2023
2 parents e0cb170 + 358271d commit 59fc9b4
Show file tree
Hide file tree
Showing 44 changed files with 1,863 additions and 121 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
VUE_APP_JIRA_CLIENT_ID=3tPI6y3UgOxjUUVd2ELL3mhZr6cGAatt
VUE_APP_JIRA_CLIENT_SECRET=ATOAHCxhe5I4NKjvZo_hnzLSS6N038CmfyUsdnoXHCI0e8el_dY_xrFmMFJVHMAfa14d8502F3BF
VUE_APP_I18N_LOCALE=en
VUE_APP_I18N_FALLBACK_LOCALE=en

VUE_APP_SERVER_PORT=64064
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ If you have an idea about how we can better meet that goal, please let us know b

If you looking to contribute - please checkout the [contributing guidelines](docs/CONTRIBUTING.md).

If you're just looking to take it for a spin, check out the pre-built [packages](https://github.com/dacoaster/yattie/releases) and find the one built for your platform. Can't find the platform you're looking for? Let us know you'd like a new one supported at the [feature requests](https://features.yattie.ai) page!
If you're just looking to take it for a spin, check out the pre-built [packages](https://yatt.ai/downloads) and find the one built for your platform. Can't find the platform you're looking for? Let us know you'd like a new one supported at the [feature requests](https://features.yattie.ai) page!

### Installation

TODO - This section could use some love (and screenshots!)

## Usage

TODO - This section could use some love (and screenshots!)
Check out our [docs](https://docs.yattie.ai).

## Roadmap

Expand Down
16 changes: 12 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "yattie",
"version": "0.4.3",
"version": "0.5.0",
"private": true,
"main": "background.js",
"engines": {
"npm": ">=8.0.0 <9.0.0",
"node": ">=16.0.0 <17.0.0"
Expand All @@ -15,32 +14,41 @@
"license": "GPLv3",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service electron:build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint",
"dev": "vue-cli-service electron:serve",
"build": "vue-cli-service electron:build",
"i18n:report": "vue-cli-service i18n:report --src \"./src/**/*.?(js|vue)\" --locales \"./src/locales/**/*.json\"",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps",
"publish": "vue-cli-service electron:build -p always"
},
"main": "background.js",
"dependencies": {
"@fortawesome/fontawesome-free": "^6.2.1",
"@johmun/vue-tags-input": "^2.1.0",
"@peepi/vuetify-tiptap": "^1.2.3",
"tui-image-editor": "^3.15.3",
"adm-zip": "^0.5.9",
"axios": "^1.2.1",
"body-parser": "^1.20.1",
"child_process": "^1.0.2",
"client-oauth2": "^4.3.3",
"core-js": "^3.8.3",
"cors": "^2.8.5",
"d3": "^5.14.2",
"dayjs": "^1.11.5",
"detect-file-type": "^0.2.8",
"express": "^4.18.2",
"extract-zip": "^2.0.1",
"ffmpeg-static": "^5.1.0",
"ffprobe-static": "^3.1.0",
"fluent-ffmpeg": "^2.1.2",
"form-data": "^4.0.0",
"lodash": "^4.17.21",
"open": "^8.4.0",
"simple-json-db": "^2.0.0",
"sinon": "^15.0.0",
"tui-image-editor": "^3.15.3",
"uuid": "3.3.3",
"v-mask": "^2.3.0",
"vue": "^2.6.14",
Expand Down
36 changes: 36 additions & 0 deletions public/server/Server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const express = require("express");
const bodyParser = require("body-parser");
const cors = require("cors");
const path = require("path");

const app = express();
const port = process.env.VUE_APP_SERVER_PORT || 64064;

const corsOptions = {
origin: `http://localhost:${port}`,
};

app.use(cors());
app.use(cors(corsOptions));

// parse requests of content-type - application/json
app.use(bodyParser.json());

// parse requests of content-type - application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: true }));

// path
app.use(express.static(path.join(__dirname, "images")));

app.disable("x-powered-by");

// modules
require("./modules/JiraUtility")(app);

try {
app.listen(port, () => {
console.log(`OAuth redirect server running at http://localhost:${port}`);
});
} catch (err) {
console.log(err);
}
Binary file added public/server/images/favicon.ico
Binary file not shown.
Binary file added public/server/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions public/server/jira.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>YATTIE</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
<link rel="icon" href="/favicon.ico">
<style>
body {
margin: 0;
background-color: #fafafa;
border-color: #fafafa;
}

.wrapper {
width: 100%;
min-height: 100vh;
}

.container {
padding: 12px;
padding-top: 80px;
margin-left: auto;
margin-right: auto;
}

.container .logo {
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 1rem;
}

.container .notification {
display: flex;
justify-content: center;
align-items: center;
}

.container .notification span {
background-color: #fff;
border-color: #fff;
border-radius: 4px;
color: rgba(0, 0, 0, .87);
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12) !important;
display: block;
font-size: 20px;
margin-bottom: 16px;
padding: 25px;
position: relative;
transition: .3s cubic-bezier(.25, .8, .5, 1);
border-left: 4px solid #6200ea;
}
</style>
</head>

<body>
<div class="wrapper">
<div class="container">
<div class="logo">
<img src="/logo.png" alt="logo" width="80">
</div>
<div class="notification">
<span>You are now connected to JIRA! You can close this window and go back to the YATTIE app to get started
testing.</span>
</div>
</div>

</div>
</body>

</html>
41 changes: 41 additions & 0 deletions public/server/modules/JiraUtility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
const open = require("open");
const path = require("path");
const ClientOAuth2 = require("client-oauth2");
const port = process.env.VUE_APP_SERVER_PORT;
const auth = new ClientOAuth2({
clientId: process.env.VUE_APP_JIRA_CLIENT_ID,
clientSecret: process.env.VUE_APP_JIRA_CLIENT_SECRET,
accessTokenUri: "https://auth.atlassian.com/oauth/token",
authorizationUri:
"https://auth.atlassian.com/authorize?audience=api.atlassian.com&prompt=consent",
redirectUri: `http://localhost:${port}/oauth2/atlassian/callback`,
scopes: ["read:jira-work", "write:jira-work", "read:me", "offline_access"],
});
module.exports = (app) => {
app.use((req, res, next) => {
res.header(
"Access-Control-Allow-Headers",
"x-access-token, Origin, Content-Type, Accept"
);
next();
});

app.get("/oauth2/atlassian", (req, res) => {
var uri = auth.code.getUri();
open(uri, (err) => {
console.log(err);
});
return res.send(uri);
});
app.get("/oauth2/atlassian/callback", (req, res) => {
auth.code.getToken(req.originalUrl).then((user) => {
const data = {
type: "jira",
accessToken: user.data,
};
process.send(data);

return res.sendFile(path.join(__dirname, "../jira.html"));
});
});
};
4 changes: 4 additions & 0 deletions src/assets/icon/bug.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/icon/list.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ async function createWindow() {
if (process.env.WEBPACK_DEV_SERVER_URL) {
// Load the url of the dev server if in development mode
await win.loadURL(process.env.WEBPACK_DEV_SERVER_URL);
if (isDevelopment){
win.webContents.openDevTools();
if (isDevelopment) {
win.webContents.openDevTools();
}
} else {
createProtocol("app");
Expand Down
Loading

0 comments on commit 59fc9b4

Please sign in to comment.