Skip to content

Commit

Permalink
naming conventions - part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
abailly-akamai committed Jul 22, 2024
1 parent 5140469 commit 8443cd0
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 22 deletions.
4 changes: 2 additions & 2 deletions packages/manager/src/dev-tools/ServiceWorkerTool.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';

import { Tooltip } from 'src/components/Tooltip';
import { getContextPopulatorGroups } from 'src/mocks/mockContext';
import { getContextSeederGroups } from 'src/mocks/mockContext';
import { getMockPresetGroups } from 'src/mocks/mockPreset';
import {
baselineMockPresets,
Expand Down Expand Up @@ -153,7 +153,7 @@ const renderContentPopulatorOptions = (
) => {
return (
<ul>
{getContextPopulatorGroups(allContextSeeders).map((group) => (
{getContextSeederGroups(allContextSeeders).map((group) => (
<div key={group}>
<li className="dev-tools__list-box__separator">{group}</li>
{allContextSeeders
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/src/dev-tools/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function loadDevTools(
.filter((preset) => !!preset);

const mswContentSeederIds = getMSWContextSeeders();
const mswContentPopulators = mswContentSeederIds
const mswContentSeeders = mswContentSeederIds
.map((seederId) =>
allContextSeeders.find((seeder) => seeder.id === seederId)
)
Expand All @@ -63,7 +63,7 @@ export async function loadDevTools(
const seedContext = (await mswDB.getStore('seedContext')) || emptyStore;

const populateSeeds = async (store: MockContext): Promise<MockContext> => {
return await mswContentPopulators.reduce(
return await mswContentSeeders.reduce(
async (accPromise, cur: MockContextSeeder) => {
const acc = await accPromise;

Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/mocks/mockContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type { MockContext, MockContextSeeder } from './types';
*
* @returns `true` if event is considered complete, `false` if callback should continue to be called.
*/
export const getContextPopulatorGroups = (
export const getContextSeederGroups = (
seeders: MockContextSeeder[]
): Array<string | undefined> => {
return seeders.reduce((acc: Array<string | undefined>, cur) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/mocks/seeds/linodes/linodes-seeder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { MockContext, MockContextSeeder } from 'src/mocks/types';

export const linodesSeeder: MockContextSeeder = {
canUpdateCount: true,
desc: 'Populates Linodes',
desc: 'Linodes Seeds',
group: 'Linodes',
id: 'many-linodes',
label: 'Linodes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { MockContext, MockContextSeeder } from 'src/mocks/types';

export const placementGroupSeeder: MockContextSeeder = {
canUpdateCount: true,
desc: 'Populates Placement Groups',
desc: 'Placement Groups Seeds',
group: 'Placement Groups',
id: 'many-placement-groups',
label: 'Placement Groups',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { mswDB } from 'src/mocks/indexedDB';

import type { MockContext, MockContextSeeder } from 'src/mocks/types';

/**
* Populates context with Regions that simulate our Production regions.
*/
export const edgeRegionsSeeder: MockContextSeeder = {
desc: 'Populates context with mock Edge region data',
desc: 'Edge region seeds',
group: 'Regions',
id: 'edge-regions',
label: 'Edge Regions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { mswDB } from 'src/mocks/indexedDB';

import type { MockContext, MockContextSeeder } from 'src/mocks/types';

/**
* Populates context with Regions that simulate our Production regions.
*/
export const legacyRegionsSeeder: MockContextSeeder = {
desc: 'Populates context with legacy mock region data',
desc: 'Legacy region data seeds',
group: 'Regions',
id: 'legacy-test-regions',
label: 'Legacy Test Regions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@ import { mswDB } from 'src/mocks/indexedDB';

import type { MockContext, MockContextSeeder } from 'src/mocks/types';

/**
* Populates context with Regions that simulate our Production regions.
*/
export const productionRegionsSeeder: MockContextSeeder = {
desc: 'Populates context with Production-like region data',
desc: 'Production-like region seeds',
group: 'Regions',
id: 'prod-regions',
label: 'Production Regions',
Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/mocks/seeds/volumes/volumes-seeder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { MockContext, MockContextSeeder } from 'src/mocks/types';

export const volumesSeeder: MockContextSeeder = {
canUpdateCount: true,
desc: 'Populates Volumes',
desc: 'Volumes Seeds',
group: 'Volumes',
id: 'many-volumes',
label: 'Volumes',
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/src/mocks/utilities/removeSeeds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { mswDB } from 'src/mocks/indexedDB';

import type { MockContextSeeder } from 'src/mocks/types';

export const removeSeeds = async (populatorId: MockContextSeeder['id']) => {
switch (populatorId) {
export const removeSeeds = async (seederId: MockContextSeeder['id']) => {
switch (seederId) {
case 'many-linodes':
await mswDB.deleteAll('linodes', mockState, 'seedContext');
await mswDB.deleteAll('linodeConfigs', mockState, 'seedContext');
Expand Down

0 comments on commit 8443cd0

Please sign in to comment.