refactor: 💡 Change variable name for peeking db (#2954)
This commit is contained in:
1 parent
e0982da744
commit
a4bf02b21b
15 files changed
+20
-20
No files matched your search
@@ -36,7 +36,7 @@ export default class IndexedDbHandler {
|
||||
query,
|
||||
options: {
|
||||
pushToStore = true,
|
||||
peekIndexedDB = false,
|
||||
peekDb = false,
|
||||
storeToken = true,
|
||||
} = {},
|
||||
} = data;
|
||||
@@ -55,7 +55,7 @@ export default class IndexedDbHandler {
|
||||
const schema = store.modelFor(type);
|
||||
const serializer = store.serializerFor(type);
|
||||
|
||||
if (!peekIndexedDB) {
|
||||
if (!peekDb) {
|
||||
const tokenKey = `${type}-${hashCode(remainingQuery)}`;
|
||||
let payload;
|
||||
let listToken;
|
||||
|
||||
@@ -149,7 +149,7 @@ module('Unit | Handler | indexed-db-handler', function (hooks) {
|
||||
);
|
||||
});
|
||||
|
||||
test('it loads from indexeddb only and does not fetch from api, when peekIndexedDB option is used', async function (assert) {
|
||||
test('it loads from indexeddb only and does not fetch from api, when peekDb option is used', async function (assert) {
|
||||
const callCounts = {
|
||||
get writeToIndexedDb() {
|
||||
return indexedbHandlerSpy.writeToIndexedDb.callCount;
|
||||
@@ -181,7 +181,7 @@ module('Unit | Handler | indexed-db-handler', function (hooks) {
|
||||
expectedWriteToIndexedDbCallCount,
|
||||
);
|
||||
|
||||
await store.query('alias', {}, { peekIndexedDB: true });
|
||||
await store.query('alias', {}, { peekDb: true });
|
||||
assert.strictEqual(results.length, 50);
|
||||
|
||||
// second run does not increase call counts to api or writes to indexeddb
|
||||
|
||||
@@ -118,7 +118,7 @@ export default class ScopesScopeAliasesIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const aliases = await this.store.query(
|
||||
'alias',
|
||||
{
|
||||
|
||||
@@ -132,7 +132,7 @@ export default class ScopesScopeAuthMethodsIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const authMethod = await this.store.query(
|
||||
'auth-method',
|
||||
{
|
||||
|
||||
@@ -117,7 +117,7 @@ export default class ScopesScopeCredentialStoresIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const credentialStore = await this.store.query(
|
||||
'credential-store',
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ export default class ScopesScopeGroupsIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const group = await this.store.query(
|
||||
'group',
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ export default class ScopesScopeHostCatalogsIndexRoute extends Route {
|
||||
return true;
|
||||
}
|
||||
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const hostCatalogs = await this.store.query(
|
||||
'host-catalog',
|
||||
{
|
||||
|
||||
@@ -117,7 +117,7 @@ export default class ScopesScopeRolesIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const role = await this.store.query(
|
||||
'role',
|
||||
{
|
||||
|
||||
@@ -108,7 +108,7 @@ export default class ScopesScopeRolesRoleManageScopesManageCustomScopesRoute ext
|
||||
* @returns {Promise<[ScopeModel]>}
|
||||
*/
|
||||
async getAllProjects() {
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
return this.store.query(
|
||||
'scope',
|
||||
{
|
||||
@@ -156,7 +156,7 @@ export default class ScopesScopeRolesRoleManageScopesManageCustomScopesRoute ext
|
||||
if (!search) {
|
||||
return totalItems;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const filters = canSelectOrgs
|
||||
? { scope_id: [{ equals: 'global' }] }
|
||||
: { type: [{ equals: TYPE_SCOPE_PROJECT }] };
|
||||
|
||||
@@ -93,7 +93,7 @@ export default class ScopesScopeRolesRoleManageScopesManageOrgProjectsRoute exte
|
||||
if (!search) {
|
||||
return totalItems;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const scopes = await this.store.query(
|
||||
'scope',
|
||||
{
|
||||
@@ -123,7 +123,7 @@ export default class ScopesScopeRolesRoleManageScopesManageOrgProjectsRoute exte
|
||||
if (role.scope.isGlobal && selectedProjectIDs.length) {
|
||||
const id = [];
|
||||
selectedProjectIDs.forEach((projectID) => id.push({ equals: projectID }));
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const projects = await this.store.query(
|
||||
'scope',
|
||||
{ scope_id: 'global', query: { filters: { id } } },
|
||||
|
||||
@@ -103,7 +103,7 @@ export default class ScopesScopeRolesRoleScopesRoute extends Route {
|
||||
* @returns {Promise<[ScopeModel]>}
|
||||
*/
|
||||
async getAllGrantScopes(id) {
|
||||
const options = { pushToStore: false, peekIndexedDb: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
return this.store.query(
|
||||
'scope',
|
||||
{ scope_id: 'global', query: { filters: { id } } },
|
||||
|
||||
@@ -101,7 +101,7 @@ export default class ScopesScopeScopesIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const scopes = await this.store.query(
|
||||
'scope',
|
||||
{
|
||||
|
||||
@@ -171,7 +171,7 @@ export default class ScopesScopeSessionRecordingsIndexRoute extends Route {
|
||||
* @param {string} scope_id
|
||||
*/
|
||||
async getAllSessionRecordings(scope_id) {
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
this.allSessionRecordings = await this.store.query(
|
||||
'session-recording',
|
||||
{
|
||||
@@ -192,7 +192,7 @@ export default class ScopesScopeSessionRecordingsIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const sessionRecordings = await this.store.query(
|
||||
'session-recording',
|
||||
{
|
||||
|
||||
@@ -149,7 +149,7 @@ export default class ScopesScopeTargetsIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const targets = await this.store.query(
|
||||
'target',
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ export default class ScopesScopeUsersIndexRoute extends Route {
|
||||
if (totalItems > 0) {
|
||||
return true;
|
||||
}
|
||||
const options = { pushToStore: false, peekIndexedDB: true };
|
||||
const options = { pushToStore: false, peekDb: true };
|
||||
const user = await this.store.query(
|
||||
'user',
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user