fleet/frontend/kolide/index.js
Gabe Hernandez a85476c23b
implement member page for team details (#685)
* added reducers and kolide api teams code, hooked up empty state

* request for get all teams and remove unused loading bar

* added create team functionality|gs

* update link cell to be more generic

* create teams detail page and hook it up

* added tabbing and styling to top nav team details

* added edit and delete modal functionality

* add in table and modals for members for teams

* created reusable edit user modal and use it in manage teams page

* creating add member autocomplete

* hook up adding members to teams

* hook up real members from api into table, and empty state for table

* fix proptype warning

* hooked up table querying for member page

* added remove member modal

* added tems to edit useres on member page

* finish remove member from team

* fixed up editing on members page

* fix the role value in member table

* fix prettier errors

* fixes from PR comments round 1

* add missing error handler on add member

* add dynamic team name to member page and user dynamic user and team names to succuess and errors

* add test for userManagementHelper module

* fix lint errors

* fix tests

* add member test to row results on member page
2021-04-29 14:47:33 +01:00

76 lines
2.6 KiB
JavaScript

import Base from "kolide/base";
import Request from "kolide/request";
import accountMethods from "kolide/entities/account";
import configMethods from "kolide/entities/config";
import versionMethods from "kolide/entities/version";
import osqueryOptionsMethods from "kolide/entities/osquery_options";
import hostMethods from "kolide/entities/hosts";
import inviteMethods from "kolide/entities/invites";
import labelMethods from "kolide/entities/labels";
import packMethods from "kolide/entities/packs";
import queryMethods from "kolide/entities/queries";
import scheduledQueryMethods from "kolide/entities/scheduled_queries";
import sessionMethods from "kolide/entities/sessions";
import statusLabelMethods from "kolide/entities/status_labels";
import targetMethods from "kolide/entities/targets";
import userMethods from "kolide/entities/users";
import websocketMethods from "kolide/websockets";
import statusMethods from "kolide/status";
import teamMethods from "kolide/entities/teams";
const DEFAULT_BODY = JSON.stringify({});
class Kolide extends Base {
constructor() {
super();
this.account = accountMethods(this);
this.config = configMethods(this);
this.version = versionMethods(this);
this.osqueryOptions = osqueryOptionsMethods(this);
this.hosts = hostMethods(this);
this.invites = inviteMethods(this);
this.labels = labelMethods(this);
this.packs = packMethods(this);
this.queries = queryMethods(this);
this.scheduledQueries = scheduledQueryMethods(this);
this.sessions = sessionMethods(this);
this.statusLabels = statusLabelMethods(this);
this.targets = targetMethods(this);
this.users = userMethods(this);
this.websockets = websocketMethods(this);
this.status = statusMethods(this);
this.teams = teamMethods(this);
}
authenticatedDelete(endpoint, overrideHeaders = {}, body) {
const headers = this._authenticatedHeaders(overrideHeaders);
return Base._deleteRequest(endpoint, headers, body);
}
authenticatedGet(endpoint, overrideHeaders = {}) {
const { GET } = Request.REQUEST_METHODS;
return this._authenticatedRequest(GET, endpoint, {}, overrideHeaders);
}
authenticatedPatch(endpoint, body = {}, overrideHeaders = {}) {
const { PATCH } = Request.REQUEST_METHODS;
return this._authenticatedRequest(PATCH, endpoint, body, overrideHeaders);
}
authenticatedPost(endpoint, body = DEFAULT_BODY, overrideHeaders = {}) {
const { POST } = Request.REQUEST_METHODS;
return this._authenticatedRequest(POST, endpoint, body, overrideHeaders);
}
setBearerToken(bearerToken) {
this.bearerToken = bearerToken;
}
}
export default new Kolide();