Skip to content

Commit 3dc5e1c

Browse files
remove comments from toolbox and editor toolbox settings modal
1 parent a409826 commit 3dc5e1c

File tree

3 files changed

+6
-75
lines changed

3 files changed

+6
-75
lines changed

src/components/nb-editor-settings-modal/editor-settings-modal.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ const toolbox_categories = [
7171
{id: 'operators', label: 'Operators'},
7272
{id: 'data', label: 'Variables'},
7373
{id: 'json', label: 'JSON'},
74-
{id: 'procedures', label: 'My Blocks'},
75-
{id: 'comments', label: 'Comments'}
74+
{id: 'procedures', label: 'My Blocks'}
7675
];
7776

7877
const BufferedInput = BufferedInputHOC(Input);

src/containers/extension-library.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,13 @@ class ExtensionLibrary extends React.PureComponent {
206206
const sourceGallery = this.state.galleryBySource ? this.state.galleryBySource[source.id] : null;
207207
const sourceStatusItems = galleryStatusItems[source.id];
208208

209+
const extensionsToExclude = ['faceSensing','lmscomments'];
210+
209211
if (sourceGallery && sourceGallery.status === 'success') {
210212
library.push(toLibraryItem(sourceStatusItems.more));
211213
library.push(
212214
...sourceGallery.extensions
213-
.filter(i => i.extensionId !== 'faceSensing')
215+
.filter(i => !extensionsToExclude.includes(i.extensionId))
214216
.map(i => translateGalleryItem(i, locale))
215217
.map(toLibraryItem)
216218
);

src/lib/make-toolbox-xml.js

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -918,73 +918,6 @@ const myBlocks = function (isInitialSetup, isStage, targetId, colors) {
918918
`;
919919
};
920920

921-
const comments = function (colors) {
922-
// Note: the category's secondaryColour matches up with the blocks' tertiary color, both used for border color.
923-
return `
924-
<category
925-
name="%{BKY_CATEGORY_COMMENTS}"
926-
id="comments"
927-
colour="${colors.primary}"
928-
secondaryColour="${colors.tertiary}">
929-
<block type="comments_hat">
930-
<value name="COMMENT">
931-
<shadow type="text">
932-
<field name="TEXT"></field>
933-
</shadow>
934-
</value>
935-
</block>
936-
<block type="comments_command">
937-
<value name="COMMENT">
938-
<shadow type="text">
939-
<field name="TEXT"></field>
940-
</shadow>
941-
</value>
942-
</block>
943-
<block type="comments_loop">
944-
<value name="COMMENT">
945-
<shadow type="text">
946-
<field name="TEXT"></field>
947-
</shadow>
948-
</value>
949-
</block>
950-
<block type="comments_reporter">
951-
<value name="VALUE">
952-
<shadow type="text">
953-
<field name="TEXT"></field>
954-
</shadow>
955-
</value>
956-
<value name="COMMENT">
957-
<shadow type="text">
958-
<field name="TEXT"></field>
959-
</shadow>
960-
</value>
961-
</block>
962-
<block type="comments_boolean">
963-
<value name="COMMENT">
964-
<shadow type="text">
965-
<field name="TEXT"></field>
966-
</shadow>
967-
</value>
968-
</block>
969-
<block type="comments_object">
970-
<value name="COMMENT">
971-
<shadow type="text">
972-
<field name="TEXT"></field>
973-
</shadow>
974-
</value>
975-
</block>
976-
<block type="comments_array">
977-
<value name="COMMENT">
978-
<shadow type="text">
979-
<field name="TEXT"></field>
980-
</shadow>
981-
</value>
982-
</block>
983-
${categorySeparator}
984-
</category>
985-
`;
986-
};
987-
988921
// eslint-disable-next-line max-len
989922
const nbBlocksColours = `colourmutprimary="#ff5726" colourmutsecondary="#f34b1a" colourmuttertiary="#e63e0d" colourmutquaternary="#e63e0d"`;
990923
// eslint-disable-next-line max-len
@@ -1046,7 +979,6 @@ const makeToolboxXML = function (vm, isInitialSetup, isStage = true, targetId, c
1046979
const variablesXML = moveCategory('data') || variables(isInitialSetup, isStage, targetId, colors.data);
1047980
const jsonXML = moveCategory('json') || json(colors.json);
1048981
const myBlocksXML = moveCategory('procedures') || myBlocks(isInitialSetup, isStage, targetId, colors.more);
1049-
const commentsXML = moveCategory('comments') || comments(colors.comments);
1050982

1051983
// Always display NitroBolt blocks as the first extension, if it exists,
1052984
// and also add an "is compiled?" block to the top.
@@ -1065,8 +997,7 @@ const makeToolboxXML = function (vm, isInitialSetup, isStage = true, targetId, c
1065997
['operators', operatorsXML],
1066998
['data', variablesXML],
1067999
['json', jsonXML],
1068-
['procedures', myBlocksXML],
1069-
['comments', commentsXML]
1000+
['procedures', myBlocksXML]
10701001
].filter(([id]) => !hiddenCategories.includes(id));
10711002

10721003
const visibleXMLs = categoryEntries.map(([, xml]) => xml);
@@ -1117,8 +1048,7 @@ makeToolboxXML.exports = {
11171048
operators,
11181049
variables,
11191050
json,
1120-
myBlocks,
1121-
comments
1051+
myBlocks
11221052
};
11231053

11241054
export default makeToolboxXML;

0 commit comments

Comments
 (0)