Skip to content

Commit da083c2

Browse files
authored
Merge pull request wekan#2406 from bentiss/fixes
card count placement and export API functionality back
2 parents 6ee17ab + 1eea102 commit da083c2

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

Diff for: client/components/lists/list.styl

+4
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@
9999
.highlight
100100
color: #ce1414
101101

102+
.cardCount
103+
color: #8c8c8c
104+
font-size: 0.8em
105+
102106
.list-body
103107
flex: 1 1 auto
104108
flex-direction: column

Diff for: client/components/lists/listHeader.jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ template(name="listHeader")
1919

2020
if showCardsCountForList cards.count
2121
| 
22-
p.quiet.small {{cardsCount}} {{_ 'cards-count'}}
22+
span(class="cardCount") {{cardsCount}} {{_ 'cards-count'}}
2323
if isMiniScreen
2424
if currentList
2525
if isWatching

Diff for: models/export.js

+15-8
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,34 @@ if (Meteor.isServer) {
66
// `ApiRoutes.path('boards/export', boardId)``
77
// on the client instead of copy/pasting the route path manually between the
88
// client and the server.
9-
/*
10-
* This route is used to export the board FROM THE APPLICATION.
11-
* If user is already logged-in, pass loginToken as param "authToken":
12-
* '/api/boards/:boardId/export?authToken=:token'
9+
/**
10+
* @operation export
11+
* @tag Boards
12+
*
13+
* @summary This route is used to export the board.
14+
*
15+
* @description If user is already logged-in, pass loginToken as param
16+
* "authToken": '/api/boards/:boardId/export?authToken=:token'
1317
*
1418
* See https://blog.kayla.com.au/server-side-route-authentication-in-meteor/
1519
* for detailed explanations
20+
*
21+
* @param {string} boardId the ID of the board we are exporting
22+
* @param {string} authToken the loginToken
1623
*/
17-
18-
1924
JsonRoutes.add('get', '/api/boards/:boardId/export', function(req, res) {
2025
const boardId = req.params.boardId;
2126
let user = null;
22-
// todo XXX for real API, first look for token in Authentication: header
23-
// then fallback to parameter
27+
2428
const loginToken = req.query.authToken;
2529
if (loginToken) {
2630
const hashToken = Accounts._hashLoginToken(loginToken);
2731
user = Meteor.users.findOne({
2832
'services.resume.loginTokens.hashedToken': hashToken,
2933
});
34+
} else if (!Meteor.settings.public.sandstorm) {
35+
Authentication.checkUserId(req.userId);
36+
user = Users.findOne({ _id: req.userId, isAdmin: true });
3037
}
3138

3239
const exporter = new Exporter(boardId);

Diff for: openapi/generate_openapi.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ def parse_schemas(schemas_dir):
678678
data = ''.join(f.readlines())
679679
try:
680680
# if the file failed, it's likely it doesn't contain a schema
681-
program = esprima.parseScript(data, options={'comment': True, 'loc': True})
681+
program = esprima.parseModule(data, options={'comment': True, 'loc': True})
682682
except:
683683
continue
684684

0 commit comments

Comments
 (0)