Skip to content

Commit

Permalink
bulk update issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
KMSMADHU committed Feb 21, 2019
1 parent 827f642 commit 56541b5
Show file tree
Hide file tree
Showing 10 changed files with 280 additions and 232 deletions.
2 changes: 2 additions & 0 deletions src/javascript/Actions/ActionTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ export const SCAN_TYPE_OPERATION_REJECTED = 'SCAN_TYPE_OPERATION_REJECTED'
export const FETCH_FILTER_VALUES = 'FETCH_FILTER_VALUES'
export const FETCH_FILTER_VALUES_FULFILLED = 'FETCH_FILTER_VALUES_FULFILLED'
export const FETCH_FILTER_RESULTS = 'FETCH_FILTER_RESULTS'
export const UPDATE_FILTER_FINDING = 'UPDATE_FILTER_FINDING'
export const UPDATE_FILTER_FINDING_FULFILLED = 'UPDATE_FILTER_FINDING_FULFILLED'
export const FETCH_FILTER_RESULTS_FULFILLED = 'FETCH_FILTER_RESULTS_FULFILLED'
export const FILTER_OPERATION_REJECTED = 'FILTER_OPERATION_REJECTED'

Expand Down
34 changes: 27 additions & 7 deletions src/javascript/Actions/FilterActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import {
FETCH_FILTER_RESULTS_FULFILLED,
FETCH_FILTER_VALUES,
FETCH_FILTER_VALUES_FULFILLED,
FILTER_OPERATION_REJECTED,
UPDATE_FILTER_FINDING,
UPDATE_FILTER_FINDING_FULFILLED,
FILTER_OPERATION_REJECTED
} from './ActionTypes'
/**
* Fetch all filters
Expand All @@ -24,12 +26,12 @@ export function fetchFilterValues(payload) {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': localStorage.getItem('token')
},
'Authorization': localStorage.getItem('token'),
}
}).then((response) => {
dispatch({type: FETCH_FILTER_VALUES_FULFILLED, payload: response.data,});
dispatch({type: FETCH_FILTER_VALUES_FULFILLED, payload: response.data});
}).catch((err) => {
dispatch({type: FILTER_OPERATION_REJECTED, payload: err,})
dispatch({type: FILTER_OPERATION_REJECTED, payload: err})
})
}
}
Expand All @@ -38,16 +40,34 @@ export function fetchAllFilterResults(payload) {
return function(dispatch) {
dispatch({type: FETCH_FILTER_RESULTS});
axios.post(AUTH_BASE_URL + "filters/list", payload, {
withCredentials: true,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': localStorage.getItem('token'),
}
}).then((response) => {
dispatch({type: FETCH_FILTER_RESULTS_FULFILLED, payload: response.data});
}).catch((err) => {
dispatch({type: FILTER_OPERATION_REJECTED, payload: err})
})
}
}

export function updateFilterFinding(payload, findingId) {
return function(dispatch) {
dispatch({type: UPDATE_FILTER_FINDING});
axios.put(AUTH_BASE_URL + "findings/" + findingId, payload, {
withCredentials: true,
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': localStorage.getItem('token')
},
}).then((response) => {
dispatch({type: FETCH_FILTER_RESULTS_FULFILLED, payload: response.data,});
dispatch({type: UPDATE_FILTER_FINDING_FULFILLED, payload: response.data,})
}).catch((err) => {
dispatch({type: FILTER_OPERATION_REJECTED, payload: err,})
dispatch({type: FILTER_OPERATION_REJECTED, payload: err})
})
}
}
8 changes: 4 additions & 4 deletions src/javascript/Components/Home/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ export default class Header extends React.Component {
<li>
<a href="#work_outer">Latest Work</a>
</li>
<li>
{/* <li>
<a href="#team">Team</a>
</li>
</li> */}
<li>
<Link to="/login">
Sign in
</Link>
</li>
<li>
{/* <li>
<a href="#contact">Contact</a>
</li>
</li> */}
</ul>
</nav>
<a class="res-nav_click animated wobble wow" href="javascript:void(0)">
Expand Down
4 changes: 0 additions & 4 deletions src/javascript/Components/Home/HowItWorks.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ export default class HowItWorks extends React.Component {
</p>
</div>
</div>
<div class="work_bottom">
<span>Ready to take the plunge?</span>
<a href="#contact" class="contact_btn">Contact Us</a>
</div>
</div>
<div class="col-xs-5 text-right wow fadeInUp delay-02s">
<img src="/images/new_dashboard_1.png" class="img-responsive" style={imgStyles}/>
Expand Down
5 changes: 2 additions & 3 deletions src/javascript/Components/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ export default class Home extends React.Component {
<Header/>
<Overview/>
<Features/>
<HowItWorks/>
<Team/>
<Contact/>
<HowItWorks/> {/* <Team/> */}
{/* <Contact/> */}
<Footer/>
</div>
)
Expand Down
Loading

0 comments on commit 56541b5

Please sign in to comment.