From 9bf19f81a48a2e30f32fbc71b2faaa8807d56cdb Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 14 May 2019 09:33:31 +0200 Subject: Fix card count position When introducing markdown in the title (b795115042c2eb6bccb), the card count got pushed outside of the List Header. Add its own style (by manually merge small and quiet), and restore its original placement. Fixes #2403 --- client/components/lists/list.styl | 4 ++++ client/components/lists/listHeader.jade | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/components/lists/list.styl b/client/components/lists/list.styl index dcbeb93f..05da07e1 100644 --- a/client/components/lists/list.styl +++ b/client/components/lists/list.styl @@ -99,6 +99,10 @@ .highlight color: #ce1414 + .cardCount + color: #8c8c8c + font-size: 0.8em + .list-body flex: 1 1 auto flex-direction: column diff --git a/client/components/lists/listHeader.jade b/client/components/lists/listHeader.jade index d9644d00..306659b4 100644 --- a/client/components/lists/listHeader.jade +++ b/client/components/lists/listHeader.jade @@ -19,7 +19,7 @@ template(name="listHeader") if showCardsCountForList cards.count |  - p.quiet.small {{cardsCount}} {{_ 'cards-count'}} + span(class="cardCount") {{cardsCount}} {{_ 'cards-count'}} if isMiniScreen if currentList if isWatching -- cgit v1.2.3-1-g7c22 From 94c1367684bc4d36e3f6874cff0b7a39e2f72560 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 14 May 2019 09:37:04 +0200 Subject: Restore export API Commit 477d71e0b90d1 was based on an older version of export.js, which means it reverted a few changes that were made previously. Fixes #2328 --- models/export.js | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/models/export.js b/models/export.js index 4f17d727..8e5ce786 100644 --- a/models/export.js +++ b/models/export.js @@ -6,27 +6,34 @@ if (Meteor.isServer) { // `ApiRoutes.path('boards/export', boardId)`` // on the client instead of copy/pasting the route path manually between the // client and the server. - /* - * This route is used to export the board FROM THE APPLICATION. - * If user is already logged-in, pass loginToken as param "authToken": - * '/api/boards/:boardId/export?authToken=:token' + /** + * @operation export + * @tag Boards + * + * @summary This route is used to export the board. + * + * @description If user is already logged-in, pass loginToken as param + * "authToken": '/api/boards/:boardId/export?authToken=:token' * * See https://blog.kayla.com.au/server-side-route-authentication-in-meteor/ * for detailed explanations + * + * @param {string} boardId the ID of the board we are exporting + * @param {string} authToken the loginToken */ - - JsonRoutes.add('get', '/api/boards/:boardId/export', function(req, res) { const boardId = req.params.boardId; let user = null; - // todo XXX for real API, first look for token in Authentication: header - // then fallback to parameter + const loginToken = req.query.authToken; if (loginToken) { const hashToken = Accounts._hashLoginToken(loginToken); user = Meteor.users.findOne({ 'services.resume.loginTokens.hashedToken': hashToken, }); + } else if (!Meteor.settings.public.sandstorm) { + Authentication.checkUserId(req.userId); + user = Users.findOne({ _id: req.userId, isAdmin: true }); } const exporter = new Exporter(boardId); -- cgit v1.2.3-1-g7c22 From 1eea102f26be23c65aa6abf44373fe963acd8946 Mon Sep 17 00:00:00 2001 From: Benjamin Tissoires Date: Tue, 14 May 2019 10:10:21 +0200 Subject: openAPI: also handle `export` statement in the scripts The files are actually modules, not plain scripts, and thus we are allowed to use `export`. Without `parseModule`, the script would silently fail when parsing `export.js` and the export function will not be present. --- openapi/generate_openapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/generate_openapi.py b/openapi/generate_openapi.py index 2a898f0e..1bf04c15 100644 --- a/openapi/generate_openapi.py +++ b/openapi/generate_openapi.py @@ -678,7 +678,7 @@ def parse_schemas(schemas_dir): data = ''.join(f.readlines()) try: # if the file failed, it's likely it doesn't contain a schema - program = esprima.parseScript(data, options={'comment': True, 'loc': True}) + program = esprima.parseModule(data, options={'comment': True, 'loc': True}) except: continue -- cgit v1.2.3-1-g7c22