diff --git a/addons/api/mirage/config.js b/addons/api/mirage/config.js index 0fd3244a9..951956a46 100644 --- a/addons/api/mirage/config.js +++ b/addons/api/mirage/config.js @@ -74,10 +74,10 @@ function routes() { }); } const filteredResultSet = resultSet.filter(makeBooleanFilter(filter)); - // add a list_token to the response to simulate pagination - // without having list_token, the unsupported controller modal + // add a response_type to the response to simulate pagination + // without having response_type, the unsupported controller modal // will show when running with mirage - return { items: filteredResultSet.models, list_token: '12345' }; + return { items: filteredResultSet.models, response_type: 'complete' }; }, ); this.post('/scopes', function ({ scopes }) { diff --git a/ui/desktop/app/routes/scopes.js b/ui/desktop/app/routes/scopes.js index 1e8d011a1..dda345285 100644 --- a/ui/desktop/app/routes/scopes.js +++ b/ui/desktop/app/routes/scopes.js @@ -25,7 +25,9 @@ export default class ScopesRoute extends Route { page_size: 1, recursive: true, }); - if (scopesCheck.list_token) { + // we use the response_type to determine if pagination is supported + // and this will still pass even if there are no scopes returned + if (scopesCheck.response_type) { this.isPaginationSupported = true; } } catch (e) { diff --git a/ui/desktop/tests/acceptance/scopes-test.js b/ui/desktop/tests/acceptance/scopes-test.js index 8d6e1880a..33b236fcf 100644 --- a/ui/desktop/tests/acceptance/scopes-test.js +++ b/ui/desktop/tests/acceptance/scopes-test.js @@ -259,7 +259,7 @@ module('Acceptance | scopes', function (hooks) { return new Response(200, {}, META_DATA_RESPONSE); }); this.server.get('/scopes', () => { - // no "list_token" field + // no "response_type" field return new Response(200, {}, { scopes: [] }); }); @@ -279,7 +279,7 @@ module('Acceptance | scopes', function (hooks) { isLinux: false, }); this.server.get('/scopes', () => { - // no "list_token" field + // no "response_type" field return new Response(200, {}, { scopes: [] }); }); this.server.get('https://api.releases.hashicorp.com/*', () => { @@ -302,7 +302,7 @@ module('Acceptance | scopes', function (hooks) { isLinux: true, }); this.server.get('/scopes', () => { - // no "list_token" field + // no "response_type" field return new Response(200, {}, { scopes: [] }); }); this.server.get('https://api.releases.hashicorp.com/*', () => { @@ -325,7 +325,7 @@ module('Acceptance | scopes', function (hooks) { isLinux: false, }); this.server.get('/scopes', () => { - // no "list_token" field + // no "response_type" field return new Response(200, {}, { scopes: [] }); }); this.server.get('https://api.releases.hashicorp.com/*', () => { @@ -350,7 +350,7 @@ module('Acceptance | scopes', function (hooks) { isLinux: false, }); this.server.get('/scopes', () => { - // no "list_token" field + // no "response_type" field return new Response(200, {}, { scopes: [] }); }); this.server.get('https://api.releases.hashicorp.com/*', () => {