Skip to content

Commit

Permalink
fix: can't add issue after first login
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirPal committed Feb 28, 2018
1 parent dad03a2 commit c144fe0
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 53 deletions.
7 changes: 5 additions & 2 deletions app/containers/Popups/IssueForm/IssueForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class IssueForm extends Component<{}, any> {

webview.addEventListener('did-finish-load', () => {
if (process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === true) {
// webview.openDevTools();
webview.openDevTools();
}
});

Expand Down Expand Up @@ -96,7 +96,10 @@ class IssueForm extends Component<{}, any> {
ipcRenderer.send('close-issue-window');
});
clearInterval(timerId);
document.getElementById('qf-field-picker-trigger').remove();
var fieldPicker = document.getElementById('qf-field-picker-trigger');
if (fieldPicker) {
fieldPicker.remove();
}
var forRemove = document.getElementsByClassName('aui-blanket');
forRemove[0].remove();
var formBody = issueForm.$form.children()[0];
Expand Down
52 changes: 31 additions & 21 deletions app/main.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,26 +250,28 @@ function authJiraBrowserRequests({
password,
host,
}) {
const filter = {
urls: [
'*://atlassian.net/*',
'*://atlassian.com/*',
'*://atlassian.io/*',
'*://cloudfront.net/*',
],
};
if (host) {
filter.urls.push(`*://${host}/*`);
}
// Basic auth for jira links(media in renderedFields)
session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => {
details.requestHeaders['Authorization'] = // eslint-disable-line
`Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`;
callback({
cancel: false,
requestHeaders: details.requestHeaders,
if (username && password && host) {
const filter = {
urls: [
'*://atlassian.net/*',
'*://atlassian.com/*',
'*://atlassian.io/*',
'*://cloudfront.net/*',
],
};
if (host) {
filter.urls.push(`*://${host}/*`);
}
// Basic auth for jira links(media in renderedFields)
session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => {
details.requestHeaders['Authorization'] = // eslint-disable-line
`Basic ${Buffer.from(`${username}:${password}`).toString('base64')}`;
callback({
cancel: false,
requestHeaders: details.requestHeaders,
});
});
});
}
}

ipcMain.on('store-credentials', (event, credentials) => {
Expand Down Expand Up @@ -313,9 +315,17 @@ ipcMain.on('get-credentials', (event, { username, host }) => {
host,
});
},
).catch(
(err) => {
event.returnValue = { // eslint-disable-line no-param-reassign
error: {
err,
platform: process.platform,
},
};
},
);
} catch (err) {
console.error(err);
event.returnValue = { // eslint-disable-line no-param-reassign
error: {
err,
Expand Down Expand Up @@ -400,7 +410,7 @@ ipcMain.on('load-issue-window', (event, url) => {
createIssueWindow.webContents.send('url', url);
});
if (process.env.NODE_ENV === 'development' || process.env.DEBUG_PROD === true) {
// createIssueWindow.openDevTools();
createIssueWindow.openDevTools();
}
createIssueWindow.on('close', (cEv) => {
cEv.preventDefault();
Expand Down
42 changes: 12 additions & 30 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -572,13 +572,6 @@ ansi-wrap@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/ansi-wrap/-/ansi-wrap-0.1.0.tgz#a82250ddb0015e9a27ca82e82ea603bbfa45efaf"

anymatch@^1.3.0:
version "1.3.2"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a"
dependencies:
micromatch "^2.1.5"
normalize-path "^2.0.0"

anymatch@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb"
Expand Down Expand Up @@ -2148,21 +2141,6 @@ check-types@^7.3.0:
version "7.3.0"
resolved "https://registry.yarnpkg.com/check-types/-/check-types-7.3.0.tgz#468f571a4435c24248f5fd0cb0e8d87c3c341e7d"

chokidar@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
dependencies:
anymatch "^1.3.0"
async-each "^1.0.0"
glob-parent "^2.0.0"
inherits "^2.0.1"
is-binary-path "^1.0.0"
is-glob "^2.0.0"
path-is-absolute "^1.0.0"
readdirp "^2.0.0"
optionalDependencies:
fsevents "^1.0.0"

chokidar@^2.0.0, chokidar@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-2.0.2.tgz#4dc65139eeb2714977735b6a35d06e97b494dfd7"
Expand Down Expand Up @@ -5477,7 +5455,7 @@ isurl@^1.0.0-alpha5:
resolved "https://codeload.github.com/web-pal/jira-connector/tar.gz/56c56015371481701b7ae6fc2fd64ddf07a13b78"
dependencies:
oauth "^0.9.12"
request "^2.51.0"
request "^2.83.0"

js-base64@^2.1.9:
version "2.4.3"
Expand Down Expand Up @@ -6054,7 +6032,7 @@ methods@~1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"

micromatch@^2.1.5, micromatch@^2.3.11, micromatch@^2.3.7:
micromatch@^2.3.11, micromatch@^2.3.7:
version "2.3.11"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
dependencies:
Expand Down Expand Up @@ -6299,6 +6277,10 @@ negotiator@0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"

neo-async@^2.5.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.5.0.tgz#76b1c823130cca26acfbaccc8fbaf0a2fa33b18f"

node-abi@^2.1.1:
version "2.3.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.3.0.tgz#f3d554d6ac72a9ee16f0f4dc9548db7c08de4986"
Expand Down Expand Up @@ -6414,7 +6396,7 @@ normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-
semver "2 || 3 || 4 || 5"
validate-npm-package-license "^3.0.1"

normalize-path@^2.0.0, normalize-path@^2.0.1, normalize-path@^2.1.1:
normalize-path@^2.0.1, normalize-path@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
dependencies:
Expand Down Expand Up @@ -7924,7 +7906,7 @@ request@2.81.0:
tunnel-agent "^0.6.0"
uuid "^3.0.0"

request@^2.45.0, request@^2.51.0, request@^2.79.0:
request@^2.45.0, request@^2.79.0, request@^2.83.0:
version "2.83.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356"
dependencies:
Expand Down Expand Up @@ -9353,12 +9335,12 @@ warning@^3.0.0:
loose-envify "^1.0.0"

watchpack@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.4.0.tgz#4a1472bcbb952bd0a9bb4036801f954dfb39faac"
version "1.5.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.5.0.tgz#231e783af830a22f8966f65c4c4bacc814072eed"
dependencies:
async "^2.1.2"
chokidar "^1.7.0"
chokidar "^2.0.2"
graceful-fs "^4.1.2"
neo-async "^2.5.0"

wbuf@^1.1.0, wbuf@^1.7.2:
version "1.7.2"
Expand Down

0 comments on commit c144fe0

Please sign in to comment.