options UI for selecting support code note MIME types

This commit is contained in:
zadam
2019-08-29 21:08:53 +02:00
parent 9d958e1860
commit c8f59ea547
12 changed files with 257 additions and 89 deletions

View File

@@ -1,24 +0,0 @@
"use strict";
const attributesService = require('../../services/attributes');
const log = require('../../services/log');
async function get() {
const notes = await attributesService.getNotesWithLabel('codeMimeTypes');
let merged = [];
for (const note of notes) {
try {
merged = merged.concat(await note.getJsonContent());
}
catch (e) {
log.error(`Cannot merge mime types from note=${note.noteId}: ${e.message}`);
}
}
return merged;
}
module.exports = {
get
};

View File

@@ -28,7 +28,8 @@ const ALLOWED_OPTIONS = [
'attributesWidget',
'linkMapWidget',
'noteRevisionsWidget',
'whatLinksHereWidget'
'whatLinksHereWidget',
'codeNotesMimeTypes'
];
async function getOptions() {