New: UI Updates, Tag manager, More custom filters (#437)

* New: UI Updates, Tag manager, More custom filters

* fixup! Fix ScanFixture Unit Tests

* Fixed: Sentry Errors from UI don't have release, branch, environment

* Changed: Bump Mobile Detect for New Device Detection

* Fixed: Build on changes to package.json

* fixup! Add MetadataProfile filter option

* fixup! Tag Note, Blacklist, Manual Import

* fixup: Remove connectSection

* fixup: root folder comment
This commit is contained in:
Qstick 2018-08-07 20:57:15 -04:00 committed by GitHub
parent afa78b1d20
commit 6581b3a2c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
198 changed files with 3057 additions and 888 deletions

View file

@ -16,8 +16,8 @@ export const section = 'oAuth';
export const defaultState = {
authorizing: false,
accessToken: null,
accessTokenSecret: null
result: null,
error: null
};
//
@ -50,9 +50,11 @@ function showOAuthWindow(url) {
const splitQuery = query.substring(1).split('&');
splitQuery.forEach((param) => {
const paramSplit = param.split('=');
if (param) {
const paramSplit = param.split('=');
queryParams[paramSplit[0]] = paramSplit[1];
queryParams[paramSplit[0]] = paramSplit[1];
}
});
onComplete();
@ -70,7 +72,7 @@ export const actionHandlers = handleThunks({
[START_OAUTH]: function(getState, payload, dispatch) {
const actionPayload = {
action: 'startOAuth',
queryParams: { callbackUrl: `${window.location.origin}/oauth.html` },
queryParams: { callbackUrl: `${window.location.origin}${window.Lidarr.urlBase}/oauth.html` },
...payload
};
@ -78,33 +80,36 @@ export const actionHandlers = handleThunks({
authorizing: true
}));
let startResponse = {};
const promise = requestAction(actionPayload)
.then((response) => {
startResponse = response;
return showOAuthWindow(response.oauthUrl);
})
.then((queryParams) => {
return requestAction({
action: 'getOAuthToken',
queryParams,
queryParams: {
...startResponse,
...queryParams
},
...payload
});
})
.then((response) => {
const {
accessToken,
accessTokenSecret
} = response;
dispatch(setOAuthValue({
authorizing: false,
accessToken,
accessTokenSecret
result: response,
error: null
}));
});
promise.fail(() => {
promise.fail((xhr) => {
dispatch(setOAuthValue({
authorizing: false
authorizing: false,
result: null,
error: xhr
}));
});
}