Commit 5756979e authored by Mo Firouz's avatar Mo Firouz
Browse files

API Explorer, and pagination bug fixes.

parent 4bfba42d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -147,11 +147,11 @@ To build the codebase and generate all sources follow these steps.
   go get -u github.com/gobuffalo/packr/...
   ```

2. If you've made changes to the embedded Developer Console.
2. If you've made changes to the embedded Console.

    ```shell
    cd console/ui
    yarn run build
    ng serve
    cd ../../
    ```

+2 −2

File changed.

Preview size limit exceeded, changes collapsed.

+10 −11
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ export class AccountListComponent implements OnInit {
      filter_type: [0], // 0 for all, 1 for tombstones
    });

    this.route.queryParamMap.subscribe(qp => {
    let qp = this.route.snapshot.queryParamMap;
    this.f.filter.setValue(qp.get('filter'));
    this.f.filter_type.setValue(+qp.get('filter_type'));
    this.next_cursor = qp.get('cursor');
@@ -56,7 +56,6 @@ export class AccountListComponent implements OnInit {
    } else if (this.f.filter.value || this.f.filter_type.value) {
      this.search(0);
    }
    });

    this.route.data.subscribe(
      d => {
+19 −5
Original line number Diff line number Diff line
@@ -68,14 +68,22 @@ export class ApiExplorerComponent implements OnInit, AfterViewInit {
      this.error = err;
    });

    this.route.queryParamMap.subscribe(qp => {
    let qp = this.route.snapshot.queryParamMap;
    const endpoint = this.rpcEndpoints.find((e) => {
      return e.method === qp.get('endpoint') ? e : null;
    })
    if (endpoint != null) {
      this.f.custom_rpc.setValue(true);
      this.f.method.setValue(endpoint.method);
    } else {
      const endpoint = this.endpoints.find((e) => {
        return e.method === qp.get('endpoint') ? e : null;
      })
      if (endpoint != null) {
        this.f.custom_rpc.setValue(false);
        this.f.method.setValue(endpoint.method);
      }
    });
    }
  }

  ngAfterViewInit(): void {
@@ -108,7 +116,7 @@ export class ApiExplorerComponent implements OnInit, AfterViewInit {
      body: value,
    }

    const endpointCall = this.f.custom_rpc.value ? this.consoleService.callRpcEndpoint('', this.f.method.value, req) : this.consoleService.callApiEndpoint('', this.f.method.value, req);
    const endpointCall = this.f.custom_rpc.value === true ? this.consoleService.callRpcEndpoint('', this.f.method.value, req) : this.consoleService.callApiEndpoint('', this.f.method.value, req);
    endpointCall.subscribe(resp => {
      if (resp.error_message && resp.error_message !== '') {
        this.aceEditorResponse.session.setValue(resp.error_message);
@@ -131,7 +139,13 @@ export class ApiExplorerComponent implements OnInit, AfterViewInit {
  setupRequestBody(body) {
    if (!body || body === '') {
      this.aceEditor.session.setValue('');

      if (this.f.custom_rpc.value !== true) {
        this.aceEditor.setReadOnly(true);
      } else {
        this.aceEditor.setReadOnly(false);
      }

      return;
    }

+12 −13
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ export class StorageListComponent implements OnInit {
      user_id: [''],
    });

    this.route.queryParamMap.subscribe(qp => {
    let qp = this.route.snapshot.queryParamMap;
    this.f.collection.setValue(qp.get('collection'));
    this.f.key.setValue(qp.get('key'));
    this.f.user_id.setValue(qp.get('user_id'));
@@ -60,7 +60,6 @@ export class StorageListComponent implements OnInit {
    } else if (this.f.collection.value || this.f.user_id.value) {
      this.search(0);
    }
    });

    this.route.data.subscribe(
      d => {
Loading