Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Commit

Permalink
Add hideInToolbar field to api.proto bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
diracdeltas committed Jun 2, 2017
1 parent ca3f0e0 commit d915811
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 19 additions & 0 deletions lib/api.proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -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;
};

Expand Down Expand Up @@ -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);
Expand All @@ -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;
};

Expand Down
7 changes: 5 additions & 2 deletions test/client/recordUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const siteProps = {
const props = {
bookmark: {
isFolder: false,
hideInToolbar: true,
site: siteProps
},
historySite: siteProps,
Expand Down Expand Up @@ -293,7 +294,8 @@ test('recordUtil.resolve', (t) => {
creationTime: time,
favicon: ''
},
isFolder: false
isFolder: false,
hideInToolbar: false
},
objectData: 'bookmark'
}
Expand Down Expand Up @@ -406,7 +408,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 })

Expand Down

0 comments on commit d915811

Please sign in to comment.