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

Create field through Table view #731

Merged
merged 11 commits into from
Nov 14, 2023

Conversation

Acylation
Copy link
Collaborator

@Acylation Acylation commented Nov 12, 2023

Updates #692, #709, #197

This PR allows creating new fields in Table view directly, via the Add field button at the end of columns, or Insert left/right button provided in the column drop-down (three-dots).

Important change on dataframe:

  • Introduced a new field type List, and encoded as multitext, stay in consistent with Obsidian (see undocumented obsidian-typings)
    • Currently multitext support is still inplemented by repeted text field

@Acylation Acylation mentioned this pull request Nov 12, 2023
1 task
[field.name]: field.typeConfig,
},
});
saveConfig({ ...config });
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Project level field configs, like rich-text or options, and view-level configs like column order and column width are stored separatedly. When updating project config, the view config would be overwritten.

project and config are both local variables. Updating project config by local project would ignore changed config. Updating view config by local config right after updating project config here would keep the view config unchanged.

await api.addField(field, value, position);

updateFieldCfg(field);
updateViewCfg(field, position);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updateFieldCfg would update project-level field config, while updateViewCfg will overwrite the stale config in project with a newer config. Same reason mentioned in onColumnConfigure

@Acylation Acylation merged commit 7c1cfa0 into marcusolsson:main Nov 14, 2023
1 check passed
@Acylation Acylation added the kind/feature New feature request label Nov 14, 2023
@Acylation Acylation added this to the next milestone Nov 14, 2023
@marcusolsson
Copy link
Owner

This has been sorely lacking. Thanks for taking the time to implement it!

@Acylation Acylation deleted the batch-create-field branch March 16, 2024 05:15
@LynetteCullens
Copy link

LynetteCullens commented Aug 5, 2024

How do I turn it off?

@Acylation
Copy link
Collaborator Author

Acylation commented Aug 5, 2024

Do you mean you want a setting option to hide this feature? I’d like to know more on your case. And, if possible, could you kindly open up an issue requesting this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants