Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native support of Notion #4

Closed
IAmVigneswaran opened this issue Feb 25, 2023 · 21 comments
Closed

Native support of Notion #4

IAmVigneswaran opened this issue Feb 25, 2023 · 21 comments
Assignees
Labels
csv2notion-neo CSV2Notion Neo Related enhancement New Feature Or Request
Milestone

Comments

@IAmVigneswaran
Copy link
Contributor

IAmVigneswaran commented Feb 25, 2023

We will be using the latest pre-compiled macos binary from this project.

The latest version is 0.3.8

@IAmVigneswaran IAmVigneswaran added the enhancement New Feature Or Request label Feb 25, 2023
@IAmVigneswaran IAmVigneswaran added this to the 1.0.0 milestone Feb 25, 2023
@IAmVigneswaran
Copy link
Contributor Author

@milanvarady For Notion integration, we will be using the latest pre-compiled macOS binary from CSV2Notion Neo.

We have fixed some of the core bugs.

Thank you.

@IAmVigneswaran
Copy link
Contributor Author

@milanvarady

For each Notion Profile we can have 2 operation -

Default Mode (Merge With Existing Database is always checked)

Both Notion Session Token and Notion URL will be is a required filed.

DB-Mockup-03

We use this.

#!/bin/sh

TOOL_PATH="REPLACE"
NOTION_TOKEN="REPLACE"
NOTION_URL="REPLACE"
UPLOAD_CSV="REPLACE"
UPLOAD_LOG="REPLACE"

$TOOL_PATH --token $NOTION_TOKEN --url $NOTION_URL --image-column "Image Filename" --image-column-keep --mandatory-column "Marker ID" --icon-column "Icon Image" --max-threads 5 --merge --log $UPLOAD_LOG "$UPLOAD_CSV"

When Merge With Existing Database is unchecked, Notion URL would be grey out.

You would need to use this when Merge With Existing Database is unchecked.

#!/bin/sh

TOOL_PATH="REPLACE"
NOTION_TOKEN="REPLACE"
NOTION_URL="REPLACE"
UPLOAD_CSV="REPLACE"
UPLOAD_LOG="REPLACE"

$TOOL_PATH --token $NOTION_TOKEN --image-column "Image Filename" --image-column-keep --mandatory-column "Marker ID" --icon-column "Icon Image" --max-threads 5 --log $UPLOAD_LOG --verbose "$UPLOAD_CSV"

We don't need to use --add-missing-columns flag for our Marker Data use case. Cause there is no missing-columns.

@IAmVigneswaran
Copy link
Contributor Author

@milanvarady With the shift to .json format, we need to tweak our code a little. There is an additional --payload-key-column "Marker ID" switch.

We now have one more field under the Notion Tab.

Marker Data GUI_Preference_Database_Notion_Rename-Key-Column

When users add Notion URL

TOOL_PATH="/Applications/Marker Data.app/Contents/Resources/csv2notion_neo"
NOTION_TOKEN="REPLACE"
NOTION_URL="REPLACE"
UPLOAD_PAYLOAD="REPLACE"
UPLOAD_LOG="/Users/UserID/Library/Application Support/Marker Data/Logs/airlift_log.txt"

$TOOL_PATH --token $NOTION_TOKEN --url $NOTION_URL --image-column "Image Filename" --image-column-keep --mandatory-column "Marker ID" --icon-column "Icon Image" --payload-key-column "Marker ID" --max-threads 5 --merge --log $UPLOAD_LOG --verbose "$UPLOAD_PAYLOAD"

When users don't add URL

$TOOL_PATH --token $NOTION_TOKEN --image-column "Image Filename" --image-column-keep --mandatory-column "Marker ID" --icon-column "Icon Image" --payload-key-column "Marker ID" --max-threads 5 --log $UPLOAD_LOG --verbose "$UPLOAD_PAYLOAD"

When users use Rename Key Column.

$TOOL_PATH --token $NOTION_TOKEN --url $NOTION_URL --image-column "Image Filename" --image-column-keep --mandatory-column "Marker ID" --payload-key-column "Marker ID" --rename-notion-key-column "Marker ID" "VALUE" --max-threads 5 --merge --log $UPLOAD_LOG --verbose "$UPLOAD_PAYLOAD"

We now have an additional switch --rename-notion-key-column "Marker ID" "VALUE". We keep "Marker ID" as fixed within --rename-notion-key-column "Marker ID" "VALUE" switch. And we take the Value from the Rename Key Column field.

If the field is empty, we don't use this --rename-notion-key-column "Marker ID" "VALUE".

@milanvarady
Copy link
Contributor

I added the --rename-notion-key-column option to the notion credentials. I couldn't check if it works completely, as there seems to be a bug in CSV2Notion. I have already opened an issue.

@IAmVigneswaran
Copy link
Contributor Author

I couldn't check if it works completely, as there seems to be a bug in CSV2Notion. I have already opened an issue.

Let me investigate.

@IAmVigneswaran
Copy link
Contributor Author

IAmVigneswaran commented Jan 4, 2024

I couldn't check if it works completely, as there seems to be a bug in CSV2Notion. I have already opened an issue.

Let me investigate.

As discussed, the error was thrown due to usage of different Notion Database. We will try to improve the error handling in the next build of CSV2Notion Neo.

Rename Key Column works!

@IAmVigneswaran
Copy link
Contributor Author

@milanvarady

Use this latest build 1.1.2 build. We have improved the error handling.

https://github.com/TheAcharya/csv2notion-neo/releases/tag/v1.1.2

@IAmVigneswaran
Copy link
Contributor Author

@milanvarady We have some significant changes to the codebase of CSV2Notion Neo in hindsight for future enhancement and maintenance of codebase. Due to that we now have a new required switch --workspace.

Hence, we meed to add a new field called Notion Workspace into our Notion Database Window. It is a mandatory field. You can follow the layout as such.

Notion Database - Workspace

Updated .sh Script.

#!/bin/sh

TOOL_PATH="/Applications/Marker Data.app/Contents/Resources/csv2notion_neo"
NOTION_WORKSPACE="REPLACE"
NOTION_TOKEN="REPLACE"
NOTION_URL="REPLACE"
UPLOAD_PAYLOAD="REPLACE"
UPLOAD_LOG="/Users/UserID/Library/Application Support/Marker Data/Logs/airlift_log.txt"

$TOOL_PATH --workspace "$NOTION_WORKSPACE" --token $NOTION_TOKEN --url $NOTION_URL --image-column "Image Filename" --image-column-keep --mandatory-column "Marker ID" --icon-column "Icon Image" --payload-key-column "Marker ID" --max-threads 5 --merge --log $UPLOAD_LOG --verbose "$UPLOAD_PAYLOAD"

To know your workspace name -

https://www.notion.so/help/workspace-settings#

If you workspace name is Acme Inc., it would be NOTION_WORKSPACE="Acme Inc."

Thank you.

@milanvarady
Copy link
Contributor

I added the workspace field and update CSV2Notion to v1.2.1

@IAmVigneswaran
Copy link
Contributor Author

@milanvarady

I added the workspace field and update CSV2Notion to v1.2.1

Thanks Milan! You can include the entitlements.plist file into the Resources. Just for reference.

@IAmVigneswaran
Copy link
Contributor Author

IAmVigneswaran commented Feb 2, 2024

@milanvarady We need to add one key aspect to our Notion module.

It is called "Merge Only". It allows users to update their existing database with new values and images.

These are following Column to be listed.
These are case-sensitive and needs to be matched exactly with our JSON column headers.

Marker ID
Marker Name
Marker Type
Checked
Status
Notes
Marker Position
Clip Type
Clip Name
Clip Duration
Video Role & Subrole
Audio Role & Subrole
Event Name
Project Name
Library Name
Icon Image
Image Filename

When users selects them, it would be: --merge-only-column "Marker ID".

When user selects one or more, it would be added consecutively like:
--merge-only-column "Marker ID" --merge-only-column "Marker Name" --merge-only-column "Checked"

When nothing is selected, the arguments would not be used.

There are 3 possible ways to implement this.

Checkbox method -

Merge-Only-checkbox-method

With Checkbox method, users would check and uncheck the columns that they Only want to merge. There can be Trash button to clear all the selection.

Tag Method -

Merge-Only-tag-method

With Tag method, users simply type the first few letters to auto complete the column name. If user wants to remove it, they can select the tag and press Delete or Backspace key. There also can be Trash button to clear all the selection.

https://github.com/issetwo/tagform

Selection Method -

Merge-Only-selection-method

With Selection method, users click to select and again click to un-select. Users can hold on to COMMAND key to select multiple columns. There also can be Trash button to clear all the selection.

@milanvarady
Copy link
Contributor

@IAmVigneswaran I added the merge-only columns option. I went with the checkbox method because that was the simplest to implement.

CleanShot 2024-02-07 at 22 50 08

Also, I updated the CSV2Notion binary to v1.2.3.

@IAmVigneswaran
Copy link
Contributor Author

@milanvarady Thanks for adding merge-only columns options!

After testing, I realised that there is bug with CSV2Notion Neo binary when merging JSON file. It creates new entries as opposed to only updating any selected column. TheAcharya/csv2notion-neo#27

Will report back as soon we have updated and Fixed CSV2Notion Neo.

Can the Clear button not be placed on top (floating) of the Merge Only UI?

Some UI Tweaks -

  1. Can we add the same spacing between the divider and the Merge Only Text.
  2. Maybe we can move Clear button to side of Cancel?
Notion-Panel

Thank you!

@milanvarady
Copy link
Contributor

Maybe we can move Clear button to side of Cancel?

It wouldn't be obvious that the clear button belongs to the merge-only option. It would suggest that it clears the whole form.

@IAmVigneswaran
Copy link
Contributor Author

Maybe we can move Clear button to side of Cancel?

It wouldn't be obvious that the clear button belongs to the merge-only option. It would suggest that it clears the whole form.

Or could we remove the Clear button and use a Shift + COMMAND + D and use this key combo?

@milanvarady
Copy link
Contributor

How would users know that the shortcut exists without a button? I can only assign shortcuts to an existing UI element. I think we keep it how it is or remove it completely.

@IAmVigneswaran
Copy link
Contributor Author

How would users know that the shortcut exists without a button?

Via our help documentation?

I can only assign shortcuts to an existing UI element. I think we keep it how it is or remove it completely.

Not sure if this is possible. Are we able to "hide" the clear button. Making it invisible. But it is still here.

https://forums.developer.apple.com/forums/thread/678323

We can remove it, if we can't add the shortcut.

@milanvarady
Copy link
Contributor

I added an invisible button with the shortcut ⌘+⇧+D.

@IAmVigneswaran
Copy link
Contributor Author

I added an invisible button with the shortcut ⌘+⇧+D.

https://markerdata.theacharya.co/user-guide/keyboard-shortcuts/#databases

@IAmVigneswaran
Copy link
Contributor Author

@milanvarady We have update CSV2Notion Neo to 1.2.4. You can update the binary.

https://github.com/TheAcharya/csv2notion-neo/releases/tag/v1.2.4

Could you add --verbose switch as well. We have added the feature to print debug trace information into the log file when error occurs.

@milanvarady
Copy link
Contributor

Could you add --verbose switch as well. We have added the feature to print debug trace information into the log file when error occurs.

Added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
csv2notion-neo CSV2Notion Neo Related enhancement New Feature Or Request
Projects
None yet
Development

No branches or pull requests

2 participants