Skip to content

Commit

Permalink
Merge pull request #196 from akkeris/app-quick-load
Browse files Browse the repository at this point in the history
Fast App Loading
  • Loading branch information
sbeck14 authored Dec 6, 2021
2 parents 54f8112 + cae5639 commit b17da51
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/Addons/AttachAddon.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default class AttachAddon extends BaseComponent {
getApps = async () => {
const { app } = this.props;
try {
const { data: apps } = await this.api.getApps();
const { data: apps } = await this.api.getApps('?simple=true');
// Remove the current app from the results
apps.splice(apps.findIndex(i => i.name.toLowerCase() === app.toLowerCase()), 1);
this.setState({ apps, loading: false });
Expand Down
2 changes: 1 addition & 1 deletion src/components/GlobalSearch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ class GlobalSearch extends BaseComponent {

getOptions = async () => {
try {
const { data: apps } = await this.api.getApps();
const { data: apps } = await this.api.getApps('?simple=true');
const { data: pipelines } = await this.api.getPipelines();
const { data: sites } = await this.api.getSites();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export default class CreateOrUpdatePipelineCoupling extends BaseComponent {
...deepCopy(originalState),
selected: this.props.coupling ? this.props.coupling.required_status_checks.contexts : [],
});
const { data: apps } = await this.api.getApps();
const { data: apps } = await this.api.getApps('?simple=true');
const {
data: statuses,
} = await this.api.getAvailablePipelineStatuses(this.props.pipeline.name);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Sites/NewRoute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default class NewRoute extends BaseComponent {

getApps = async () => {
try {
const { data: apps } = await this.api.getApps();
const { data: apps } = await this.api.getApps('?simple=true');
apps.forEach((i) => { i.value = i.id; i.label = i.name; }); // eslint-disable-line
this.setState({ apps, app: apps[0], loading: false });
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion src/scenes/Apps/Apps.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default class Apps extends BaseComponent {
try {
const { data: spaces } = await this.api.getSpaces();
const { data: regions } = await this.api.getRegions();
let { data: apps } = await this.api.getApps();
let { data: apps } = await this.api.getApps('?simple=true');
const { data: favorites } = await this.api.getFavorites();
apps = apps.map(app => ({
...app,
Expand Down
4 changes: 2 additions & 2 deletions src/services/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function isCancel(error) {
// unless the function is bound to an object that has this.cancelToken set
// before it is invoked.

function getApps() {
return axios.get('/api/apps', { cancelToken: this.cancelToken });
function getApps(paramstring) {
return axios.get(paramstring ? `/api/apps${paramstring}` : '/api/apps', { cancelToken: this.cancelToken });
}

function getApp(app) {
Expand Down

0 comments on commit b17da51

Please sign in to comment.