Skip to content

Commit 243a7c1

Browse files
committed
Addressed PR comments and added ellipses for partially hidden entries
1 parent ba5f7b7 commit 243a7c1

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/components/config-components/ConfigEntryEditor.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ function getAppropriateCommentLines(entry: ConfigurationEntry) {
117117
.slice(0, 5)
118118
.map(value => {
119119
return {
120-
...value
120+
...value,
121+
displayValue: value.displayValue.length > 200
122+
? value.displayValue.substring(0, 200) + "..."
123+
: value.displayValue,
121124
};
122125
});
123-
124-
commentLines.forEach(value => value.displayValue = value.displayValue.substring(0, 200));
125126
return commentLines;
126127
}
127128
return entry.commentLines;

src/components/config-components/ConfigSelectionLayout.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ function editConfig(file: ConfigFile) {
167167
}
168168
169169
function openConfig(file: ConfigFile) {
170-
LinkProvider.instance.openLink(file.getPath());
170+
console.log(file.getPath());
171+
LinkProvider.instance.openLink(`file://${file.getPath()}`);
171172
}
172173
173174
</script>

src/utils/ConfigUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,19 @@ async function determineEntryDisplayType(comments: string[]): Promise<Configurat
109109
async function buildComments(comments: string[]): Promise<CommentLine[]> {
110110
return comments
111111
.filter(value => value.trim().substring(1).length > 0)
112-
.map((commentLine) => {
112+
.map((commentLine): CommentLine => {
113113
if (commentLine.trim().startsWith("##")) {
114114
return {
115115
isDescription: true,
116116
displayValue: commentLine.trim().substring(2).trim(),
117117
rawValue: commentLine.trim()
118-
} as CommentLine;
118+
};
119119
} else {
120120
return {
121121
isDescription: false,
122122
displayValue: commentLine.trim().substring(1).trim(),
123123
rawValue: commentLine.trim()
124-
} as CommentLine;
124+
};
125125
}
126126
});
127127
}

test/jest/__tests__/utils/utils.ConfigUtils.ts.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
getSelectOptions, saveConfigurationFile
77
} from '../../../../src/utils/ConfigUtils';
88
import path from 'path';
9+
import { test } from '@jest/globals';
910

1011
describe('buildConfigurationFileFromPath', () => {
1112

@@ -232,7 +233,7 @@ describe('getSelectOptions', () => {
232233
commentLines: [],
233234
};
234235

235-
expect(getSelectOptions(configurationEntry)).toMatchObject(['true', 'false']);
236+
expect(getSelectOptions(configurationEntry)).toEqual(['true', 'false']);
236237
});
237238

238239
});

0 commit comments

Comments
 (0)