Skip to content

Commit 1ee173e

Browse files
authored
Merge pull request #2831 from codecrafters-io/remove-fold-gutter-from-cards
refactor: remove foldGutter property from templates and components
2 parents 4ab71a9 + f6fa30f commit 1ee173e

File tree

6 files changed

+1
-24
lines changed

6 files changed

+1
-24
lines changed

app/components/file-contents-card.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
@rectangularSelection={{true}}
5353
@editable={{false}}
5454
@readOnly={{true}}
55-
@foldGutter={{if (eq @foldGutter false) false true}}
5655
@highlightActiveLine={{false}}
5756
@highlightSelectionMatches={{true}}
5857
@highlightSpecialChars={{true}}

app/components/file-contents-card.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ interface Signature {
2222
* Override language auto-detected from `filename` and set it manually
2323
*/
2424
language: string;
25-
/**
26-
* Enable code folding and fold gutter in CodeMirror
27-
*/
28-
foldGutter?: boolean;
2925
/**
3026
* Enable collapsing of the file card to just the header
3127
*/

app/controllers/demo/file-contents-card.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { tracked } from '@glimmer/tracking';
44
import EXAMPLE_DOCUMENTS, { ExampleDocument } from 'codecrafters-frontend/utils/code-mirror-documents';
55

66
const OPTION_DEFAULTS = {
7-
foldGutter: true,
87
headerTooltipText: false,
98
isCollapsed: false,
109
isCollapsible: false,
@@ -13,11 +12,9 @@ const OPTION_DEFAULTS = {
1312
};
1413

1514
export default class DemoFileContentsCardController extends Controller {
16-
queryParams = ['foldGutter', 'headerTooltipText', 'isCollapsed', 'isCollapsible', 'scrollIntoViewOnCollapse', 'selectedDocumentIndex'];
15+
queryParams = ['headerTooltipText', 'isCollapsed', 'isCollapsible', 'scrollIntoViewOnCollapse', 'selectedDocumentIndex'];
1716

1817
@tracked documents: ExampleDocument[] = EXAMPLE_DOCUMENTS;
19-
20-
@tracked foldGutter: boolean = OPTION_DEFAULTS.foldGutter;
2118
@tracked headerTooltipText: boolean = OPTION_DEFAULTS.headerTooltipText;
2219
@tracked isCollapsed: boolean = OPTION_DEFAULTS.isCollapsed;
2320
@tracked isCollapsible: boolean = OPTION_DEFAULTS.isCollapsible;

app/templates/course-admin/buildpack.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
@filename="{{@model.buildpack.slug}}.Dockerfile"
3838
@code={{@model.buildpack.dockerfileContents}}
3939
@language="dockerfile"
40-
@foldGutter={{false}}
4140
data-test-dockerfile-contents-card
4241
/>
4342
</div>

app/templates/demo/file-contents-card.hbs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
<Input @type="checkbox" @checked={{this.headerTooltipText}} disabled={{not this.isCollapsible}} />
3030
<span class="ml-2 {{unless this.isCollapsible 'text-gray-300'}}">headerTooltipText</span>
3131
</label>
32-
<label class="{{labelClasses}}" title="Enable code folding and fold gutter in CodeMirror">
33-
<Input @type="checkbox" @checked={{this.foldGutter}} />
34-
<span class="ml-2">foldGutter</span>
35-
</label>
3632
</component-options-right>
3733
</component-options>
3834
{{/let}}
@@ -45,7 +41,6 @@
4541
@isCollapsible={{this.isCollapsible}}
4642
@scrollIntoViewOnCollapse={{this.scrollIntoViewOnCollapse}}
4743
@headerTooltipText={{if this.headerTooltipText "Example tooltip message"}}
48-
@foldGutter={{this.foldGutter}}
4944
@onExpand={{fn (mut this.isCollapsed) false}}
5045
@onCollapse={{fn (mut this.isCollapsed) true}}
5146
class="mt-4"

tests/acceptance/demo-page/file-contents-card-test.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,4 @@ module('Acceptance | demo page | file-contents-card', function (hooks) {
100100
'correct tooltip message is displayed',
101101
);
102102
});
103-
104-
test("it allows toggling 'foldGutter' option", async function (assert) {
105-
await demoPage.demoTabs.fileContentsCard.visit();
106-
assert.ok(demoPage.demoTabs.fileContentsCard.component.codeMirror.gutters.foldGutter.isVisible, 'fold gutter is present');
107-
await demoPage.demoTabs.fileContentsCard.clickOnComponentOption('foldGutter');
108-
assert.notOk(demoPage.demoTabs.fileContentsCard.component.codeMirror.gutters.foldGutter.isVisible, 'fold gutter is not present');
109-
await demoPage.demoTabs.fileContentsCard.clickOnComponentOption('foldGutter');
110-
assert.ok(demoPage.demoTabs.fileContentsCard.component.codeMirror.gutters.foldGutter.isVisible, 'fold gutter is present again');
111-
});
112103
});

0 commit comments

Comments
 (0)