notion 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c99389e680f113f6288c7809f95c3c4b86b894c7c0b741dd774d5738b398b241
|
4
|
+
data.tar.gz: 1f995b8c4d27874a248bf99023efe02a96198231e0a7cfb51d139bbae45f6cac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65d7e7713162c1ca4e694972715d904b927dada01eb3c679f9470119bb7c35afa801ffc2894cba5485348a6ae1beb4b6df931af3fada0f74317d0ae1bd27d94d
|
7
|
+
data.tar.gz: 375a2c1357cd5a56064a86fe650e523ddaee2834d7d0e3039b6a73d17b5157e418a4f2fa298562748e1bee350fcf5221efe1880db8b60970f2462556c4bc8468
|
@@ -61,7 +61,7 @@ module NotionAPI
|
|
61
61
|
data.keys.each_with_index do |col_name, j|
|
62
62
|
unless col_map.keys.include?(col_name.to_s); raise ArgumentError, "Column '#{col_name.to_s}' does not exist." end
|
63
63
|
if %q[select multi_select].include?(schema[col_map[col_name.to_s]]["type"])
|
64
|
-
options = schema[col_map[col_name.to_s]]["options"].map {|option| option["value"]}
|
64
|
+
options = schema[col_map[col_name.to_s]]["options"].nil? ? [] : schema[col_map[col_name.to_s]]["options"].map {|option| option["value"]}
|
65
65
|
if !options.include?(data[col_name])
|
66
66
|
create_new_option = Utils::CollectionViewComponents.add_new_option(col_map[col_name.to_s], data[col_name], @collection_id)
|
67
67
|
operations.push(create_new_option)
|
data/lib/notion_api/utils.rb
CHANGED
@@ -491,6 +491,8 @@ module Utils
|
|
491
491
|
end
|
492
492
|
|
493
493
|
def self.add_new_option(column, value, collection_id)
|
494
|
+
colors = ["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red"]
|
495
|
+
random_color = colors[rand(0...colors.length)]
|
494
496
|
table = "collection"
|
495
497
|
path = ["schema", column, "options"]
|
496
498
|
command = "keyedObjectListAfter"
|
@@ -498,7 +500,7 @@ module Utils
|
|
498
500
|
"value": {
|
499
501
|
"id": SecureRandom.hex(16),
|
500
502
|
"value": value,
|
501
|
-
"color":
|
503
|
+
"color": random_color
|
502
504
|
}
|
503
505
|
}
|
504
506
|
|
data/lib/notion_api/version.rb
CHANGED