Skip to content

Commit

Permalink
Remove awsKeySecret (#424)
Browse files Browse the repository at this point in the history
  • Loading branch information
lingpri authored Mar 4, 2020
1 parent eafdb28 commit 4740993
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 31 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ node
build
build.config.js.sample
/cache/
src/web/aws/common/awsKeySecret.js
9 changes: 4 additions & 5 deletions src/web/aws/common/AdditionalFields.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from 'styled-components';
import PropTypes from 'prop-types';

import { Icon } from 'components/common';
import { Button } from 'components/graylog';

const AdditionalFields = ({ children, className, onToggle, title, visible }) => {
const [fieldsVisible, setFieldsVisible] = useState(visible);
Expand All @@ -14,7 +15,7 @@ const AdditionalFields = ({ children, className, onToggle, title, visible }) =>

return (
<div className={className}>
<ToggleAdditionalFields onClick={handleToggle} type="button">
<ToggleAdditionalFields bsStyle="link" bsSize="xsmall" onClick={handleToggle} type="button">
{title} <Icon name={fieldsVisible ? 'angle-down' : 'angle-right'} fixedWidth />
</ToggleAdditionalFields>

Expand Down Expand Up @@ -44,14 +45,12 @@ const AdditionalFieldsContent = styled.div`
padding: 0 100px 0 25px;
`;

const ToggleAdditionalFields = styled.button`
const ToggleAdditionalFields = styled(Button)`
border: 0;
color: #16ace3;
font-size: 14px;
display: block;
font-size: 14px;
:hover {
color: #5e123b;
text-decoration: underline;
}
`;
Expand Down
21 changes: 0 additions & 21 deletions src/web/aws/common/awsAuth.js

This file was deleted.

8 changes: 4 additions & 4 deletions src/web/aws/common/hooks/useFetch.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useContext, useEffect, useState } from 'react';

import URLUtils from 'util/URLUtils';
import { qualifyUrl } from 'util/URLUtils';
import fetch from 'logic/rest/FetchProvider';

import { FormDataContext } from '../../context/FormData';
import awsAuth from '../awsAuth';

/* useFetch Custom Hook
Expand Down Expand Up @@ -53,8 +52,7 @@ const useFetch = (url, setHook = () => {}, method = 'GET', options = {}) => {
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);
const [data, setData] = useState(null);
const { key, secret } = awsAuth(formData);
const qualifiedURL = fetchUrl ? URLUtils.qualifyUrl(fetchUrl) : null;
const qualifiedURL = fetchUrl ? qualifyUrl(fetchUrl) : null;

useEffect(() => {
let isFetchable = !!qualifiedURL;
Expand All @@ -71,6 +69,8 @@ const useFetch = (url, setHook = () => {}, method = 'GET', options = {}) => {
awsEndpointIAM = { value: undefined },
awsEndpointDynamoDB = { value: undefined },
awsEndpointKinesis = { value: undefined },
key = undefined,
secret = undefined,
} = formData;

if (method === 'GET') {
Expand Down

0 comments on commit 4740993

Please sign in to comment.