From ff50279e69f5807b28ceb2261150a831d61954ed Mon Sep 17 00:00:00 2001 From: yan Date: Thu, 1 Jun 2017 17:58:55 -0700 Subject: [PATCH 1/2] Add hideInToolbar field to api.proto bookmarks needed for https://github.com/brave/browser-laptop/issues/8024 --- lib/api.proto | 5 +++-- lib/api.proto.js | 19 +++++++++++++++++++ test/client/recordUtil.js | 4 +++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/api.proto b/lib/api.proto index f4af054..aa801fc 100644 --- a/lib/api.proto +++ b/lib/api.proto @@ -44,9 +44,10 @@ message SyncRecord { Site site = 1; bool isFolder = 2; bytes parentFolderObjectId = 3; - bytes previousObjectId = 4; - bytes nextObjectId = 5; + bytes previousObjectId = 4; // unused + bytes nextObjectId = 5; // unused repeated string fields = 6; + bool hideInToolbar = 7; } message SiteSetting { string hostPattern = 1; diff --git a/lib/api.proto.js b/lib/api.proto.js index 46991da..3114dfc 100644 --- a/lib/api.proto.js +++ b/lib/api.proto.js @@ -1610,6 +1610,12 @@ */ Bookmark.prototype.fields = $util.emptyArray; + /** + * Bookmark hideInToolbar. + * @type {boolean|undefined} + */ + Bookmark.prototype.hideInToolbar = false; + // Lazily resolved type references var $types = { 0: "api.SyncRecord.Site" @@ -1646,6 +1652,8 @@ if (message.fields !== undefined && message.hasOwnProperty("fields")) for (var i = 0; i < message.fields.length; ++i) writer.uint32(/* id 6, wireType 2 =*/50).string(message.fields[i]); + if (message.hideInToolbar !== undefined && message.hasOwnProperty("hideInToolbar")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.hideInToolbar); return writer; }; @@ -1692,6 +1700,9 @@ message.fields = []; message.fields.push(reader.string()); break; + case 7: + message.hideInToolbar = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -1743,6 +1754,9 @@ if (!$util.isString(message.fields[i])) return "fields: string[] expected"; } + if (message.hideInToolbar !== undefined) + if (typeof message.hideInToolbar !== "boolean") + return "hideInToolbar: boolean expected"; return null; }; @@ -1784,6 +1798,8 @@ for (var i = 0; i < object.fields.length; ++i) message.fields[i] = String(object.fields[i]); } + if (object.hideInToolbar !== undefined && object.hideInToolbar !== null) + message.hideInToolbar = Boolean(object.hideInToolbar); return message; }; @@ -1814,6 +1830,7 @@ object.parentFolderObjectId = options.bytes === String ? "" : []; object.previousObjectId = options.bytes === String ? "" : []; object.nextObjectId = options.bytes === String ? "" : []; + object.hideInToolbar = false; } if (message.site !== undefined && message.site !== null && message.hasOwnProperty("site")) object.site = $types[0].toObject(message.site, options); @@ -1830,6 +1847,8 @@ for (var j = 0; j < message.fields.length; ++j) object.fields[j] = message.fields[j]; } + if (message.hideInToolbar !== undefined && message.hideInToolbar !== null && message.hasOwnProperty("hideInToolbar")) + object.hideInToolbar = message.hideInToolbar; return object; }; diff --git a/test/client/recordUtil.js b/test/client/recordUtil.js index 9990a68..48f1159 100644 --- a/test/client/recordUtil.js +++ b/test/client/recordUtil.js @@ -32,6 +32,7 @@ const siteProps = { const props = { bookmark: { isFolder: false, + hideInToolbar: true, site: siteProps }, historySite: siteProps, @@ -406,7 +407,8 @@ test('recordUtil.syncRecordAsJS()', (t) => { const bookmark = serializer.api.SyncRecord.Bookmark.create({ site, isFolder: false, - parentFolderObjectId: testHelper.newUuid() + parentFolderObjectId: testHelper.newUuid(), + hideInToolbar: true }) conversionEquals({ objectData: 'bookmark', bookmark }) From c28d892b0ceafeed2c0f7838f495a7fc9d975870 Mon Sep 17 00:00:00 2001 From: yan Date: Fri, 2 Jun 2017 12:11:48 -0700 Subject: [PATCH 2/2] try upgrading to trusty --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a374dc2..64f9c0f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,7 @@ script: - yarn check - yarn browsertest - yarn coverage -group: stable -dist: precise +dist: trusty os: linux addons: apt: