pleisto / mashcard Goto Github PK
View Code? Open in Web Editor NEWAn open-source web-based OS and no-code PaaS to boost productivity.
Home Page: https://www.producthunt.com/upcoming/brickdoc
License: Apache License 2.0
An open-source web-based OS and no-code PaaS to boost productivity.
Home Page: https://www.producthunt.com/upcoming/brickdoc
License: Apache License 2.0
Move username
to arguments
Todo list:
blockCreate
, BlockPinOrUnpin
, BlockCommit
#425GroupUpdateMember
, PodMembers
#431CreateDirectUpload
#441BlockSyncBatch
BlockPins
ChildrenBlocks
DocumentInfo
user.rb
: fetch_current_pod_cache
, current_pod_id
, current_pod_cache
, guess_pod
current_pod.rb
CurrentPod
moduleTodo block UI:
https://www.figma.com/file/pKCVegQsV7NqwMfhapeWmR/?node-id=6352%3A102575
We currently use an angular-style Folder-by-Feature
structure for PWA, but there is a lack of consistent convention for the boundaries and granularity of features. So there is a lot of room for improvement.
Trash hovered status:
https://www.figma.com/file/RyaabEPkCD9l72OwwcNeSl/Web-UI---C-Page?node-id=7325%3A201874
——————
Display error after uploading a image Avatar.
——————
https://www.loom.com/share/db224a02041b444d85ff549bd6db842d
As shown in the video, it flashes when selected text gap.
repo
Code block UI:
https://www.figma.com/file/pKCVegQsV7NqwMfhapeWmR/?node-id=6104%3A105349
We use a compound document structure that supports the inclusion of sub-pages within any page block, so there is no need real concept of folders. However, based on the user's mental model, we may want to making sub-page blocks look more like folders when they are presented on the parent page.
The source
field is used to distinguish whether a file comes from uploading or an external link. Because we need to do some tricks on getting the uploaded file's URL. It is no need to do that now, we can get the uploaded file's URL directly and remove this field on every file-related attributes object.
For Example:
https://github.com/mashcard/mashcard/blob/main/packages/brickdoc-editor/src/extensions/blocks/embed/meta.ts#L77
https://github.com/mashcard/mashcard/blob/main/apps/client-web/src/BrickdocGraphQL.ts#L156
export type BlockAttachment = {
...
/** source */
source?: Maybe<FileSource>
...
}
repo step
repo video: https://www.loom.com/share/dc01f3d13022466a888c2b2332b7ae2a
As shown above, the embed icon is incorrect.
https://www.figma.com/file/pKCVegQsV7NqwMfhapeWmR/Web-UI---G-Embed?node-id=6719%3A127638
Tracking issue for:
Link block UI:
https://www.figma.com/file/pKCVegQsV7NqwMfhapeWmR/?node-id=5477%3A283087
repo step:
As shown above, the collaborator avatars are too close to the buttons.
https://www.figma.com/file/RyaabEPkCD9l72OwwcNeSl/?node-id=6596%3A114356
Currently, when we create a new h1 block, there is no text displayed.
We should provide a 'Heading 1' placeholder text here.
A list of all placeholder designs:
Since we already introduced the great state management library zustand, we should no longer use apollo's makeVar
for local state management.
prepare for search feature
the extension option name is more like a function but not a hook now. We should correct it like this:
createConversation
-> onCreateConversation
tl;dr:
formula for automatic text summarization;Our application consists mainly of PWA and Monolith Server. Since http-only cookies are the only truly secure way to store user authentication credentials in the browser, we currently use a monolith server mounting PWA entrypoint and use cookies to authenticate GraphQL API requests.
As we may package PWA as a desktop app in the future, we need to refactor it to separating the concerns of PWA and Monolith Server.
globalThis.brickdocContext
to access metadata;Internal Note: Our private monorepo has a PoC implementation of this refactor, which is available here.
We could use inertia.js to build fullstack features with React.js. And use doorkeeper-oidc to implement API authentication logic.
user authentication related features such as sign up, forgot password are implemented in the monolith server by inertia.js. PWA will be focused on the user facing features, and use PKCE flow to authenticate API requests. (The token needs to be stored in memory only, and remember-me will be transparently implemented in the monolith server via a cookie.)
https://www.figma.com/file/pKCVegQsV7NqwMfhapeWmR/Web-UI---G-Embed?node-id=5796%3A149221
There are also various UI inconsistencies with designs on Figma. Since we didn't create another issue to track these UI issues, so they should be fixed in PRs for this issue too.
Related: https://github.com/pleisto/corp/issues/820. We probably have to refactor link marks.
test
written by @xxx
It just a test to create issue by bot by @zhekai Ji
BubbleMenu extension exists in the BubbleMenu component currently. Move it out to make it configurable in an extension be-like way.
https://www.loom.com/share/cca1a001f5634cb7813874a423444cc5
As shown in the video, It's hard to select the secondary menu: if the mouse moves slowly, the secondary menu will disappear.
The accounts and pod models in this codebase are still legacy versions and need to be migrated to our new design ASAP to avoid schema changes in the future.
Pod
as a unique tenant modal, user and group is essentially a type of pod;invite_enabled
to BrickdocConfig
model;Accounts::Member
to Groups::Member
to ensure correct semantics;Accounts::
prefix from all models;owner
attribute from Pod
model. Use Group::Member
instead to simplify;User
and Group
are the two types of pods, and they are inherited from Pod
model and share the same database table (STI).
The logic for authentication is implemented in the Users::Authentication
model, which is one-to-one relation with the User
model. And, features specific to group pods like inviting members are implemented in Group
model instead of Pod
model.
Internal Note: Our private monorepo has a PoC implementation of this refactor, which is available here.
create_enum "pod_type", ["User", "Group"]
create_table "pods", force: :cascade do |t|
# remove t.bigint "owner_id", null: false
t.string "username", null: false # domain --> username
t.string "display_name", null: false # name --> display_name
t.string "bio", limit: 140, comment: "\"Bio\" means Biography in social media."
# remove: t.boolean "personal", default: false, null: false
t.datetime "deleted_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
# remove: t.boolean "invite_enable", default: false, null: false
# remove: t.string "invite_secret"
t.index "lower((domain)::text)", name: "index_pods_on_lower_domain_text", unique: true
t.index ["deleted_at"], name: "index_pods_on_deleted_at"
# remove: invite_secret could store in redis.
# remove: t.index ["invite_secret"], name: "index_pods_on_invite_secret", unique: true
t.index ["owner_id"], name: "index_pods_on_owner_id"
# new fields
t.datetime "suspended_at", comment: "the date when the user was suspended"
t.integer "suspended_reason", default: 0, comment: "enumeration value for the reason for the user suspension"
t.string "external_avatar_url"
t.string "last_pod_username" # migrate from `accounts_users`
t.string "last_block_ids", default: "{}", null: false # migrate from `accounts_users`
end
create_table "users_authentications", force: :cascade do |t|
t.belongs_to "user", null: false, foreign_key: { to_table: "pods" }
t.string "email"
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.datetime "confirmation_sent_at"
t.string "unconfirmed_email"
t.integer "failed_attempts", default: 0, null: false
t.string "unlock_token"
t.datetime "locked_at"
t.datetime "deleted_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["confirmation_token"], unique: true
t.index ["deleted_at"]
t.index ["email"], unique: true
t.index ["reset_password_token"], unique: true
t.index ["unlock_token"], unique: true
end
It is important to note that although the above schema appears to rename accounts_users
to users_authentications
, they have completely different semantics. The Users::Authentication
model is only responsible for authentication, and the User
model inheriting from Pod
model being responsible for user information. Theoretically, once the user has logged in, the Users::Authentication
is no longer needed.
class Pod < ApplicationRecord
end
class User < Pod
has_one :authentication, class_name: "Users::Authentication"
has_one :pod, class_name: "Pod", foreign_key: "id"
has_many :group_members, class_name: "Groups::Member", dependent: :destroy
has_many :groups, through: :group_members
has_many :owned_groups,
# don't destroy the user if it is owner of a group
-> { where(role: :owner) }, through: :group_members, source: :group, dependent: :restrict_with_exception
end
class Group < Pod
has_many :members, class_name: "Group::Member"
has_many :members, class_name: 'Groups::Member', dependent: :destroy
has_many :users, through: :members
has_one :owner, -> { where(role: :owner) }, through: :members, source: :user
end
module Groups
class Member < ApplicationRecord
belongs_to :group, class_name: 'Group', inverse_of: :members
belongs_to :user, class_name: 'User', inverse_of: :group_members
ROLES = {
owner: 0,
member: 1,
}
enum role: ROLES
end
end
The hover status of this button should be:
https://www.figma.com/file/YcVOEbdec2oqyKrYFSkeYW/Components-Base?node-id=3673%3A11297
currently, the editor's i18n
depends on the client-web
app, it should be set up in the editor. And the editor should also have the ability to customize i18n
.
Expect explicit dependency to make the usage of the editor clear. Use of @brickdoc/schema
should be limited in the internal of the editor.
issues:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.