Skip to content
This repository was archived by the owner on Mar 24, 2023. It is now read-only.

Commit f41ca96

Browse files
author
Ben Junya
authored
Fix filetree scrolling (#996)
Fix filetree scrolling
2 parents 34d01be + 208f8d1 commit f41ca96

File tree

4 files changed

+48
-42
lines changed

4 files changed

+48
-42
lines changed

web/init/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@replicatedhq/ship-init",
3-
"version": "1.6.3",
3+
"version": "1.6.4",
44
"description": "Shared component that contains the Ship Init app",
55
"author": "Replicated, Inc.",
66
"license": "Apache-2.0",

web/init/src/components/kustomize/kustomize_overlay/KustomizeOverlay.jsx

+38-36
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ export default class KustomizeOverlay extends React.Component {
139139
};
140140
await this.props.applyPatch(applyPayload)
141141
.catch((err) => {
142-
this.setState({
142+
this.setState({
143143
applyPatchErr: true,
144-
applyPatchErrorMessage: err.message
144+
applyPatchErrorMessage: err.message
145145
});
146146

147147
setTimeout(() => {
148-
this.setState({
148+
this.setState({
149149
applyPatchErr: false,
150-
applyPatchErrorMessage: ""
150+
applyPatchErrorMessage: ""
151151
});
152152
}, 3000);
153153
});
@@ -423,40 +423,42 @@ export default class KustomizeOverlay extends React.Component {
423423
<div className="flex flex1 u-minHeight--full u-height--full">
424424
<div className="flex-column flex1 Sidebar-wrapper u-overflow--hidden">
425425
<div className="flex-column flex1">
426-
<div className="flex1 dirtree-wrapper flex-column u-overflow-hidden u-background--biscay">
427-
{fileTree.map((tree, i) => (
428-
<div className={`u-overflow--auto FileTree-wrapper u-position--relative dirtree ${i > 0 ? "flex-auto has-border" : "flex-0-auto"}`} key={i}>
429-
<input type="checkbox" name={`sub-dir-${tree.name}-${tree.children.length}-${tree.path}-${i}`} id={`sub-dir-${tree.name}-${tree.children.length}-${tree.path}-${i}`} defaultChecked={true} />
430-
<label htmlFor={`sub-dir-${tree.name}-${tree.children.length}-${tree.path}-${i}`}>{tree.name === "/" ? "base" : tree.name}</label>
431-
<FileTree
432-
files={tree.children}
433-
basePath={tree.name}
434-
handleFileSelect={(path) => this.setSelectedFile(path)}
435-
handleDeleteOverlay={this.toggleModal}
436-
handleClickExcludedBase={this.toggleModalForExcludedBase}
437-
selectedFile={this.state.selectedFile}
438-
isOverlayTree={tree.name === "overlays"}
439-
isResourceTree={tree.name === "resources"}
440-
isBaseTree={tree.name === "/"}
426+
<div className="flex1 u-overflow--auto u-background--biscay">
427+
<div className="flex1 dirtree-wrapper u-overflow--hidden flex-column">
428+
{fileTree.map((tree, i) => (
429+
<div className={`u-overflow--auto FileTree-wrapper u-position--relative dirtree ${i > 0 ? "flex-auto has-border" : "flex-0-auto"}`} key={i}>
430+
<input type="checkbox" name={`sub-dir-${tree.name}-${tree.children.length}-${tree.path}-${i}`} id={`sub-dir-${tree.name}-${tree.children.length}-${tree.path}-${i}`} defaultChecked={true} />
431+
<label htmlFor={`sub-dir-${tree.name}-${tree.children.length}-${tree.path}-${i}`}>{tree.name === "/" ? "base" : tree.name}</label>
432+
<FileTree
433+
files={tree.children}
434+
basePath={tree.name}
435+
handleFileSelect={(path) => this.setSelectedFile(path)}
436+
handleDeleteOverlay={this.toggleModal}
437+
handleClickExcludedBase={this.toggleModalForExcludedBase}
438+
selectedFile={this.state.selectedFile}
439+
isOverlayTree={tree.name === "overlays"}
440+
isResourceTree={tree.name === "resources"}
441+
isBaseTree={tree.name === "/"}
442+
/>
443+
</div>
444+
))}
445+
<div className="add-new-resource u-position--relative" ref={this.addResourceWrapper}>
446+
<input
447+
type="text"
448+
className={`Input add-resource-name-input u-position--absolute ${!addingNewResource ? "u-visibility--hidden" : ""}`}
449+
name="new-resource"
450+
placeholder="filename.yaml"
451+
onChange={(e) => { this.setState({ newResourceName: e.target.value }) }}
452+
onKeyPress={(e) => { this.handleCreateNewResource(e) }}
453+
value={newResourceName}
454+
ref={this.addResourceInput}
441455
/>
456+
<p
457+
className={`add-resource-link u-position--absolute u-marginTop--small u-marginLeft--normal u-cursor--pointer u-fontSize--small u-color--silverSand u-fontWeight--bold ${addingNewResource ? "u-visibility--hidden" : ""}`}
458+
onClick={this.handleAddResourceClick}
459+
>+ Add Resource
460+
</p>
442461
</div>
443-
))}
444-
<div className="add-new-resource u-position--relative" ref={this.addResourceWrapper}>
445-
<input
446-
type="text"
447-
className={`Input add-resource-name-input u-position--absolute ${!addingNewResource ? "u-visibility--hidden" : ""}`}
448-
name="new-resource"
449-
placeholder="filename.yaml"
450-
onChange={(e) => { this.setState({ newResourceName: e.target.value }) }}
451-
onKeyPress={(e) => { this.handleCreateNewResource(e) }}
452-
value={newResourceName}
453-
ref={this.addResourceInput}
454-
/>
455-
<p
456-
className={`add-resource-link u-position--absolute u-marginTop--small u-marginLeft--normal u-cursor--pointer u-fontSize--small u-color--silverSand u-fontWeight--bold ${addingNewResource ? "u-visibility--hidden" : ""}`}
457-
onClick={this.handleAddResourceClick}
458-
>+ Add Resource
459-
</p>
460462
</div>
461463
</div>
462464
</div>

web/init/src/scss/components/shared/FileTree.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.dirtree-wrapper {
22
background-color: #124B71;
3-
padding-bottom: 30px;
3+
padding-bottom: 80px;
44
}
55

66
.dirtree {

web/init/src/scss/utilities/colors.scss

+8-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
.u-color--tundora {
1818
color: #4A4A4A;
1919
}
20-
20+
2121
.u-color--doveGray {
2222
color: #717171;
2323
}
24-
24+
2525
.u-color--dustyGray {
2626
color: #9B9B9B;
2727
}
@@ -34,10 +34,14 @@
3434
color: #65A61D;
3535
}
3636

37-
.u-color--chateauGreen {
38-
color: #44BB66;
37+
.u-color--chateauGreen {
38+
color: #44BB66;
3939
}
4040

4141
.u-color--error {
4242
color: #EE5042;
4343
}
44+
45+
.u-background--biscay {
46+
background-color: #124B71;
47+
}

0 commit comments

Comments
 (0)