Skip to content

Commit c032dc4

Browse files
committed
Rename 'mock' to 'modify' everywhere
Not all rules are mocks, and for some users 'mock' can be quite a confusing phrase. Modify is clearer, and conveniently keeps us on the same Ctrl+M keyboard shortcut. 'Modify' as a verb unfortunately doesn't mean 'create a rule' unlike 'mock' so some rephrasing has been required, but hopefully everything is covered here.
1 parent cc3e148 commit c032dc4

36 files changed

+255
-251
lines changed

src/components/account/plan-picker.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,11 @@ export class PlanPicker extends React.Component<PlanPickerProps> {
407407
</TierPriceBlock>
408408
<TierFeatures>
409409
<Feature>
410-
<strong>Automated HTTP mocking & rewriting rules</strong>, including traffic redirection,
411-
mock responses, and errors & timeouts.
410+
<strong>Automated HTTP rewriting rules</strong>, including traffic
411+
redirection, mock responses, and errors & timeouts.
412412
</Feature>
413413
<Feature>
414-
<strong>Reusable Mock & Send tools</strong>. Persistent by default, plus
414+
<strong>Reusable Modify & Send tools</strong>. Persistent by default, plus
415415
import/export so you can store, reuse & share your rules & requests.
416416
</Feature>
417417
<Feature>

src/components/app.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ import { UiStore } from '../model/ui/ui-store';
1919
import {
2020
serverVersion,
2121
versionSatisfies,
22-
MOCK_SERVER_RANGE,
22+
MODIFY_RULE_SERVER_RANGE,
2323
SERVER_SEND_API_SUPPORTED
2424
} from '../services/service-versions';
2525

2626
import { Sidebar, SidebarItem, SIDEBAR_WIDTH } from './sidebar';
2727
import { InterceptPage } from './intercept/intercept-page';
2828
import { ViewPage } from './view/view-page';
29-
import { MockPage } from './mock/mock-page';
29+
import { ModifyPage } from './modify/modify-page';
3030
import { SendPage } from './send/send-page';
3131
import { SettingsPage } from './settings/settings-page';
3232

@@ -71,7 +71,7 @@ const AppKeyboardShortcuts = (props: {
7171
e.preventDefault();
7272
}, [props.navigate]);
7373
useHotkeys('Ctrl+3,Cmd+3', (e) => {
74-
props.navigate('/mock');
74+
props.navigate('/modify');
7575
e.preventDefault();
7676
}, [props.navigate]);
7777
useHotkeys('Ctrl+9,Cmd+9', (e) => {
@@ -125,18 +125,18 @@ class App extends React.Component<{
125125

126126
...(
127127
(
128-
// Hide Mock option if the server is too old for proper support.
128+
// Hide Modify option if the server is too old for proper support.
129129
// We show by default to avoid flicker in the most common case
130130
serverVersion.state !== 'fulfilled' ||
131-
versionSatisfies(serverVersion.value, MOCK_SERVER_RANGE)
131+
versionSatisfies(serverVersion.value, MODIFY_RULE_SERVER_RANGE)
132132
)
133133
? [{
134-
name: 'Mock',
135-
title: `Add rules to mock & rewrite HTTP traffic (${Ctrl}+3)`,
134+
name: 'Modify',
135+
title: `Add rules to transform & mock HTTP traffic (${Ctrl}+3)`,
136136
icon: 'Pencil',
137137
position: 'top',
138138
type: 'router',
139-
url: '/mock'
139+
url: '/modify'
140140
}]
141141
: []
142142
),
@@ -220,8 +220,8 @@ class App extends React.Component<{
220220
<Route path={'/intercept'} pageComponent={InterceptPage} />
221221
<Route path={'/view'} pageComponent={ViewPage} />
222222
<Route path={'/view/:eventId'} pageComponent={ViewPage} />
223-
<Route path={'/mock'} pageComponent={MockPage} />
224-
<Route path={'/mock/:initialRuleId'} pageComponent={MockPage} />
223+
<Route path={'/modify'} pageComponent={ModifyPage} />
224+
<Route path={'/modify/:initialRuleId'} pageComponent={ModifyPage} />
225225
<Route path={'/send'} pageComponent={SendPage} />
226226
<Route path={'/settings'} pageComponent={SettingsPage} />
227227
</Router>

src/components/common/card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const Card = styled.section.attrs((p: CardProps) => ({
9090
}
9191
`;
9292

93-
// Card-like buttons, e.g. mock rule rows & intercept buttons
93+
// Card-like buttons, e.g. modify rule rows & intercept buttons
9494
export const LittleCard = styled(Card)`
9595
padding: 15px;
9696
File renamed without changes.
File renamed without changes.
Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import { SERIALIZED_RULES_MIME_TYPE, serializeRules } from '../../model/rules/ru
2626

2727
import { clickOnEnter } from '../component-utils';
2828
import { Button, SecondaryButton } from '../common/inputs';
29-
import { MockRuleList } from './mock-rule-list';
29+
import { RuleList } from './rule-list';
3030

31-
interface MockPageProps {
31+
interface ModifyPageProps {
3232
className?: string;
3333
rulesStore: RulesStore;
3434
accountStore: AccountStore;
@@ -37,7 +37,7 @@ interface MockPageProps {
3737
initialRuleId?: string;
3838
}
3939

40-
const MockPageContainer = styled.section`
40+
const ModifyPageContainer = styled.section`
4141
box-sizing: border-box;
4242
height: 100%;
4343
width: 100%;
@@ -46,12 +46,12 @@ const MockPageContainer = styled.section`
4646
align-items: stretch;
4747
`;
4848

49-
const MockPageScrollContainer = styled.div`
49+
const ModifyPageScrollContainer = styled.div`
5050
overflow-y: scroll;
5151
flex-grow: 1;
5252
`;
5353

54-
const MockPageHeader = styled.header`
54+
const ModifyPageHeader = styled.header`
5555
box-sizing: border-box;
5656
width: 100%;
5757
padding: 20px calc(40px + 16px) 20px 40px; /* ~16px to match scrollbar below */
@@ -64,9 +64,8 @@ const MockPageHeader = styled.header`
6464
align-items: center;
6565
`;
6666

67-
const MockHeading = styled.h1`
67+
const EditHeading = styled.h1`
6868
font-size: ${p => p.theme.loudHeadingSize};
69-
font-family: ${p => p.theme.titleTextFamily};
7069
font-weight: bold;
7170
flex-grow: 1;
7271
`;
@@ -91,7 +90,7 @@ const OtherButton = styled(SecondaryButton)`
9190
@inject('rulesStore')
9291
@inject('accountStore')
9392
@observer
94-
class MockPage extends React.Component<MockPageProps> {
93+
class ModifyPage extends React.Component<ModifyPageProps> {
9594

9695
containerRef = React.createRef<HTMLDivElement>();
9796

@@ -153,9 +152,9 @@ class MockPage extends React.Component<MockPageProps> {
153152
} = this.props.rulesStore;
154153
const { isPaidUser } = this.props.accountStore;
155154

156-
return <MockPageContainer ref={this.containerRef}>
157-
<MockPageHeader>
158-
<MockHeading>Mock & Rewrite HTTP</MockHeading>
155+
return <ModifyPageContainer ref={this.containerRef}>
156+
<ModifyPageHeader>
157+
<EditHeading>Transform & Mock HTTP</EditHeading>
159158

160159
<OtherButton
161160
disabled={!areSomeRulesNonDefault}
@@ -208,10 +207,10 @@ class MockPage extends React.Component<MockPageProps> {
208207
>
209208
<Icon icon={['fas', 'save']} /> Save changes
210209
</SaveButton>
211-
</MockPageHeader>
210+
</ModifyPageHeader>
212211

213-
<MockPageScrollContainer>
214-
<MockRuleList
212+
<ModifyPageScrollContainer>
213+
<RuleList
215214
activeRules={rules}
216215
draftRules={draftRules}
217216
collapsedRulesMap={this.collapsedRulesMap}
@@ -228,8 +227,8 @@ class MockPage extends React.Component<MockPageProps> {
228227
moveRule={moveDraftRule}
229228
combineRulesAsGroup={combineDraftRulesAsGroup}
230229
/>
231-
</MockPageScrollContainer>
232-
</MockPageContainer>
230+
</ModifyPageScrollContainer>
231+
</ModifyPageContainer>
233232
}
234233

235234
@action.bound
@@ -353,8 +352,8 @@ class MockPage extends React.Component<MockPageProps> {
353352
}
354353

355354
// Exclude stores etc from the external props, as they're injected
356-
const InjectedMockPage = MockPage as unknown as WithInjected<
357-
typeof MockPage,
355+
const InjectedModifyPage = ModifyPage as unknown as WithInjected<
356+
typeof ModifyPage,
358357
'rulesStore' | 'accountStore' | 'navigate'
359358
>;
360-
export { InjectedMockPage as MockPage };
359+
export { InjectedModifyPage as ModifyPage };
File renamed without changes.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ import { Icon } from '../../icons';
1515
import {
1616
isRuleGroup,
1717
ItemPath,
18-
HtkMockRuleGroup,
18+
HtkRuleGroup,
1919
mapRules,
2020
flattenRules
2121
} from '../../model/rules/rules-structure';
2222
import { getMethodColor } from '../../model/events/categorization';
2323

2424
import { clickOnEnter, noPropagation } from '../component-utils';
2525
import { TextInput } from '../common/inputs';
26-
import { DragHandle } from './mock-drag-handle';
27-
import { IconMenu, IconMenuButton } from './mock-item-menu';
26+
import { DragHandle } from './rule-drag-handle';
27+
import { IconMenu, IconMenuButton } from './rule-icon-menu';
2828

2929
const CollapsedItemPlaceholder = styled.div<{
3030
index: number,
@@ -186,11 +186,11 @@ const extendGroupDraggableStyles = (
186186
};
187187
};
188188

189-
const isFullyActiveGroup = (group: HtkMockRuleGroup) =>
189+
const isFullyActiveGroup = (group: HtkRuleGroup) =>
190190
flattenRules(group).every(r => r.activated);
191191

192192
export const GroupHeader = observer((p: {
193-
group: HtkMockRuleGroup,
193+
group: HtkRuleGroup,
194194
path: ItemPath,
195195
index: number,
196196
collapsed: boolean,
@@ -336,7 +336,7 @@ const GroupTailPlaceholder = styled.div`
336336
margin-bottom: -20px;
337337
`;
338338

339-
export const GroupTail = (p: { group: HtkMockRuleGroup, index: number }) =>
339+
export const GroupTail = (p: { group: HtkRuleGroup, index: number }) =>
340340
<Draggable
341341
draggableId={p.group.id + '-tail'}
342342
index={p.index}

0 commit comments

Comments
 (0)