Skip to content

📚 The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

feat: new nodes management system, ui and teams (#541)

Smaug897f38812c85
diff --git a/backend/app/migrations/000018_node_invitations.down.sql b/backend/app/migrations/000018_node_invitations.down.sql
new file mode 100644
index 00000000..56ab7697
--- /dev/null
+++ b/backend/app/migrations/000018_node_invitations.down.sql
@@ -0,0 +1 @@
+DROP TABLE IF EXISTS `permissions_invitations`;
\ No newline at end of file
diff --git a/backend/app/migrations/000018_node_invitations.up.sql b/backend/app/migrations/000018_node_invitations.up.sql
new file mode 100644
index 00000000..fea145fa
--- /dev/null
+++ b/backend/app/migrations/000018_node_invitations.up.sql
@@ -0,0 +1,11 @@
+CREATE TABLE IF NOT EXISTS `permissions_invitations` (
+ `id` BIGINT UNSIGNED NOT NULL,
+ `invitation_code` VARCHAR(6) NOT NULL, -- 6 digit invitation code
+ `permission_level` TINYINT UNSIGNED NOT NULL, -- Permission level (1: read, 2: write, 3: admin)
+ `node_id` BIGINT UNSIGNED NOT NULL, -- Node ID associated with the invitation
+ `created_timestamp` BIGINT UNSIGNED NOT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `uk_invitation_code` (`invitation_code`),
+ KEY `idx_node_id` (`node_id`),
+ CONSTRAINT `fk_node` FOREIGN KEY (`node_id`) REFERENCES `nodes` (`id`) ON DELETE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
\ No newline at end of file
diff --git a/backend/controllers/nodes.permissions.controller.go b/backend/controllers/nodes.permissions.controller.go
index 194050f3..8bb55c45 100644
--- a/backend/controllers/nodes.permissions.controller.go
+++ b/backend/controllers/nodes.permissions.controller.go
@@ -11,9 +11,13 @@ import (
type PermissionsController interface {
GetNodePermissions(c *gin.Context) (int, any)
+ GetNodeInvitations(c *gin.Context) (int, any)
CreatePermission(c *gin.Context) (int, any)
+ CreateNodeInvitation(c *gin.Context) (int, any)
UpdatePermission(c *gin.Context) (int, any)
DeletePermission(c *gin.Context) (int, any)
+ DeleteNodeInvitation(c *gin.Context) (int, any)
+ JoinNodeInvitation(c *gin.Context) (int, any)
}
func NewPermissionsController(app *app.App) PermissionsController {
@@ -29,6 +33,7 @@ func NewPermissionsController(app *app.App) PermissionsController {
// @Router /permissions/node/{nodeId} [get]
func (ctr *Controller) GetNodePermissions(c *gin.Context) (int, any) {
nodeId, err := utils.GetTargetId(c, c.Param("nodeId"))
+ recursive := c.Query("recursive") == "true"
if err != nil {
return http.StatusBadRequest, err
}
@@ -36,13 +41,34 @@ func (ctr *Controller) GetNodePermissions(c *gin.Context) (int, any) {
return statusFromAccessError(err), err
}
- perms, err := ctr.app.Services.Permission.GetNodePermissions(c.Request.Context(), nodeId)
+ perms, err := ctr.app.Services.Permission.GetNodePermissions(c.Request.Context(), nodeId, recursive)
if err != nil {
return statusFromAccessError(err), err
}
return http.StatusOK, perms
}
+// GetNodeInvitations retrieves invitations for a specific node
+// @Method GET
+// @Description Retrieve invitations for a specific node.
+// @Param nodeId path string true "Node ID"
+// @Router /nodes/{nodeId}/invitations [get]
+func (ctr *Controller) GetNodeInvitations(c *gin.Context) (int, any) {
+ nodeId, err := utils.GetTargetId(c, c.Param("nodeId"))
+ if err != nil {
+ return http.StatusBadRequest, err
+ }
+ if _, err := actorFromRequest(c); err != nil {
+ return statusFromAccessError(err), err
+ }
+
+ invitations, err := ctr.app.Services.Permission.GetNodeInvitations(c.Request.Context(), nodeId)
+ if err != nil {
+ return statusFromAccessError(err), err
+ }
+ return http.StatusOK, invitations
+}
+
// CreatePermission creates a new permission for a node
// @Method POST
// @Description Create a new permission for a node.
@@ -68,6 +94,37 @@ func (ctr *Controller) CreatePermission(c *gin.Context) (int, any) {
return http.StatusOK, createdPerm
}
+// CreateNodeInvitation creates a new invitation for a node
+// @Method POST
+// @Description Create a new invitation for a node.
+// @Param nodeId path string true "Node ID"
+// @Router /nodes/{nodeId}/invitations [post]
+func (ctr *Controller) CreateNodeInvitation(c *gin.Context) (int, any) {
+ nodeId, err := utils.GetTargetId(c, c.Param("nodeId"))
+ if err != nil {
+ return http.StatusBadRequest, err
+ }
+
+ var request struct {
+ PermissionLevel int `json:"permission_level"`
+ }
+ if err := c.ShouldBindJSON(&request); err != nil {
+ return http.StatusBadRequest, err
+ }
+ if request.PermissionLevel < 1 || request.PermissionLevel > 3 {
+ return http.StatusBadRequest, "Permission level must be between 1 and 3"
+ }
+ if _, err := actorFromRequest(c); err != nil {
+ return statusFromAccessError(err), err
+ }
+
+ createdInvitation, err := ctr.app.Services.Permission.CreateNodeInvitation(c.Request.Context(), nodeId, request.PermissionLevel)
+ if err != nil {
+ return statusFromAccessError(err), err
+ }
+ return http.StatusOK, createdInvitation
+}
+
// UpdatePermission updates an existing permission for a node
// @Method PUT
// @Description Update an existing permission for a node.
@@ -114,3 +171,46 @@ func (ctr *Controller) DeletePermission(c *gin.Context) (int, any) {
}
return http.StatusOK, "Permission deleted"
}
+
+// DeleteNodeInvitation deletes an invitation by its ID
+// @Method DELETE
+// @Description Delete an invitation by its ID.
+// @Param invitationId path string true "Invitation ID"
+// @Router /nodes/{nodeId}/invitations/{invitationId} [delete]
+func (ctr *Controller) DeleteNodeInvitation(c *gin.Context) (int, any) {
+ invitationId, err := utils.GetTargetId(c, c.Param("invitationId"))
+ if err != nil {
+ return http.StatusBadRequest, err
+ }
+ if _, err := actorFromRequest(c); err != nil {
+ return statusFromAccessError(err), err
+ }
+
+ err = ctr.app.Services.Permission.DeleteNodeInvitation(c.Request.Context(), invitationId)
+ if err != nil {
+ return statusFromAccessError(err), err
+ }
+ return http.StatusOK, "Invitation deleted"
+}
+
+// JoinNodeInvitation joins a node using an invitation code or link
+// @Method POST
+// @Description Join a node using an invitation code or link.
+// @Router /nodes/invitations/join [post]
+func (ctr *Controller) JoinNodeInvitation(c *gin.Context) (int, any) {
+ var request struct {
+ Code string `json:"code"`
+ }
+ if err := c.ShouldBindJSON(&request); err != nil {
+ return http.StatusBadRequest, err
+ }
+ if _, err := actorFromRequest(c); err != nil {
+ return statusFromAccessError(err), err
+ }
+
+ perm, node, err := ctr.app.Services.Permission.JoinNodeInvitation(c.Request.Context(), request.Code)
+ if err != nil {
+ return statusFromAccessError(err), err
+ }
+ return http.StatusOK, gin.H{"permission": perm, "node": node}
+}
diff --git a/backend/models/node_invitation.model.go b/backend/models/node_invitation.model.go
new file mode 100644
index 00000000..e089f6a2
--- /dev/null
+++ b/backend/models/node_invitation.model.go
@@ -0,0 +1,11 @@
+package models
+
+import "alexandrie/types"
+
+type NodeInvitation struct {
+ Id types.Snowflake `json:"id" db:"id"`
+ InvitationCode string `json:"invitation_code" db:"invitation_code"`
+ PermissionLevel int `json:"permission_level" db:"permission_level"`
+ NodeId types.Snowflake `json:"node_id" db:"node_id"`
+ CreatedTimestamp int64 `json:"created_timestamp" db:"created_timestamp"`
+}
diff --git a/backend/permissions/constants.go b/backend/permissions/constants.go
index 2c701010..d851238c 100644
--- a/backend/permissions/constants.go
+++ b/backend/permissions/constants.go
@@ -41,7 +41,7 @@ func (a NodeAction) RequiredLevel() NodePermissionLevel {
case ActionDelete, ActionShare:
return PermAdmin
case ActionManagePermissions:
- return PermOwner
+ return PermAdmin
default:
return PermOwner
}
diff --git a/backend/repositories/manager.go b/backend/repositories/manager.go
index f75435e1..81791c87 100644
--- a/backend/repositories/manager.go
+++ b/backend/repositories/manager.go
@@ -7,16 +7,17 @@ import (
)
type RepositoryManager struct {
- db *sqlx.DB
- User UserRepository
- Node NodeRepository
- Stats StatsRepository
- Session SessionRepository
- Permission PermissionRepository
- Log LogRepository
- OIDCProvider OIDCProviderRepository
- UserSettings UserSettingsRepository
- initialized bool
+ db *sqlx.DB
+ User UserRepository
+ Node NodeRepository
+ NodeInvitation NodeInvitationRepository
+ Stats StatsRepository
+ Session SessionRepository
+ Permission PermissionRepository
+ Log LogRepository
+ OIDCProvider OIDCProviderRepository
+ UserSettings UserSettingsRepository
+ initialized bool
}
func NewRepositoryManager(db *sqlx.DB) (*RepositoryManager, error) {
@@ -34,6 +35,7 @@ func (rm *RepositoryManager) initializeRepositories() {
rm.User = NewUserRepository(rm.db)
rm.Session = NewSessionRepository(rm.db)
rm.Node = NewNodeRepository(rm.db)
+ rm.NodeInvitation = NewNodeInvitationRepository(rm.db)
rm.Stats = NewStatsRepository(rm.db)
rm.Permission = NewPermissionRepository(rm.db)
rm.Log = NewLogRepository(rm.db)
diff --git a/backend/repositories/node_invitation.repository.go b/backend/repositories/node_invitation.repository.go
new file mode 100644
index 00000000..c4ed7638
--- /dev/null
+++ b/backend/repositories/node_invitation.repository.go
@@ -0,0 +1,87 @@
+package repositories
+
+import (
+ "alexandrie/models"
+ "alexandrie/types"
+ "database/sql"
+ "fmt"
+
+ "github.com/jmoiron/sqlx"
+)
+
+type NodeInvitationRepositoryImpl struct {
+ db *sqlx.DB
+}
+
+type NodeInvitationRepository interface {
+ GetByID(id types.Snowflake) (*models.NodeInvitation, error)
+ GetByNode(nodeId types.Snowflake) ([]*models.NodeInvitation, error)
+ GetByCode(code string) (*models.NodeInvitation, error)
+ Create(invitation *models.NodeInvitation) (*models.NodeInvitation, error)
+ Delete(id types.Snowflake) error
+}
+
+func NewNodeInvitationRepository(db *sqlx.DB) NodeInvitationRepository {
+ return &NodeInvitationRepositoryImpl{db: db}
+}
+
+func (r *NodeInvitationRepositoryImpl) GetByID(id types.Snowflake) (*models.NodeInvitation, error) {
+ var invitation models.NodeInvitation
+ err := r.db.Get(&invitation, `
+ SELECT id, invitation_code, permission_level, node_id, created_timestamp
+ FROM permissions_invitations
+ WHERE id = ?`, id)
+ if err == sql.ErrNoRows {
+ return nil, nil
+ }
+ if err != nil {
+ return nil, fmt.Errorf("failed to get invitation: %w", err)
+ }
+ return &invitation, nil
+}
+
+func (r *NodeInvitationRepositoryImpl) GetByNode(nodeId types.Snowflake) ([]*models.NodeInvitation, error) {
+ var invitations []*models.NodeInvitation
+ err := r.db.Select(&invitations, `
+ SELECT id, invitation_code, permission_level, node_id, created_timestamp
+ FROM permissions_invitations
+ WHERE node_id = ?
+ ORDER BY created_timestamp DESC`, nodeId)
+ if err != nil {
+ return nil, fmt.Errorf("failed to query invitations: %w", err)
+ }
+ return invitations, nil
+}
+
+func (r *NodeInvitationRepositoryImpl) GetByCode(code string) (*models.NodeInvitation, error) {
+ var invitation models.NodeInvitation
+ err := r.db.Get(&invitation, `
+ SELECT id, invitation_code, permission_level, node_id, created_timestamp
+ FROM permissions_invitations
+ WHERE invitation_code = ?`, code)
+ if err == sql.ErrNoRows {
+ return nil, nil
+ }
+ if err != nil {
+ return nil, fmt.Errorf("failed to get invitation by code: %w", err)
+ }
+ return &invitation, nil
+}
+
+func (r *NodeInvitationRepositoryImpl) Create(invitation *models.NodeInvitation) (*models.NodeInvitation, error) {
+ _, err := r.db.NamedExec(`
+ INSERT INTO permissions_invitations (id, invitation_code, permission_level, node_id, created_timestamp)
+ VALUES (:id, :invitation_code, :permission_level, :node_id, :created_timestamp)`, invitation)
+ if err != nil {
+ return nil, fmt.Errorf("failed to create invitation: %w", err)
+ }
+ return invitation, nil
+}
+
+func (r *NodeInvitationRepositoryImpl) Delete(id types.Snowflake) error {
+ _, err := r.db.Exec(`DELETE FROM permissions_invitations WHERE id = ?`, id)
+ if err != nil {
+ return fmt.Errorf("failed to delete invitation: %w", err)
+ }
+ return nil
+}
diff --git a/backend/repositories/permission.repository.go b/backend/repositories/permission.repository.go
index 4c1783d4..ec7d2618 100644
--- a/backend/repositories/permission.repository.go
+++ b/backend/repositories/permission.repository.go
@@ -16,6 +16,7 @@ type PermissionRepositoryImpl struct {
type PermissionRepository interface {
GetByID(permissionId types.Snowflake) (*models.Permission, error)
GetByNode(nodeId types.Snowflake) ([]*models.Permission, error)
+ GetByNodeRecursive(nodeId types.Snowflake) ([]*models.Permission, error)
GetByNodeAndUser(nodeId types.Snowflake, userId types.Snowflake) (*models.Permission, error)
HasPermission(userId, nodeId types.Snowflake, required int) (bool, int)
Create(permission *models.Permission) (*models.Permission, error)
@@ -51,12 +52,44 @@ func (r *PermissionRepositoryImpl) GetByNode(nodeId types.Snowflake) ([]*models.
return permissions, nil
}
+func (r *PermissionRepositoryImpl) GetByNodeRecursive(nodeId types.Snowflake) ([]*models.Permission, error) {
+ var permissions []*models.Permission
+
+ err := r.db.Select(&permissions, `
+ WITH RECURSIVE descendants AS (
+ -- 1. Start with the given node
+ SELECT id
+ FROM nodes
+ WHERE id = ?
+
+ UNION ALL
+
+ -- 2. Recursive part : we retrieve all children of the found nodes
+ SELECT n.id
+ FROM nodes n
+ INNER JOIN descendants d ON n.parent_id = d.id
+ )
+ SELECT p.id, p.node_id, p.user_id, p.permission, p.created_timestamp
+ FROM permissions p
+ INNER JOIN descendants des ON p.node_id = des.id
+ `, nodeId)
+
+ if err != nil {
+ return nil, fmt.Errorf("failed to query recursive permissions for node %v: %w", nodeId, err)
+ }
+
+ return permissions, nil
+}
+
func (r *PermissionRepositoryImpl) GetByNodeAndUser(nodeId types.Snowflake, userId types.Snowflake) (*models.Permission, error) {
var perm models.Permission
err := r.db.Get(&perm, `
SELECT id, node_id, user_id, permission, created_timestamp
FROM permissions
WHERE node_id = ? AND user_id = ?`, nodeId, userId)
+ if err == sql.ErrNoRows {
+ return nil, nil
+ }
if err != nil {
return nil, fmt.Errorf("failed to get permission: %w", err)
}
diff --git a/backend/router/routes/nodes.go b/backend/router/routes/nodes.go
index 400868fb..c8a38782 100644
--- a/backend/router/routes/nodes.go
+++ b/backend/router/routes/nodes.go
@@ -19,16 +19,20 @@ func Nodes(app *app.App, router *gin.RouterGroup) {
node.GET("/shared/:userId", middlewares.Auth(), utils.WP(nodeCtrl.GetSharedNodes))
node.GET("/:nodeId", middlewares.Auth(), utils.WP(nodeCtrl.GetNode))
node.GET("/:nodeId/permissions", middlewares.Auth(), utils.WP(permCtrl.GetNodePermissions))
+ node.GET("/:nodeId/invitations", middlewares.Auth(), utils.WP(permCtrl.GetNodeInvitations))
node.GET("/user/:userId", middlewares.Auth(), utils.WP(nodeCtrl.GetNodes))
node.POST("", middlewares.Auth(), utils.WP(nodeCtrl.CreateNode))
node.POST("/:nodeId/permissions", middlewares.Auth(), utils.WP(permCtrl.CreatePermission))
+ node.POST("/:nodeId/invitations", middlewares.Auth(), utils.WP(permCtrl.CreateNodeInvitation))
+ node.POST("/invitations/join", middlewares.Auth(), utils.WP(permCtrl.JoinNodeInvitation))
node.PUT("/:nodeId", middlewares.Auth(), utils.WP(nodeCtrl.UpdateNode))
node.PATCH("/:nodeId/permissions/:permId", middlewares.Auth(), utils.WP(permCtrl.UpdatePermission))
node.DELETE("/:nodeId/permissions/:permId", middlewares.Auth(), utils.WP(permCtrl.DeletePermission))
+ node.DELETE("/:nodeId/invitations/:invitationId", middlewares.Auth(), utils.WP(permCtrl.DeleteNodeInvitation))
node.DELETE("/:nodeId", middlewares.Auth(), utils.WP(nodeCtrl.DeleteNode))
}
diff --git a/backend/services/manager.go b/backend/services/manager.go
index 25a9ffa1..ca010969 100644
--- a/backend/services/manager.go
+++ b/backend/services/manager.go
@@ -45,7 +45,7 @@ func (sm *ServiceManager) initializeServices(repos *repositories.RepositoryManag
sm.Stats = NewStatsService(repos.Stats)
sm.Minio = NewMinioService(minioClient)
sm.Node = NewNodeService(repos.Node, repos.Permission, sm.Minio, snowflake, sm.Access)
- sm.Permission = NewPermissionService(repos.Permission, repos.Node, snowflake, sm.Access)
+ sm.Permission = NewPermissionService(repos.Permission, repos.Node, repos.NodeInvitation, snowflake, sm.Access)
sm.Session = NewSessionService(repos.Session)
sm.Resource = NewResourceService(repos.Node, snowflake, minioClient, resourceConfig, sm.Access)
sm.Backup = NewBackupService(repos.Node, repos.UserSettings)
diff --git a/backend/services/permission.service.go b/backend/services/permission.service.go
index 9cf78d11..f2779d7c 100644
--- a/backend/services/permission.service.go
+++ b/backend/services/permission.service.go
@@ -7,35 +7,46 @@ import (
"alexandrie/repositories"
"alexandrie/types"
"context"
+ "crypto/rand"
+ "fmt"
+ "math/big"
+ "net/url"
+ "strings"
"time"
)
type PermissionService interface {
- GetNodePermissions(ctx context.Context, nodeId types.Snowflake) ([]*models.Permission, error)
+ GetNodePermissions(ctx context.Context, nodeId types.Snowflake, recursive bool) ([]*models.Permission, error)
+ GetNodeInvitations(ctx context.Context, nodeId types.Snowflake) ([]*models.NodeInvitation, error)
GetPermission(id types.Snowflake) (*models.Permission, error)
HasPermission(userId, nodeId types.Snowflake, required int) (bool, int)
CreatePermission(ctx context.Context, nodeId, userId types.Snowflake, permission int) (*models.Permission, error)
UpdatePermission(ctx context.Context, id types.Snowflake, permission int) error
DeletePermission(ctx context.Context, id types.Snowflake) error
+ CreateNodeInvitation(ctx context.Context, nodeId types.Snowflake, permissionLevel int) (*models.NodeInvitation, error)
+ DeleteNodeInvitation(ctx context.Context, id types.Snowflake) error
+ JoinNodeInvitation(ctx context.Context, input string) (*models.Permission, *models.Node, error)
}
type permissionService struct {
- permRepo repositories.PermissionRepository
- nodeRepo repositories.NodeRepository
- snowflake *snowflake.Snowflake
- access permissions.AccessGuard
+ permRepo repositories.PermissionRepository
+ nodeRepo repositories.NodeRepository
+ invitationRepo repositories.NodeInvitationRepository
+ snowflake *snowflake.Snowflake
+ access permissions.AccessGuard
}
-func NewPermissionService(permRepo repositories.PermissionRepository, nodeRepo repositories.NodeRepository, snowflake *snowflake.Snowflake, access permissions.AccessGuard) PermissionService {
+func NewPermissionService(permRepo repositories.PermissionRepository, nodeRepo repositories.NodeRepository, invitationRepo repositories.NodeInvitationRepository, snowflake *snowflake.Snowflake, access permissions.AccessGuard) PermissionService {
return &permissionService{
- permRepo: permRepo,
- nodeRepo: nodeRepo,
- snowflake: snowflake,
- access: access,
+ permRepo: permRepo,
+ nodeRepo: nodeRepo,
+ invitationRepo: invitationRepo,
+ snowflake: snowflake,
+ access: access,
}
}
-func (s *permissionService) GetNodePermissions(ctx context.Context, nodeId types.Snowflake) ([]*models.Permission, error) {
+func (s *permissionService) GetNodePermissions(ctx context.Context, nodeId types.Snowflake, recursive bool) ([]*models.Permission, error) {
actor, err := actorFromContext(ctx)
if err != nil {
return nil, err
@@ -45,9 +56,25 @@ func (s *permissionService) GetNodePermissions(ctx context.Context, nodeId types
return nil, err
}
+ if recursive {
+ return s.permRepo.GetByNodeRecursive(nodeId)
+ }
return s.permRepo.GetByNode(nodeId)
}
+func (s *permissionService) GetNodeInvitations(ctx context.Context, nodeId types.Snowflake) ([]*models.NodeInvitation, error) {
+ actor, err := actorFromContext(ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ if _, err = s.access.RequireNodeAction(actor, nodeId, permissions.ActionManagePermissions); err != nil {
+ return nil, err
+ }
+
+ return s.invitationRepo.GetByNode(nodeId)
+}
+
func (s *permissionService) GetPermission(id types.Snowflake) (*models.Permission, error) {
return s.permRepo.GetByID(id)
}
@@ -80,6 +107,170 @@ func (s *permissionService) CreatePermission(ctx context.Context, nodeId, userId
return perm, nil
}
+func (s *permissionService) CreateNodeInvitation(ctx context.Context, nodeId types.Snowflake, permissionLevel int) (*models.NodeInvitation, error) {
+ actor, err := actorFromContext(ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ if permissionLevel < int(permissions.PermRead) || permissionLevel > int(permissions.PermAdmin) {
+ return nil, fmt.Errorf("invalid invitation permission level")
+ }
+
+ if _, err = s.access.RequireNodeAction(actor, nodeId, permissions.ActionManagePermissions); err != nil {
+ return nil, err
+ }
+
+ for attempt := 0; attempt < 10; attempt++ {
+ invitation := &models.NodeInvitation{
+ Id: s.snowflake.Generate(),
+ InvitationCode: generateInvitationCode(6),
+ PermissionLevel: permissionLevel,
+ NodeId: nodeId,
+ CreatedTimestamp: time.Now().UnixMilli(),
+ }
+
+ created, err := s.invitationRepo.Create(invitation)
+ if err == nil {
+ return created, nil
+ }
+
+ if !isDuplicateInvitationError(err) {
+ return nil, err
+ }
+ }
+
+ return nil, fmt.Errorf("failed to generate unique invitation code")
+}
+
+func (s *permissionService) DeleteNodeInvitation(ctx context.Context, id types.Snowflake) error {
+ actor, err := actorFromContext(ctx)
+ if err != nil {
+ return err
+ }
+
+ invitation, err := s.invitationRepo.GetByID(id)
+ if err != nil {
+ return err
+ }
+ if invitation == nil {
+ return permissions.ErrNotFound
+ }
+
+ if _, err = s.access.RequireNodeAction(actor, invitation.NodeId, permissions.ActionManagePermissions); err != nil {
+ return err
+ }
+
+ return s.invitationRepo.Delete(id)
+}
+
+func (s *permissionService) JoinNodeInvitation(ctx context.Context, input string) (*models.Permission, *models.Node, error) {
+ actor, err := actorFromContext(ctx)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ code, err := parseInvitationCode(input)
+ if err != nil {
+ return nil, nil, permissions.ErrNotFound
+ }
+
+ invitation, err := s.invitationRepo.GetByCode(code)
+ if err != nil {
+ return nil, nil, err
+ }
+ if invitation == nil {
+ return nil, nil, permissions.ErrNotFound
+ }
+
+ node, err := s.nodeRepo.GetByID(invitation.NodeId)
+ if err != nil {
+ return nil, nil, err
+ }
+ if node == nil {
+ return nil, nil, permissions.ErrNotFound
+ }
+
+ existingPerm, err := s.permRepo.GetByNodeAndUser(invitation.NodeId, actor.UserID)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ if existingPerm != nil {
+ if existingPerm.Permission >= invitation.PermissionLevel {
+ return existingPerm, node, nil
+ }
+
+ existingPerm.Permission = invitation.PermissionLevel
+ if err := s.permRepo.Update(existingPerm); err != nil {
+ return nil, nil, err
+ }
+ return existingPerm, node, nil
+ }
+
+ perm := &models.Permission{
+ Id: s.snowflake.Generate(),
+ NodeId: invitation.NodeId,
+ UserId: actor.UserID,
+ Permission: invitation.PermissionLevel,
+ CreatedTimestamp: time.Now().UnixMilli(),
+ }
+ if _, err := s.permRepo.Create(perm); err != nil {
+ return nil, nil, err
+ }
+
+ return perm, node, nil
+}
+
+func generateInvitationCode(length int) string {
+ const alphabet = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789"
+ result := make([]byte, length)
+ for index := range result {
+ n, _ := rand.Int(rand.Reader, big.NewInt(int64(len(alphabet))))
+ result[index] = alphabet[n.Int64()]
+ }
+ return string(result)
+}
+
+func parseInvitationCode(input string) (string, error) {
+ trimmed := strings.TrimSpace(input)
+ if trimmed == "" {
+ return "", fmt.Errorf("empty invitation code")
+ }
+
+ if parsedURL, err := url.Parse(trimmed); err == nil && parsedURL.Scheme != "" {
+ if code := parsedURL.Query().Get("code"); code != "" {
+ trimmed = code
+ } else {
+ segments := strings.Split(strings.Trim(parsedURL.Path, "/"), "/")
+ if len(segments) > 0 {
+ trimmed = segments[len(segments)-1]
+ }
+ }
+ }
+
+ trimmed = strings.ToUpper(strings.TrimSpace(trimmed))
+ if len(trimmed) != 6 {
+ return "", fmt.Errorf("invalid invitation code length")
+ }
+
+ for _, char := range trimmed {
+ if !strings.ContainsRune("ABCDEFGHJKLMNPQRSTUVWXYZ23456789", char) {
+ return "", fmt.Errorf("invalid invitation code format")
+ }
+ }
+
+ return trimmed, nil
+}
+
+func isDuplicateInvitationError(err error) bool {
+ if err == nil {
+ return false
+ }
+ message := strings.ToLower(err.Error())
+ return strings.Contains(message, "duplicate") || strings.Contains(message, "unique")
+}
+
func (s *permissionService) UpdatePermission(ctx context.Context, id types.Snowflake, permission int) error {
actor, err := actorFromContext(ctx)
if err != nil {
diff --git a/frontend/app/components/AppBtnIcon.vue b/frontend/app/components/AppBtnIcon.vue
new file mode 100644
index 00000000..d3d2cbf8
--- /dev/null
+++ b/frontend/app/components/AppBtnIcon.vue
@@ -0,0 +1,79 @@
+<template>
+ <template v-if="nav && !isMobile">
+ <NuxtLink v-if="to || href" :to="to" :href="href" :target="blank ? '_blank' : undefined" v-bind="download ? { download: '' } : {}" @click="emit('click')">
+ <Icon :name="icon" display="lg" />
+ <p v-if="tooltip" class="hint-tooltip">{{ tooltip }}</p>
+ <slot />
+ </NuxtLink>
+ <button v-else v-bind="attrs" :class="{ fill }" @click="emit('click')">
+ <Icon :name="icon" display="lg" />
+ <p v-if="tooltip" class="hint-tooltip">{{ tooltip }}</p>
+ <slot />
+ </button>
+ </template>
+ <template v-else>
+ <NuxtLink v-if="to || href" :to="to" :href="href" :target="blank ? '_blank' : undefined" v-bind="download ? { download: '' } : {}" @click="emit('click')">
+ <Icon :name="icon" display="lg" />
+ <slot />
+ <span v-if="tooltip">{{ tooltip }}</span>
+ </NuxtLink>
+ <button v-else v-bind="attrs" :class="{ fill }" @click="emit('click')">
+ <Icon :name="icon" display="lg" />
+ <slot />
+ <span v-if="tooltip">{{ tooltip }}</span>
+ </button>
+ </template>
+</template>
+
+<script setup lang="ts">
+defineProps<{ icon: string; tooltip?: string; to?: string; blank?: boolean; href?: string; download?: boolean; nav?: boolean; fill?: boolean }>();
+const emit = defineEmits<{ (e: 'click'): void }>();
+
+const { isMobile } = useDevice();
+const attrs = useAttrs();
+</script>
+
+<style scoped lang="scss">
+button,
+a {
+ position: relative;
+ display: inline-flex;
+ margin: 0 1px;
+ padding: 4.5px;
+ border-radius: var(--radius-sm);
+ transition:
+ background-color $transition-fast ease-in-out,
+ border-color $transition-fast ease-in-out;
+ align-items: center;
+ border-bottom: 2px solid transparent;
+ gap: 7px;
+
+ &:hover {
+ background-color: var(--surface-raised);
+ }
+
+ &:hover {
+ background: var(--surface-transparent);
+ }
+}
+
+a:hover > .hint-tooltip {
+ opacity: 1;
+ visibility: visible;
+}
+
+button:hover > .hint-tooltip {
+ opacity: 1;
+ visibility: visible;
+}
+
+span {
+ font-size: 14px;
+ font-weight: 500;
+ white-space: nowrap;
+}
+
+.fill {
+ background-color: var(--surface-raised);
+}
+</style>
diff --git a/frontend/app/components/AppButton.vue b/frontend/app/components/AppButton.vue
index 41efd85a..f20b471f 100644
--- a/frontend/app/components/AppButton.vue
+++ b/frontend/app/components/AppButton.vue
@@ -1,11 +1,11 @@
<template>
- <button :class="[type, { large }]" @click="onClick">
+ <button :class="[type, { large, small }]" @click="onClick">
<slot />
</button>
</template>
<script setup lang="ts">
-defineProps<{ type: string; large?: boolean }>();
+defineProps<{ type: 'primary' | 'secondary' | 'success' | 'link' | 'danger'; large?: boolean; small?: boolean }>();
const emit = defineEmits(['click']);
const onClick = () => emit('click');
</script>
@@ -32,6 +32,11 @@ button {
font-size: 1rem;
}
+.small {
+ padding: 6px 10px;
+ font-size: 0.8rem;
+}
+
.primary {
color: white;
background: var(--primary);
diff --git a/frontend/app/components/AppPreferenceInputSection.vue b/frontend/app/components/AppPreferenceInputSection.vue
index 477a6d18..b0ca9b10 100644
--- a/frontend/app/components/AppPreferenceInputSection.vue
+++ b/frontend/app/components/AppPreferenceInputSection.vue
@@ -38,7 +38,20 @@
<div v-else-if="opt.type === 'groupCheckbox'" class="group-checkbox">
<div class="checkbox-grid">
<label v-for="[key, label] of Object.entries(opt.items)" :key="key">
- <AppCheck v-model="p(opt.key).value[key]" @change="opt.onChange?.(p(opt.key).value)">{{ label }}</AppCheck>
+ <AppCheck
+ :model-value="p(opt.key).value[key]"
+ @change="opt.onChange?.(p(opt.key).value)"
+ @update:model-value="
+ value => {
+ p(opt.key).value = {
+ ...p(opt.key).value,
+ [key]: value,
+ };
+ }
+ "
+ >
+ {{ label }}
+ </AppCheck>
</label>
</div>
</div>
diff --git a/frontend/app/components/CommandCenter/AdvancedSearchTab.vue b/frontend/app/components/CommandCenter/AdvancedSearchTab.vue
index f48d2331..76491a78 100644
--- a/frontend/app/components/CommandCenter/AdvancedSearchTab.vue
+++ b/frontend/app/components/CommandCenter/AdvancedSearchTab.vue
@@ -78,7 +78,7 @@ defineEmits<{ updateSelectedIndex: [index: number] }>();
const { t } = useI18nT();
const nodesStore = useNodesStore();
const nodesTree = useNodesTree();
-const categoriesTree = nodesTree.treeUpToRole(2);
+const categoriesTree = nodesTree.getTreeUpToRole(2);
// UI State
const showFilters = ref(true);
diff --git a/frontend/app/components/DataTable.vue b/frontend/app/components/DataTable.vue
index e31ca7a1..3e9987e4 100644
--- a/frontend/app/components/DataTable.vue
+++ b/frontend/app/components/DataTable.vue
@@ -13,7 +13,7 @@
<input type="checkbox" style="width: 20px" :checked="selectedRows.length > 0" @change="toggleSelectAll" />
</th>
<th v-for="header in headers" :key="header.key" :class="header.align && `align-${header.align}`">
- {{ header.label }}
+ <span>{{ header.label }}</span>
</th>
</tr>
</thead>
@@ -129,7 +129,7 @@ const shouldShowEllipsisBefore = computed(() => {
interface Header {
key: string;
label: string;
- align?: 'left' | 'center' | 'right';
+ align?: 'left' | 'center' | 'right' | 'space-around' | 'space-between';
}
export interface Field<V = unknown> {
[key: string]: {
@@ -161,7 +161,7 @@ header {
table {
display: table;
- width: 100%;
+ min-width: 100%;
margin: 0;
border-color: inherit;
border-radius: 0;
@@ -171,53 +171,48 @@ table {
th,
td {
- padding: 10px;
- text-align: left;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+ > span {
+ display: inline-flex;
+ width: 100%;
+ align-items: center;
+ }
+
+ &.align-right > span {
+ justify-content: flex-end;
+ }
+
+ &.align-center > span {
+ justify-content: center;
+ }
+
+ &.align-space-around > span {
+ justify-content: space-around;
+ }
+
+ &.align-space-between > span {
+ justify-content: space-between;
+ }
}
+/* --- ADAPTATIONS SPÉCIFIQUES --- */
th {
font-size: 13px;
color: var(--text-primary);
+ text-align: left;
background: var(--surface-transparent);
+ text-transform: uppercase;
&.align-right {
- text-align: right;
padding-right: 30px;
}
-
- &.align-center {
- text-align: center;
- }
-
- text-transform: uppercase;
}
td {
color: var(--text-secondary);
+ text-align: left; /* Reset */
&.align-right {
- text-align: right;
padding-right: 10px;
-
- > span {
- justify-content: flex-end;
- }
- }
-
- &.align-center {
- text-align: center;
-
- > span {
- justify-content: center;
- }
- }
-
- > span {
- display: flex;
- align-items: center;
}
&:has(footer) {
diff --git a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
index 5980a1f3..9d7231c3 100644
--- a/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
+++ b/frontend/app/components/MarkdownEditor/ImageSelectorModal.vue
@@ -9,7 +9,7 @@
<input v-model="searchQuery" :placeholder="t('markdown.image.searchPlaceholder')" />
</div>
<div class="images-grid">
- <div v-for="image in filteredImages.values()" :key="image.id" class="image-item" @click="selectImage(image)">
+ <div v-for="image in filteredImages" :key="image.id" class="image-item" @click="selectImage(image)">
<img :src="resolvePreviewUrl(image)" :alt="image.name" class="image-preview" @error="handleImageError" />
<div class="image-info">
<span class="image-name">{{ image.name }}</span>
@@ -18,7 +18,7 @@
</div>
</div>
- <div v-if="filteredImages.size === 0" class="no-images">
+ <div v-if="filteredImages.length === 0" class="no-images">
<p>{{ t('markdown.image.noImages') }}</p>
</div>
</div>
@@ -30,19 +30,26 @@ import EditorAppHeader from './EditorAppHeader.vue';
import { readableFileSize, isImageFile, resolvePreviewUrl } from '~/helpers/resources';
import type { Node } from '~/stores';
+const props = defineProps<{ onImageSelect: (imageUrl: string, altText: string) => void; nodeId?: string }>();
+const emit = defineEmits<{ (e: 'close'): void }>();
+
const { t } = useI18nT();
const resourcesStore = useResourcesStore();
const nodesStore = useNodesStore();
-const props = defineProps<{ onImageSelect: (imageUrl: string, altText: string) => void; nodeId?: string }>();
-const emit = defineEmits<{ (e: 'close'): void }>();
-
const searchQuery = ref('');
const isLoading = ref(false);
const uploadError = ref<string | null>(null);
const dropComponent = ref();
const { resourceURL } = useApi();
+const filteredImages = computed(() => {
+ if (!searchQuery.value.trim()) {
+ return nodesStore.resources.filter(img => isImageFile(img.metadata?.filetype as string));
+ }
+ return nodesStore.resources.filter(img => isImageFile(img.metadata?.filetype as string) && img.name.toLowerCase().includes(searchQuery.value.toLowerCase()));
+});
+
const submitFile = (selectedFile: File) => {
if (!selectedFile) return;
isLoading.value = true;
@@ -56,13 +63,6 @@ const submitFile = (selectedFile: File) => {
.finally(() => (isLoading.value = false));
};
-const filteredImages = computed(() => {
- if (!searchQuery.value.trim()) {
- return nodesStore.resources.filter(img => isImageFile(img.metadata?.filetype as string));
- }
- return nodesStore.resources.filter(img => isImageFile(img.metadata?.filetype as string) && img.name.toLowerCase().includes(searchQuery.value.toLowerCase()));
-});
-
const handleImageError = (event: Event) => {
const img = event.target as HTMLImageElement;
img.style.display = 'none';
diff --git a/frontend/app/components/MarkdownEditor/MarkdownEditor.vue b/frontend/app/components/MarkdownEditor/MarkdownEditor.vue
index d8c43479..ade44cd0 100644
--- a/frontend/app/components/MarkdownEditor/MarkdownEditor.vue
+++ b/frontend/app/components/MarkdownEditor/MarkdownEditor.vue
@@ -1,8 +1,11 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<div class="editor-wrapper">
+ <Teleport to="#navbar-title"> {{ t('components.editor.title') }}</Teleport>
+
<div class="editor-container">
<!-- Toolbar Section -->
+
<Toolbar v-model="document" @execute-action="handleToolbarAction" />
<!-- Compact Document Metadata -->
diff --git a/frontend/app/components/MarkdownEditor/Toolbar.vue b/frontend/app/components/MarkdownEditor/Toolbar.vue
index 05be3983..5a8fef56 100644
--- a/frontend/app/components/MarkdownEditor/Toolbar.vue
+++ b/frontend/app/components/MarkdownEditor/Toolbar.vue
@@ -1,6 +1,28 @@
<template>
<div class="toolbar">
<!-- Text Formatting Group -->
+ <Teleport to="#navbar-actions">
+ <div v-if="displayStats" class="stats-badge no-tablet">
+ <div class="stat-item">
+ <span class="stat-value">{{ stats.words }}</span>
+ <span class="stat-label">{{ t('markdown.stats.words') }}</span>
+ </div>
+ <div class="stat-divider" />
+ <div class="stat-item">
+ <span class="stat-value">{{ stats.characters }}</span>
+ <span class="stat-label">{{ t('markdown.stats.chars') }}</span>
+ </div>
+ <div class="stat-divider" />
+ <div class="stat-item">
+ <span class="stat-value">{{ stats.lines }}</span>
+ <span class="stat-label">{{ t('markdown.stats.lines') }}</span>
+ </div>
+ </div>
+ <AppBtnIcon nav icon="save" :tooltip="t('common.actions.save')" @click="emitAction('save')" />
+ <AppBtnIcon nav icon="file_shortcut" :tooltip="t('markdown.toolbar.goToDocument')" @click="emitAction('goto')" />
+ <AppBtnIcon nav icon="settings" :tooltip="t('markdown.toolbar.editorSettings')" @click="openSettings" />
+ <AppBtnIcon nav icon="help" :tooltip="t('markdown.toolbar.markdownSyntax')" @click="openHelp" />
+ </Teleport>
<div :class="['toolbar-group', { 'no-mobile': mobileSimplifiedView }]">
<div class="group-buttons">
<button v-for="item in formattingTools" :key="item.name" class="toolbar-btn" :aria-label="item.name" @click="emitAction(item.action)">
@@ -67,22 +89,6 @@
<!-- Right Section -->
<div class="toolbar-right">
<!-- Stats Badge -->
- <div v-if="displayStats" class="stats-badge no-tablet">
- <div class="stat-item">
- <span class="stat-value">{{ stats.words }}</span>
- <span class="stat-label">{{ t('markdown.stats.words') }}</span>
- </div>
- <div class="stat-divider" />
- <div class="stat-item">
- <span class="stat-value">{{ stats.characters }}</span>
- <span class="stat-label">{{ t('markdown.stats.chars') }}</span>
- </div>
- <div class="stat-divider" />
- <div class="stat-item">
- <span class="stat-value">{{ stats.lines }}</span>
- <span class="stat-label">{{ t('markdown.stats.lines') }}</span>
- </div>
- </div>
<!-- Actions & Settings Group -->
<div class="action-buttons">
@@ -103,15 +109,6 @@
>{{ item.name }}<kbd v-if="item.shortcut">{{ item.shortcut }}</kbd></span
>
</button>
- <div class="action-divider" />
- <button class="toolbar-btn btn-ghost" aria-label="Settings" @click="openSettings">
- <Icon name="settings" display="lg" />
- <span class="tooltip">{{ t('markdown.toolbar.editorSettings') }}</span>
- </button>
- <button class="toolbar-btn btn-ghost" aria-label="Help" @click="openHelp">
- <Icon name="help" display="lg" />
- <span class="tooltip">{{ t('markdown.toolbar.markdownSyntax') }}</span>
- </button>
</div>
</div>
</div>
@@ -168,7 +165,7 @@ const openHelp = () => modals.add(new Modal(shallowRef(ModalSyntax), { size: 'me
const openSettings = () => modals.add(new Modal(shallowRef(EditorPreferences), { size: 'small' }));
const nodesTree = useNodesTree();
-const categories = nodesTree.treeUpToRole(2);
+const categories = nodesTree.getTreeUpToRole(2);
// Tool type with optional shortcut
interface ToolItem {
@@ -212,11 +209,7 @@ const structureTools = computed<ToolItem[]>(() => [
{ name: t('markdown.toolbar.horizontalRule'), icon: 'format/horizontal-rule', action: 'horizontalRule', shortcut: 'Ctrl+Shift+R' },
]);
-const actionTools = computed<ToolItem[]>(() => [
- { name: t('markdown.toolbar.preview'), icon: 'preview', action: 'preview', shortcut: 'Ctrl+P' },
- { name: t('markdown.toolbar.save'), icon: 'save', action: 'save', shortcut: 'Ctrl+S' },
- { name: t('markdown.toolbar.goToDocument'), icon: 'file_shortcut', action: 'goto' },
-]);
+const actionTools = computed<ToolItem[]>(() => [{ name: t('markdown.toolbar.preview'), icon: 'preview', action: 'preview', shortcut: 'Ctrl+P' }]);
</script>
<style scoped lang="scss">
.toolbar {
@@ -428,30 +421,15 @@ const actionTools = computed<ToolItem[]>(() => [
background: var(--surface-base);
}
-// Responsive adjustments
@media (width <= 900px) {
.toolbar {
padding: 6px 8px;
gap: 4px;
}
- .group-label {
- display: none;
- }
-
.toolbar-btn {
width: 28px;
height: 28px;
-
- .btn-icon {
- width: 16px;
- height: 16px;
-
- :deep(svg) {
- width: 16px;
- height: 16px;
- }
- }
}
.stats-badge {
@@ -480,11 +458,4 @@ const actionTools = computed<ToolItem[]>(() => [
display: none;
}
}
-
-// Tablet hide
-.no-tablet {
- @media (width <= 1024px) {
- display: none;
- }
-}
</style>
diff --git a/frontend/app/components/ModalManager.vue b/frontend/app/components/ModalManager.vue
index 0b7fc135..bbc3ae38 100644
--- a/frontend/app/components/ModalManager.vue
+++ b/frontend/app/components/ModalManager.vue
@@ -60,7 +60,6 @@ onUnmounted(() => document.removeEventListener('keydown', handleKeydown));
background-color: var(--surface-base);
box-shadow: var(--shadow-sm);
backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
- backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
}
.modal-container:has(> .full) {
@@ -90,7 +89,7 @@ onUnmounted(() => document.removeEventListener('keydown', handleKeydown));
}
.modal-container:has(> .small) {
- max-width: 600px;
+ max-width: 700px;
}
.modal-overlay {
@@ -120,7 +119,6 @@ onUnmounted(() => document.removeEventListener('keydown', handleKeydown));
display: flex;
background-color: var(--overlay-backdrop);
backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
- backdrop-filter: var(--backdrop-blur) var(--backdrop-saturate);
inset: 0;
}
diff --git a/frontend/app/components/Navbar.vue b/frontend/app/components/Navbar.vue
index 608f3ce9..bcedced0 100644
--- a/frontend/app/components/Navbar.vue
+++ b/frontend/app/components/Navbar.vue
@@ -1,92 +1,211 @@
<template>
- <header class="navbar">
- <div class="navbar__navigation">
- <button v-if="!isOpened" class="open-sidebar" aria-label="open sidebar" @click="toggleSidebar">
- <svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24">
- <path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z" />
- </svg>
- </button>
-
- <Navigation v-if="navbarItems.breadcrumb" />
+ <header class="site-header">
+ <div class="navbar">
+ <!-- Left side: burger + title -->
+ <div class="navbar__left">
+ <AppBtnIcon v-if="!isOpened" icon="burger" class="open-sidebar" @click="toggleSidebar" />
+ <div id="navbar-title" class="navbar__title" />
+ </div>
+
+ <!-- Right side: actions + infos -->
+ <div class="navbar__right">
+ <div ref="desktopActionsZone" class="navbar__actions-wrapper" />
+
+ <button
+ v-if="navbarItems.search"
+ class="search-btn"
+ :class="{ 'search-btn--compact': isMobile }"
+ :title="t('components.navbar.commandCenter')"
+ aria-label="Command center"
+ @click="openCommandCenter"
+ >
+ <Icon name="search" display="lg" />
+ <span v-if="!isMobile" class="search-btn__text">
+ <i18n-t scope="global" keypath="components.navbar.searchHint">
+ <template #key><kbd>/</kbd></template>
+ </i18n-t>
+ </span>
+ </button>
+
+ <div id="navbar-infos" class="navbar__infos" />
+ <ThemeToggle v-if="navbarItems.theme" />
+
+ <div v-if="hasSubnav" class="subnav-toggle" :class="{ 'is-open': subnavOpen }">
+ <AppBtnIcon icon="nav_arrow" fill @click="subnavOpen = !subnavOpen" />
+ </div>
+ </div>
+ </div>
+
+ <!-- Bottom side -->
+ <div v-if="navbarItems.breadcrumbNav" class="breadcrumbs">
+ <BreadCrumbs />
+ </div>
+
+ <div class="subnav-wrapper" :class="{ 'subnav-wrapper--open': subnavOpen }" @vue:mounted="onSubnavMounted" @vue:updated="onSubnavMounted">
+ <div ref="mobileActionsZone" class="navbar__actions-wrapper" />
+ <hr v-if="hasBottomContent && isMobile && hasActionsContent" />
+ <div id="navbar-bottom" />
</div>
- <div class="navbar__search">
- <button v-if="navbarItems.search" class="search-btn" :title="t('components.navbar.commandCenter')" aria-label="Command center" @click="openCommandCenter">
- <Icon name="search" />
- <span class="search-text">
- <i18n-t scope="global" keypath="components.navbar.searchHint">
- <template #key>
- <kbd>/</kbd>
- </template>
- </i18n-t>
- </span>
- </button>
-
- <ThemeToggle v-if="navbarItems.theme" aria-label="toggle theme" />
+ <div style="display: none">
+ <div id="navbar-actions" ref="navbarActionsEl" class="navbar__actions" />
</div>
</header>
</template>
<script lang="ts" setup>
-import Navigation from '~/components/Navigation/Navigation.vue';
+import BreadCrumbs from '~/components/Navigation/BreadCrumbs.vue';
+const route = useRoute();
const { t } = useI18nT();
+const { isMobile } = useDevice();
const { isOpened, toggleSidebar } = useSidebar();
const preferences = usePreferencesStore();
const commandCenter = useCommandCenter();
const navbarItems = preferences.get('navbarItems');
const openCommandCenter = () => commandCenter.open();
+
+const subnavOpen = ref(false);
+const hasSubnav = ref(false);
+const hasActionsContent = ref(false);
+const hasBottomContent = ref(false);
+
+const desktopActionsZone = ref<HTMLElement | null>(null);
+const mobileActionsZone = ref<HTMLElement | null>(null);
+const navbarActionsEl = ref<HTMLElement | null>(null);
+
+let observer: MutationObserver | null = null;
+
+function checkSubnavContent() {
+ const bottomEl = document.getElementById('navbar-bottom');
+ hasBottomContent.value = !!(bottomEl && bottomEl.children.length > 0);
+
+ hasActionsContent.value = !!(navbarActionsEl.value && navbarActionsEl.value.children.length > 0);
+
+ hasSubnav.value = hasBottomContent.value || (isMobile.value && hasActionsContent.value);
+}
+
+function routeActionsElement() {
+ if (!navbarActionsEl.value) return;
+
+ if (isMobile.value) {
+ mobileActionsZone.value?.appendChild(navbarActionsEl.value);
+ } else {
+ desktopActionsZone.value?.appendChild(navbarActionsEl.value);
+ }
+}
+
+onMounted(() => {
+ routeActionsElement();
+ observer = new MutationObserver(checkSubnavContent);
+ nextTick(() => {
+ const bottomEl = document.getElementById('navbar-bottom');
+ if (bottomEl) {
+ observer?.observe(bottomEl, { childList: true, subtree: true });
+ }
+ if (navbarActionsEl.value) {
+ observer?.observe(navbarActionsEl.value, { childList: true, subtree: true });
+ }
+ checkSubnavContent();
+ });
+});
+
+watch(isMobile, () => routeActionsElement(), { flush: 'post' });
+
+function onSubnavMounted() {
+ const el = document.getElementById('navbar-bottom');
+ const hasBottomContent = !!(el && el.children.length > 0);
+ const hasActionsContent = !!(navbarActionsEl.value && navbarActionsEl.value.children.length > 0);
+ hasSubnav.value = hasBottomContent || (isMobile.value && hasActionsContent);
+}
+
+watch(
+ () => route.fullPath,
+ () => (subnavOpen.value = false),
+);
</script>
<style lang="scss" scoped>
+$navbar-height: 56px;
+$subnav-height: 44px;
+$bp-md: 768px;
+
+.site-header {
+ width: 98%;
+ margin: 0 auto;
+ border-bottom: 1px solid var(--border);
+}
+
.navbar {
- position: sticky;
display: flex;
- width: 100%;
- height: 50px;
- padding: 10px 0;
+ height: $navbar-height;
+ padding: 0 4px;
align-items: center;
- border-bottom: 1px solid var(--border);
+ gap: 8px;
justify-content: space-between;
+}
- &__navigation,
- &__search {
- display: flex;
- align-items: center;
- gap: 16px;
- }
+.navbar__left {
+ display: flex;
+ min-width: 0;
+ align-items: center;
+ flex: 1;
+ gap: 8px;
+}
- &__navigation {
- flex: 1;
- overflow-x: auto;
- }
+.navbar__title {
+ display: flex;
+ min-width: 0;
+ font-size: 17px;
+ font-weight: 600;
+ align-items: center;
+ gap: 10px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.navbar__right {
+ display: flex;
+ align-items: center;
+ flex-shrink: 0;
+ gap: 6px;
}
-svg {
- fill: var(--text-body);
+.navbar__actions {
+ display: flex;
+ align-items: center;
+ gap: 6px;
}
-button {
- margin: 0;
- padding: 0;
+.navbar__infos {
+ display: flex;
+ align-items: center;
+ gap: 6px;
}
.search-btn {
- display: flex;
- min-width: 200px;
- padding: 8px 12px;
+ display: inline-flex;
+ height: 36px;
+ margin: 0;
+ padding: 0 12px;
border: none;
border-radius: var(--radius-sm);
+ font-size: 14px;
+ font-weight: 500;
+ color: var(--text-secondary);
background: var(--border);
transition:
background-color $transition-base ease,
transform $transition-base ease;
align-items: center;
cursor: pointer;
- gap: 4px;
+ gap: 6px;
+ white-space: nowrap;
&:hover {
+ color: var(--text-primary);
background: var(--selection-color);
transform: translateY(-1px);
}
@@ -94,20 +213,79 @@ button {
&:active {
transform: translateY(0);
}
-}
-.search-text {
- font-size: 14px;
- font-weight: 500;
+ &--compact {
+ width: 36px;
+ padding: 0;
+ justify-content: center;
+
+ .search-btn__text {
+ display: none;
+ }
+ }
}
kbd {
- padding: 0 5px;
+ padding: 1px 5px;
border: 1px solid var(--text-secondary);
border-radius: var(--radius-xs);
font-family: monospace;
- font-size: 14px;
+ font-size: 12px;
font-weight: 600;
+ line-height: 1.4;
background: var(--border);
}
+
+.subnav-toggle {
+ display: none;
+
+ @media (max-width: #{$bp-md - 1px}) {
+ display: inline-flex;
+ }
+
+ transition: transform $transition-base ease;
+
+ &.is-open {
+ transform: rotate(180deg);
+ }
+}
+
+.breadcrumbs {
+ padding: 4px 4px 6px;
+ font-size: 13px;
+}
+
+.navbar__actions-wrapper {
+ display: flex;
+ align-items: center;
+}
+
+.subnav-wrapper {
+ display: flex;
+ -ms-overflow-style: none;
+ overflow-x: auto;
+ scrollbar-width: none;
+
+ @media (width <= 768px) {
+ display: block;
+ max-height: 0;
+ transition: max-height $transition-base ease;
+ overflow: hidden;
+
+ .navbar__actions {
+ width: 100%;
+ padding: 10px 16px;
+ flex-direction: column;
+ gap: 8px;
+
+ :deep(> *) {
+ width: 100%;
+ }
+ }
+
+ &--open {
+ max-height: 600px;
+ }
+ }
+}
</style>
diff --git a/frontend/app/components/NavbarRouter.vue b/frontend/app/components/NavbarRouter.vue
new file mode 100644
index 00000000..bb364ce1
--- /dev/null
+++ b/frontend/app/components/NavbarRouter.vue
@@ -0,0 +1,60 @@
+<template>
+ <template v-if="hasNavigation.navigation">
+ <button :disabled="!canGoBack" class="nav no-tablet" aria-label="Go back" type="button" @click="goBack">
+ <Icon name="left_arrow" display="lg" />
+ </button>
+ <button :disabled="!canGoForward" class="nav no-tablet" aria-label="Go forward" type="button" @click="goForward">
+ <Icon name="right_arrow" display="lg" />
+ </button>
+ </template>
+</template>
+
+<script lang="ts" setup>
+const preferences = usePreferencesStore();
+
+const router = useRouter();
+
+const hasNavigation = preferences.get('navbarItems');
+
+const canGoBack = ref(false);
+const canGoForward = ref(false);
+
+const goBack = () => router.go(-1);
+const goForward = () => router.go(1);
+
+function handleState(state: History['state']) {
+ if (!state) return;
+
+ canGoBack.value = state.back !== null;
+ canGoForward.value = state.forward !== null;
+}
+
+router.afterEach(() => handleState(window.history.state));
+</script>
+
+<style lang="scss" scoped>
+.nav {
+ display: inline-flex;
+ min-width: 27px;
+ min-height: 27px;
+ padding: 0;
+ border-radius: 50%;
+ transition:
+ background-color $transition-medium ease,
+ opacity $transition-medium ease;
+ align-items: center;
+ cursor: pointer;
+ justify-content: center;
+ overflow: hidden;
+
+ &:hover:not(:disabled) {
+ background-color: var(--selection-color);
+ opacity: 0.8;
+ }
+
+ &:disabled {
+ opacity: 0.4;
+ cursor: not-allowed;
+ }
+}
+</style>
diff --git a/frontend/app/components/Navigation/BreadCrumbs.vue b/frontend/app/components/Navigation/BreadCrumbs.vue
index 2720e685..a194af99 100644
--- a/frontend/app/components/Navigation/BreadCrumbs.vue
+++ b/frontend/app/components/Navigation/BreadCrumbs.vue
@@ -63,7 +63,6 @@ watchEffect(() => {
align-items: center;
list-style: none;
mask-image: linear-gradient(to right, transparent, black var(--_fade), black calc(100% - var(--_fade)), transparent);
- mask-image: linear-gradient(to right, transparent, black var(--_fade), black calc(100% - var(--_fade)), transparent);
-webkit-overflow-scrolling: touch;
overflow-x: auto;
padding-inline: 8px;
diff --git a/frontend/app/components/Navigation/Navigation.vue b/frontend/app/components/Navigation/Navigation.vue
deleted file mode 100644
index cca5d0dc..00000000
--- a/frontend/app/components/Navigation/Navigation.vue
+++ /dev/null
@@ -1,89 +0,0 @@
-<template>
- <nav class="navigation no-mobile" aria-label="Navigation">
- <template v-if="hasNavigation.navigation">
- <button :disabled="!canGoBack" class="navigation__item no-tablet" aria-label="Go back" type="button" @click="goBack">
- <svg class="navigation__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
- <path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z" />
- </svg>
- </button>
-
- <button :disabled="!canGoForward" class="navigation__item no-tablet" aria-label="Go forward" type="button" @click="goForward">
- <svg class="navigation__icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960">
- <path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z" />
- </svg>
- </button>
- </template>
-
- <BreadCrumbs />
- </nav>
-</template>
-
-<script setup lang="ts">
-import BreadCrumbs from '~/components/Navigation/BreadCrumbs.vue';
-
-const router = useRouter();
-const preferences = usePreferencesStore();
-
-const hasNavigation = preferences.get('navbarItems');
-
-const canGoBack = ref(false);
-const canGoForward = ref(false);
-
-const goBack = () => router.go(-1);
-const goForward = () => router.go(1);
-
-function handleState(state: History['state']) {
- if (!state) return;
-
- canGoBack.value = state.back !== null;
- canGoForward.value = state.forward !== null;
-}
-
-router.afterEach(() => handleState(window.history.state));
-</script>
-
-<style scoped lang="scss">
-.navigation {
- display: flex;
- padding: 3px;
- align-items: center;
- gap: 8px;
- -webkit-overflow-scrolling: touch;
- overflow-x: auto;
- scroll-behavior: smooth;
- white-space: nowrap;
-
- &__item {
- display: inline-flex;
- min-width: 27px;
- min-height: 27px;
- padding: 0;
- border-radius: 50%;
- cursor: pointer;
- overflow: hidden;
-
- &:hover:not(:disabled) {
- .navigation__icon {
- background-color: var(--selection-color);
- opacity: 0.8;
- }
- }
-
- &:disabled {
- .navigation__icon {
- opacity: 0.4;
- cursor: not-allowed;
- }
- }
- }
-
- &__icon {
- width: 27px;
- height: 27px;
- transition:
- background-color $transition-medium ease,
- opacity $transition-medium ease;
- fill: var(--text-body);
- }
-}
-</style>
diff --git a/frontend/app/components/Node/Card/NodeCard.vue b/frontend/app/components/Node/Card/NodeCard.vue
index af15c484..0e1a0ca4 100644
--- a/frontend/app/components/Node/Card/NodeCard.vue
+++ b/frontend/app/components/Node/Card/NodeCard.vue
@@ -2,7 +2,7 @@
<div class="document-card" @contextmenu.prevent="openContextMenu">
<div class="top">
<div class="header">
- <span style="display: flex">
+ <span style="display: flex; align-items: center; gap: 10px; overflow: hidden">
<Icon :name="category?.icon || 'files'" display="xl" :class="['category-icon', getAppAccent(node.color || category?.color, true)]" />
<NuxtLink :to="`/dashboard/docs/${node.id}`" class="document-title">{{ node.name }}</NuxtLink>
</span>
@@ -90,7 +90,6 @@ function openContextMenu(event: MouseEvent) {
.category-icon {
padding: 8px;
border-radius: var(--radius-md);
- margin-right: 10px;
}
.document-title {
@@ -99,6 +98,9 @@ function openContextMenu(event: MouseEvent) {
line-height: 1.3;
color: var(--text-primary);
transition: color 0.15s;
+ flex: 1;
+ overflow: hidden;
+ text-overflow: ellipsis;
&:hover {
color: var(--primary);
diff --git a/frontend/app/components/Node/Card/Workspace.vue b/frontend/app/components/Node/Card/Workspace.vue
index dd426def..4fbcb184 100644
--- a/frontend/app/components/Node/Card/Workspace.vue
+++ b/frontend/app/components/Node/Card/Workspace.vue
@@ -1,132 +1,255 @@
<template>
- <div class="wp-card" :class="getAppAccent(workspace.color as number, true)">
- <div class="header">
- <span class="title">
- <Icon :name="workspace.icon || 'workspace'" class="icon" />
- <h3 class="name">{{ workspace.name }}</h3>
- </span>
- <span class="count">{{ getWorkspaceDocCount(workspace.id) }}</span>
- </div>
-
- <p v-if="workspace.description" class="desc">{{ workspace.description }}</p>
- <div class="children">
- <span v-for="child in getWorkspaceCategories(workspace.id).slice(0, 3)" :key="child.id" class="child-badge">
- {{ child.name }}
- </span>
- <span v-if="getWorkspaceCategories(workspace.id).length > 3" class="child-more"> +{{ getWorkspaceCategories(workspace.id).length - 3 }} </span>
+ <div class="workspace-tile" :class="accentColorClass">
+ <div class="glow-ambiance" />
+
+ <div class="tile-content">
+ <div class="top-row">
+ <div :class="['icon-box', getAppAccent(workspace.color, true)]">
+ <Icon :name="workspace.icon || 'workspace'" class="ws-icon" />
+ <span class="status-dot" />
+ </div>
+
+ <div class="doc-badge">
+ <span class="count-number">{{ docCount }}</span>
+ <span class="count-label">doc{{ docCount > 1 ? 's' : '' }}</span>
+ </div>
+ </div>
+
+ <div class="meta-zone">
+ <h3 class="ws-title">{{ workspace.name }}</h3>
+ <p v-if="workspace.description" class="ws-description">
+ {{ workspace.description }}
+ </p>
+ </div>
+
+ <div v-if="categories.length > 0" class="tile-footer">
+ <div class="category-pills">
+ <span v-for="child in categories.slice(0, 2)" :key="child.id" class="pill">
+ {{ child.name }}
+ </span>
+ <span v-if="categories.length > 2" class="pill-more"> +{{ categories.length - 2 }} autres </span>
+ </div>
+ </div>
</div>
</div>
</template>
<script setup lang="ts">
+import { computed } from 'vue';
import type { Node } from '~/stores';
-defineProps<{ workspace: Node }>();
+const props = defineProps<{ workspace: Node }>();
const nodesStore = useNodesStore();
-
const { getAppAccent } = useAppColors();
-// Get workspace categories
-const getWorkspaceCategories = (workspaceId: string) => {
- return nodesStore.categories.filter(n => n.parent_id === workspaceId).toArray();
-};
-
-// Get document count for a workspace
-const getWorkspaceDocCount = (workspaceId: string) => {
- const allChildren = nodesStore.getAllChildrensIds(workspaceId);
- return nodesStore.documents.filter(d => allChildren.includes(d.id)).size;
-};
+const accentColorClass = computed(() => {
+ const colors = ['blue', 'red', 'green', 'yellow', 'purple', 'pink', 'teal', 'primary'];
+ const colorIndex = props.workspace.color as number;
+ return colors[colorIndex] || 'primary';
+});
+
+const categories = computed(() => {
+ const childrenIds = nodesStore.getAll.getChildrenIds(props.workspace.id);
+ return childrenIds.map(id => nodesStore.getById(id)).filter((n): n is Node => !!n && (n.role === 1 || n.role === 2));
+});
+
+const docCount = computed(() => {
+ return nodesStore
+ .getDescendantIds(props.workspace.id)
+ .map(id => nodesStore.getById(id))
+ .filter(n => n?.role === 3).length;
+});
</script>
<style scoped lang="scss">
-.wp-card {
+.workspace-tile {
+ --tile-radius: 14px;
+ --bg-speed: 0.3s;
+
+ position: relative;
display: flex;
height: 100%;
- padding: 1.25rem;
+ padding: 1rem;
border: 1px solid var(--border);
- border-radius: var(--radius-lg);
- color: var(--text-body);
+ border-radius: var(--tile-radius);
background: var(--surface-base);
transition:
- box-shadow $transition-base ease,
- transform $transition-base ease;
+ border-color var(--bg-speed) ease,
+ transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
+ box-shadow 0.4s ease;
+ cursor: pointer;
flex-direction: column;
- text-decoration: none;
+ overflow: hidden;
&:hover {
- box-shadow: var(--shadow-md);
- transform: translateY(-2px);
- }
+ border-color: rgb(var(--primary), 0.35);
+ box-shadow:
+ 0 20px 30px -10px rgb(0 0 0 / 30%),
+ 0 0 0 1px rgb(var(--primary), 0.1);
+ transform: translateY(-6px) scale(1.01);
+
+ .glow-ambiance {
+ opacity: 0.12;
+ transform: scale(1.2);
+ }
- // Color variants - generated
- @each $color in ('blue', 'red', 'green', 'yellow', 'purple', 'pink', 'teal', 'primary') {
- &.#{$color} {
- border-left: 4px solid var(--#{$color});
+ .icon-box {
+ .ws-icon {
+ transform: scale(1.1);
+ }
+
+ .status-dot {
+ box-shadow: 0 0 12px var(--primary);
+ transform: scale(1.3);
+ }
}
}
}
-.header {
+.glow-ambiance {
+ position: absolute;
+ top: -20%;
+ right: -20%;
+ z-index: 0;
+ width: 70%;
+ height: 70%;
+ background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
+ opacity: 0;
+ transition:
+ opacity 0.6s ease,
+ transform 0.6s ease;
+ filter: blur(40px);
+ pointer-events: none;
+}
+
+.tile-content {
+ position: relative;
+ z-index: 1;
+ display: flex;
+ height: 100%;
+ flex-direction: column;
+}
+
+.top-row {
display: flex;
align-items: center;
justify-content: space-between;
- margin-bottom: 0.75rem;
+ margin-bottom: 1.5rem;
}
-.title {
+.icon-box {
+ position: relative;
display: flex;
+ width: 2.8rem;
+ height: 2.8rem;
+ border-radius: 10px;
align-items: center;
- gap: 0.5rem;
-}
+ justify-content: center;
-.icon {
- font-size: 1.5rem;
- color: var(--primary);
-}
+ .ws-icon {
+ font-size: 1.4rem;
+ transition: transform 0.3s ease;
+ }
-.count {
- padding: 0.2rem 0.6rem;
- border-radius: var(--radius-lg);
- font-size: 0.8rem;
- color: var(--text-secondary);
- background: var(--surface-raised);
+ .status-dot {
+ position: absolute;
+ top: -2px;
+ right: -2px;
+ width: 7px;
+ height: 7px;
+ border: 1.5px solid var(--surface-base);
+ border-radius: 50%;
+ background: var(--primary-border);
+ transition:
+ transform 0.3s ease,
+ box-shadow 0.3s ease;
+ }
}
-.name {
- font-size: 1.1rem;
- font-weight: 600;
- margin-bottom: 0.25rem;
+.doc-badge {
+ display: flex;
+ font-family: monospace;
+ align-items: baseline;
+ gap: 0.2rem;
+
+ .count-number {
+ font-size: 1.3rem;
+ font-weight: 700;
+ }
+
+ .count-label {
+ font-size: 0.75rem;
+ color: var(--text-muted);
+ letter-spacing: 0.05em;
+ text-transform: uppercase;
+ }
}
-.desc {
- display: -webkit-box;
- font-size: 0.85rem;
- color: var(--text-secondary);
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- margin-bottom: 0.75rem;
- overflow: hidden;
+.meta-zone {
+ margin-bottom: 1.5rem;
+
+ .ws-title {
+ margin: 0 0 0.4rem;
+ font-size: 1.25rem;
+ font-weight: 600;
+ color: var(--text-body);
+ transition: color 0.2s ease;
+ letter-spacing: -0.02em;
+ }
+
+ .ws-description {
+ display: -webkit-box;
+ margin: 0;
+ font-size: 0.85rem;
+ line-height: 1.5;
+ color: var(--text-secondary);
+ -webkit-box-orient: vertical;
+ -webkit-line-clamp: 2;
+ line-clamp: 2;
+ overflow: hidden;
+ }
}
-.children {
- display: flex;
- flex-wrap: wrap;
- gap: 0.4rem;
+.tile-footer {
+ border-top: 1px solid var(--border);
margin-top: auto;
+ padding-top: 1rem;
}
-.child-badge {
- padding: 0.2rem 0.5rem;
- border-radius: var(--radius-xs);
- font-size: 0.75rem;
- color: var(--text-secondary);
- background: var(--surface-raised);
-}
+.category-pills {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+
+ .pill {
+ position: relative;
+ font-size: 0.75rem;
+ font-weight: 500;
+ color: var(--text-secondary);
+ padding-left: 0.6rem;
+
+ &::before {
+ position: absolute;
+ top: 50%;
+ left: 0;
+ width: 4px;
+ height: 4px;
+ border-radius: 50%;
+ background: var(--border-strong);
+ content: '';
+ transform: translateY(-50%);
+ }
+ }
-.child-more {
- font-size: 0.75rem;
- color: var(--text-secondary);
+ .pill-more {
+ padding: 0.1rem 0.4rem;
+ border-radius: 4px;
+ font-size: 0.72rem;
+ font-weight: 500;
+ color: var(--text-muted);
+ background: var(--surface-raised);
+ }
}
</style>
diff --git a/frontend/app/components/Node/ContainerView.vue b/frontend/app/components/Node/ContainerView.vue
index bb515ebf..86787d2d 100644
--- a/frontend/app/components/Node/ContainerView.vue
+++ b/frontend/app/components/Node/ContainerView.vue
@@ -1,45 +1,48 @@
<template>
<div class="page-card node-list">
- <header>
- <h1 v-if="parent">
+ <Teleport to="#navbar-title">
+ <template v-if="slots.title">
+ <slot name="title" />
+ </template>
+ <template v-else-if="parent">
<Icon :name="parent.icon || 'files'" display="xl" :class="['parent-icon', getAppAccent(parent.color as number, true)]" />
{{ parent.name }}
- </h1>
- <h1 v-else-if="parentId === 'shared'">
+ </template>
+ <template v-else-if="parentId === 'shared'">
<Icon name="users" display="xl" class="parent-icon grey" />
{{ t('nodes.workspace.shared') }}
- </h1>
- <h1 v-else>
+ </template>
+ <template v-else>
<Icon name="workspace" display="xl" class="parent-icon primary" />
{{ t('nodes.workspace.all') }}
- </h1>
- <div class="header-actions">
- <NuxtLink v-if="view == 'kanban'" class="btn-icon no-mobile" @click="resetKanban">
- <Icon name="reset" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.resetBoard') }}</p>
- </NuxtLink>
- <NodeFilter v-show="!isMobile" :nodes="nodes" @update:nodes="filteredNodes = $event" />
- <NuxtLink v-if="parent?.shared && parent.user_id != connectedId" class="btn-icon no-mobile" @click="openRemoveShareModal">
- <Icon name="group_off" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.removeFromShared') }}</p>
- </NuxtLink>
- <NuxtLink v-if="parent && nodesStore.hasPermissions(parent, 4)" class="btn-icon no-mobile" @click="openPermissionsModal">
- <Icon name="manage_access" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.managePermissions') }}</p>
- </NuxtLink>
- <NuxtLink v-if="parent && nodesStore.hasPermissions(parent, 2)" class="btn-icon" @click="openEditModal">
- <Icon name="settings" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.editMeta') }}</p>
- </NuxtLink>
- <NuxtLink v-if="parent && nodesStore.hasPermissions(parent, 4)" class="btn-icon" @click="openDeleteModal">
- <Icon name="delete" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.delete') }}</p>
- </NuxtLink>
+ </template>
+ </Teleport>
+ <Teleport to="#navbar-actions">
+ <AppBtnIcon v-if="view == 'kanban'" nav icon="reset" :tooltip="t('nodes.actions.resetBoard')" @click="resetKanban" />
+ <NodeFilter v-show="!isMobile" :nodes="nodes" @update:nodes="filteredNodes = $event" />
+ <AppBtnIcon
+ v-if="parent?.shared && parent.user_id != connectedId"
+ nav
+ icon="group_off"
+ :tooltip="t('nodes.actions.removeFromShared')"
+ @click="openRemoveShareModal"
+ />
+ <AppBtnIcon
+ v-if="parent && nodesStore.hasPermissions(parent, 4)"
+ nav
+ icon="manage_access"
+ :tooltip="t('nodes.actions.managePermissions')"
+ @click="openPermissionsModal"
+ />
+ <AppBtnIcon v-if="parent && nodesStore.hasPermissions(parent, 2)" nav icon="settings" :tooltip="t('nodes.actions.editMeta')" @click="openEditModal" />
+ <AppBtnIcon v-if="parent && nodesStore.hasPermissions(parent, 4)" nav icon="delete" :tooltip="t('common.actions.delete')" @click="openDeleteModal" />
+ </Teleport>
+ <Teleport to="#navbar-infos">
+ <header>
<span class="doc-count no-mobile">{{ filteredNodes.length != nodes.length ? `${filteredNodes.length} /` : '' }} {{ nodes.length }}</span>
<ViewSelection v-model="view" :show-kanban="true" />
- </div>
- </header>
-
+ </header>
+ </Teleport>
<!-- Content based on view mode -->
<div v-if="filteredNodes.length" class="node-content">
<!-- Table/List View -->
@@ -91,6 +94,7 @@ const modals = useModal();
const { getAppAccent } = useAppColors();
const { t } = useI18nT();
const router = useRouter();
+const slots = useSlots();
const connectedId = userStore.user?.id;
const view = ref<ViewMode>();
@@ -159,6 +163,7 @@ function createDocumentInColumn(columnId: string) {
<style scoped lang="scss">
header {
+ display: flex;
flex-wrap: wrap;
gap: 12px;
}
@@ -171,27 +176,6 @@ h1 {
gap: 12px;
}
-.header-actions {
- display: flex;
- align-items: center;
- gap: 6px;
-}
-
-a {
- position: relative;
-}
-
-a:hover > .hint-tooltip {
- opacity: 1;
- visibility: visible;
-}
-
-.parent-icon {
- padding: 6px;
- border-radius: var(--radius-sm);
- margin-right: 10px;
-}
-
.doc-count {
padding: 8px 10px;
border-radius: var(--radius-md);
@@ -231,9 +215,5 @@ a:hover > .hint-tooltip {
.parent-icon {
margin-right: 0;
}
-
- .header-actions {
- gap: 0;
- }
}
</style>
diff --git a/frontend/app/components/Node/Document/ContentCompiled.vue b/frontend/app/components/Node/Document/ContentCompiled.vue
index 91f4768d..631a668b 100644
--- a/frontend/app/components/Node/Document/ContentCompiled.vue
+++ b/frontend/app/components/Node/Document/ContentCompiled.vue
@@ -9,7 +9,6 @@
</template>
<script setup lang="ts">
-import { subscribeDrawioCacheInvalidated } from '~/composables/useDrawioCache';
import { rerenderImages } from '~/helpers/DOM';
import type { Node } from '~/stores';
diff --git a/frontend/app/components/Node/Document/Header.vue b/frontend/app/components/Node/Document/Header.vue
index fae57360..cadc36e2 100644
--- a/frontend/app/components/Node/Document/Header.vue
+++ b/frontend/app/components/Node/Document/Header.vue
@@ -2,27 +2,32 @@
<div class="header" :class="{ 'print-style': printMode }">
<div class="container">
<!-- Skeleton when doc is undefined -->
- <HeaderSkeleton v-if="!doc" />
+ <NodeDocumentHeaderSkeleton v-if="!doc" />
<!-- Real content -->
<template v-else>
- <div class="top-row">
- <p class="user">
- <img v-if="user" :src="avatarURL(user)" alt="avatar" class="avatar" />
- <span style="font-size: 16px; color: var(--text-secondary)">{{ user?.username }}</span>
- </p>
- <HeaderActionRow :doc="doc" :is-public="public" class="no-print actions" />
- </div>
+ <Teleport to="#navbar-actions">
+ <NodeDocumentHeaderActionRow :doc="doc" :is-public="public" class="no-print actions" />
+ </Teleport>
+
<div class="content">
<div class="infos">
+ <p class="user">
+ <img v-if="user" :src="avatarURL(user)" alt="avatar" class="avatar" />
+ <span style="font-size: 16px; color: var(--text-secondary)">{{ user?.username }}</span>
+ </p>
<NuxtLink class="category" :to="`/dashboard/categories/${category?.id}`">{{ category?.name || 'Uncategorized' }}</NuxtLink>
<h1 :class="{ public: public }">{{ doc?.name }}</h1>
+ <Teleport to="#navbar-title">
+ <Icon :name="doc.icon || 'files'" display="xl" :class="['parent-icon', getAppAccent(doc.color as number, true)]" />
+ {{ doc.name }}
+ </Teleport>
<p class="description">{{ doc?.description }}</p>
<div v-if="doc.tags" class="tags">
<tag v-for="tag in doc.tags.split(',')" :key="tag" class="primary">{{ tag.trim() }}</tag>
</div>
</div>
<div class="thumbnail">
- <Thumbnail :document="doc" />
+ <NodeDocumentThumbnail :document="doc" />
</div>
</div>
</template>
@@ -31,21 +36,20 @@
</template>
<script setup lang="ts">
-import Thumbnail from './Thumbnail.vue';
-import HeaderSkeleton from './HeaderSkeleton.vue';
-import HeaderActionRow from './HeaderActionRow.vue';
import type { Node, PublicUser } from '~/stores';
const props = defineProps<{ doc?: Node; public?: boolean }>();
const userStore = useUserStore();
-
const preferences = usePreferencesStore();
+
const { avatarURL } = useApi();
const nodesTree = useNodesTree();
+const { getAppAccent } = useAppColors();
-const category = computed(() => nodesTree.getAncestorCategory(props.doc?.parent_id)?.data);
const user = ref<PublicUser | null>(null);
+
+const category = computed(() => nodesTree.getClosestCategoryAncestor(props.doc?.parent_id)?.data);
const printMode = preferences.get('printMode');
watchEffect(() => {
@@ -59,7 +63,7 @@ watchEffect(() => {
padding: 1.2rem 1.2rem 0;
border: 1px solid var(--border-subtle);
border-radius: 0.625rem;
- background-color: var(--surface-raised-light);
+ background: radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 18%, transparent), var(--surface-raised) 28%);
transition: background-color $transition-base;
}
@@ -72,18 +76,12 @@ p {
padding-right: 10px;
}
-.top-row {
+.user {
display: flex;
- align-items: flex-start;
- justify-content: space-between;
- margin-top: 6px;
-
- .user {
- display: flex;
- min-width: 120px;
- align-items: center;
- gap: 12px;
- }
+ min-width: 120px;
+ align-items: center;
+ gap: 12px;
+ margin-bottom: 8px;
}
.content {
@@ -157,7 +155,6 @@ h1 {
.description,
.category,
.tags,
- .top-row,
.user {
display: none;
}
diff --git a/frontend/app/components/Node/Document/HeaderActionRow.vue b/frontend/app/components/Node/Document/HeaderActionRow.vue
index f24bc504..a521dbf0 100644
--- a/frontend/app/components/Node/Document/HeaderActionRow.vue
+++ b/frontend/app/components/Node/Document/HeaderActionRow.vue
@@ -1,51 +1,26 @@
<template>
- <span class="actions-row">
- <NuxtLink
- v-if="doc.accessibility == 3 && !isPublic"
- class="btn-icon"
- :aria-label="t('nodes.actions.publicLink')"
- :to="`/doc/${doc.id}`"
- :prefetch="false"
- target="_blank"
- >
- <Icon name="link" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.publicLink') }}</p>
- </NuxtLink>
- <NuxtLink
+ <div>
+ <AppBtnIcon v-if="doc.accessibility == 3 && !isPublic" nav icon="link" :tooltip="t('nodes.actions.publicLink')" :to="`/doc/${doc.id}`" :blank="true" />
+ <AppBtnIcon
v-if="nodeStore.hasPermissions(doc, 2)"
- class="btn-icon"
- :aria-label="t('common.actions.edit')"
+ nav
+ icon="edit"
+ :tooltip="t('common.actions.edit')"
:to="isPublic ? `/doc/${doc.id}/edit` : `/dashboard/docs/edit/${doc.id}`"
- :prefetch="false"
- >
- <Icon name="edit" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.edit') }}</p>
- </NuxtLink>
- <button class="btn-icon" :aria-label="t('nodes.actions.exportAsMarkdown')" @click="exportMarkdown">
- <Icon name="markdown" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.exportAsMarkdown') }}</p>
- </button>
- <button class="btn-icon" :aria-label="t('common.actions.print')" @click="print">
- <Icon name="print" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.print') }}</p>
- </button>
- <button v-if="doc.shared" class="btn-icon" :aria-label="t('nodes.actions.removeFromShared')" @click="openRemoveShareModal">
- <Icon name="group_off" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.removeFromShared') }}</p>
- </button>
- <button v-if="nodeStore.hasPermissions(doc, 2)" class="btn-icon" :aria-label="t('nodes.actions.editMeta')" @click="openEditModal">
- <Icon name="settings" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.editMeta') }}</p>
- </button>
- <button v-if="nodeStore.hasPermissions(doc, 4)" class="btn-icon" :aria-label="t('nodes.actions.managePermissions')" @click="openPermissionsModal">
- <Icon name="manage_access" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.actions.managePermissions') }}</p>
- </button>
- <button v-if="nodeStore.hasPermissions(doc, 3)" class="btn-icon" :aria-label="t('common.actions.delete')" @click="openDeleteModal">
- <Icon name="delete" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.delete') }}</p>
- </button>
- </span>
+ />
+ <AppBtnIcon nav icon="markdown" :tooltip="t('nodes.actions.exportAsMarkdown')" @click="exportMarkdown" />
+ <AppBtnIcon nav icon="print" :tooltip="t('common.actions.print')" @click="print" />
+ <AppBtnIcon v-if="doc.shared" nav icon="group_off" :tooltip="t('nodes.actions.removeFromShared')" @click="openRemoveShareModal" />
+ <AppBtnIcon v-if="nodeStore.hasPermissions(doc, 2)" nav icon="settings" :tooltip="t('nodes.actions.editMeta')" @click="openEditModal" />
+ <AppBtnIcon
+ v-if="nodeStore.hasPermissions(doc, 4)"
+ nav
+ icon="manage_access"
+ :tooltip="t('nodes.actions.managePermissions')"
+ @click="openPermissionsModal"
+ />
+ <AppBtnIcon v-if="nodeStore.hasPermissions(doc, 3)" nav icon="delete" :tooltip="t('common.actions.delete')" @click="openDeleteModal" />
+ </div>
</template>
<script setup lang="ts">
@@ -88,18 +63,3 @@ function exportMarkdown() {
URL.revokeObjectURL(url);
}
</script>
-
-<style lang="scss" scoped>
-.btn-icon {
- position: relative;
-
- &:hover .hint-tooltip {
- opacity: 1;
- visibility: visible;
- }
-}
-
-.actions-row {
- flex-wrap: wrap;
-}
-</style>
diff --git a/frontend/app/components/Node/Document/HeaderSkeleton.vue b/frontend/app/components/Node/Document/HeaderSkeleton.vue
index f721e061..d4b8586e 100644
--- a/frontend/app/components/Node/Document/HeaderSkeleton.vue
+++ b/frontend/app/components/Node/Document/HeaderSkeleton.vue
@@ -55,32 +55,4 @@
background-position: 400px 0;
}
}
-
-@media print, screen and (width >= 1024px) {
- .icon {
- display: block;
- }
-}
-
-@media print {
- .print-style {
- padding: 0.4rem 0.2rem;
- background: none;
- align-items: center;
-
- .icon,
- .description,
- .document-tags,
- .category {
- display: none;
- }
-
- .title {
- font-size: 27px;
- font-weight: 700;
- text-align: center;
- border-bottom: 1px solid var(--text-body);
- }
- }
-}
</style>
diff --git a/frontend/app/components/Node/Document/Thumbnail.vue b/frontend/app/components/Node/Document/Thumbnail.vue
index f5bea9dc..8e66bbd2 100644
--- a/frontend/app/components/Node/Document/Thumbnail.vue
+++ b/frontend/app/components/Node/Document/Thumbnail.vue
@@ -41,7 +41,6 @@ const thumbnail = computed(() => {
display: block;
width: 100%;
height: 160px;
- padding: 10px 0;
}
.user-image {
diff --git a/frontend/app/components/Node/Filter.vue b/frontend/app/components/Node/Filter.vue
index 38e5b511..79c5477c 100644
--- a/frontend/app/components/Node/Filter.vue
+++ b/frontend/app/components/Node/Filter.vue
@@ -1,10 +1,8 @@
<template>
<div ref="root" class="filter-component">
- <div class="btn-icon" @click="toggle" @keydown.enter.prevent="toggle">
- <Icon name="filter" display="lg" />
- <p class="hint-tooltip">{{ t('nodes.filter.title') }}</p>
+ <AppBtnIcon nav icon="filter" :tooltip="t('nodes.filter.title')" @click="toggle">
<span v-if="filtered.length != nodes?.length" class="bubble"></span>
- </div>
+ </AppBtnIcon>
<Transition name="pop">
<div v-if="opened" class="filter-panel" role="dialog" :aria-label="t('nodes.filter.title')" @keydown.esc.prevent="close">
@@ -121,15 +119,6 @@ onBeforeUnmount(() => {
display: inline-block;
}
-.btn-icon {
- position: relative;
-
- &:hover > .hint-tooltip {
- opacity: 1;
- visibility: visible;
- }
-}
-
.bubble {
position: absolute;
top: 2px;
@@ -185,12 +174,6 @@ label {
cursor: pointer;
}
-.btn.primary {
- border: none;
- color: white;
- background: linear-gradient(180deg, var(--primary) 0%, var(--primary-600) 100%);
-}
-
.panel-footer {
color: var(--muted);
margin-top: 8px;
diff --git a/frontend/app/components/Node/Modals/CreateCategory.vue b/frontend/app/components/Node/Modals/CreateCategory.vue
index b1398572..cc9f22ac 100644
--- a/frontend/app/components/Node/Modals/CreateCategory.vue
+++ b/frontend/app/components/Node/Modals/CreateCategory.vue
@@ -1,12 +1,14 @@
<template>
<div class="modal">
- <h2>{{ role == 1 ? t('nodes.workspace.new') : t('nodes.category.new') }}</h2>
+ <h2>{{ role == 0 ? 'Create team' : role == 1 ? t('nodes.workspace.new') : t('nodes.category.new') }}</h2>
<label for="name">{{ t('common.labels.name') }}</label>
<input id="name" v-model="category.name" class="entry" type="text" required :placeholder="t('common.labels.name')" />
- <label>{{ t('common.labels.parent') }}</label>
- <div>
- <AppSelect v-model="category.parent_id" class="entry" :items="categoriesItem" nullable :placeholder="t('common.labels.parent')" />
- </div>
+ <template v-if="role !== 0">
+ <label>{{ t('common.labels.parent') }}</label>
+ <div>
+ <AppSelect v-model="category.parent_id" class="entry" :items="categoriesItem" nullable :placeholder="t('common.labels.parent')" />
+ </div>
+ </template>
<div style="display: flex; flex-wrap: wrap">
<div style="min-width: 200px; flex: 1; margin-right: 10px">
<label for="order">{{ t('common.labels.order') }} <AppHint :text="t('nodes.category.orderHint')" /></label>
@@ -27,7 +29,7 @@
<script setup lang="ts">
import type { Node } from '~/stores';
-const props = defineProps<{ role: 1 | 2 }>();
+const props = defineProps<{ role: 0 | 1 | 2; parentId?: string }>();
const emit = defineEmits(['close']);
const categoriesStore = useNodesStore();
@@ -36,12 +38,12 @@ const nodesTree = useNodesTree();
const sidebar = useSidebar();
const { t } = useI18nT();
-const categoriesItem = nodesTree.treeUpToRole(2);
+const categoriesItem = nodesTree.getTreeUpToRole(2);
function getDefaultParentId() {
const activeId = sidebar.active_id.value;
if (activeId) {
- const activeNode = nodesTree.getAncestorCategory(activeId);
+ const activeNode = nodesTree.getClosestCategoryAncestor(activeId);
if (activeNode) return activeNode.id;
}
const workspaceId = sidebar.workspaceId.value;
@@ -52,7 +54,7 @@ function getDefaultParentId() {
const category = ref<Partial<Node>>({
accessibility: 1,
name: '',
- parent_id: getDefaultParentId(),
+ parent_id: props.role === 0 ? undefined : (props.parentId ?? getDefaultParentId()),
role: props.role,
});
diff --git a/frontend/app/components/Node/Modals/DrawioEditor.vue b/frontend/app/components/Node/Modals/DrawioEditor.vue
index 17817aa1..56d756e8 100644
--- a/frontend/app/components/Node/Modals/DrawioEditor.vue
+++ b/frontend/app/components/Node/Modals/DrawioEditor.vue
@@ -2,15 +2,9 @@
<div class="drawio-editor-modal">
<EditorAppHeader icon="image" :title="t('markdown.drawio.title')">
<template #toolbar>
- <div class="btn-icon" :class="{ disabled: !isReady }" @click="requestSaveDiagram">
- <Icon name="save" display="lg" />
- </div>
- <div class="btn-icon" :class="{ disabled: !isReady }" @click="toggleFullScreen">
- <Icon name="fullsreen" display="lg" />
- </div>
- <div class="btn-icon" :class="{ disabled: !isReady }" @click="openDeleteModal">
- <Icon name="delete" display="lg" />
- </div>
+ <AppBtnIcon nav icon="save" :class="{ disabled: !isReady }" :tooltip="t('common.actions.save')" @click="requestSaveDiagram" />
+ <AppBtnIcon nav icon="fullsreen" :class="{ disabled: !isReady }" :tooltip="t('common.actions.toggleFullscreen')" @click="toggleFullScreen" />
+ <AppBtnIcon nav icon="delete" :class="{ disabled: !isReady }" :tooltip="t('common.actions.delete')" @click="openDeleteModal" />
</template>
</EditorAppHeader>
diff --git a/frontend/app/components/Node/Modals/Join.vue b/frontend/app/components/Node/Modals/Join.vue
new file mode 100644
index 00000000..c8d37425
--- /dev/null
+++ b/frontend/app/components/Node/Modals/Join.vue
@@ -0,0 +1,104 @@
+<template>
+ <div class="modal">
+ <div class="eyebrow">{{ t('nodes.modals.join.access') }}</div>
+ <h1>{{ t('nodes.modals.join.title') }}</h1>
+ <p class="subtitle">{{ t('nodes.modals.join.subtitle') }}</p>
+
+ <form class="join-form" @submit.prevent="joinWorkspace">
+ <label for="invite">{{ t('nodes.modals.join.label') }}</label>
+ <input id="invite" v-model="inviteInput" type="text" autocomplete="off" :placeholder="t('nodes.modals.join.inputPlaceholder')" />
+ <AppButton type="primary" :disabled="isJoining">{{ isJoining ? t('nodes.modals.join.joining') : t('nodes.modals.join.join') }}</AppButton>
+ </form>
+
+ <p v-if="errorMessage" class="error-message">{{ errorMessage }}</p>
+ <p v-if="successMessage" class="success-message">{{ successMessage }}</p>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { resolveNodeLink } from '~/helpers/node';
+
+const props = defineProps<{ code?: string }>();
+const emit = defineEmits(['close']);
+
+const router = useRouter();
+const nodesStore = useNodesStore();
+const notifications = useNotifications();
+const { t } = useI18nT();
+
+const inviteInput = ref('');
+const isJoining = ref(false);
+const errorMessage = ref('');
+const successMessage = ref('');
+
+const joinWorkspace = async () => {
+ const code = inviteInput.value.trim();
+ if (!code) {
+ errorMessage.value = 'Enter an invitation code or link.';
+ return;
+ }
+
+ isJoining.value = true;
+ errorMessage.value = '';
+ successMessage.value = '';
+
+ try {
+ const result = await nodesStore.joinInvitation(code);
+ await nodesStore.init();
+ successMessage.value = 'Joined successfully.';
+ notifications.add({ type: 'success', title: 'Workspace joined' });
+ await router.push(resolveNodeLink(result.node));
+ } catch (error) {
+ errorMessage.value = error instanceof Error ? error.message : String(error);
+ } finally {
+ emit('close');
+ isJoining.value = false;
+ }
+};
+
+onMounted(() => {
+ const code = props.code;
+ if (!code) return;
+ inviteInput.value = Array.isArray(code) ? code[0] || '' : String(code);
+});
+</script>
+
+<style scoped lang="scss">
+.eyebrow {
+ font-size: 0.78rem;
+ font-weight: 700;
+ color: var(--text-secondary);
+ letter-spacing: 0.18em;
+ text-transform: uppercase;
+}
+
+.subtitle {
+ margin: 0 0 1.5rem;
+ color: var(--text-secondary);
+}
+
+.join-form {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+
+ label {
+ font-weight: 600;
+ }
+
+ input {
+ min-height: 48px;
+ background: var(--surface-raised);
+ }
+}
+
+.error-message {
+ color: var(--red);
+ margin-top: 1rem;
+}
+
+.success-message {
+ color: var(--green);
+ margin-top: 1rem;
+}
+</style>
diff --git a/frontend/app/components/Node/Modals/Metadata.vue b/frontend/app/components/Node/Modals/Metadata.vue
index c9c5f861..ab8f9dd2 100644
--- a/frontend/app/components/Node/Modals/Metadata.vue
+++ b/frontend/app/components/Node/Modals/Metadata.vue
@@ -52,7 +52,7 @@ const { t } = useI18nT();
const node = ref<Node>({ ...props.doc });
const pinnedToggle = ref(node.value.order == -1);
-const parentsTree = nodesTree.treeUpToRole(node.value.role);
+const parentsTree = nodesTree.getTreeUpToRole(node.value.role);
onBeforeMount(async () => {
const latestNode = await nodeStore.fetch({ id: node.value.id });
diff --git a/frontend/app/components/Node/Modals/Permissions.vue b/frontend/app/components/Node/Modals/Permissions.vue
index 7b71896e..e7b777b2 100644
--- a/frontend/app/components/Node/Modals/Permissions.vue
+++ b/frontend/app/components/Node/Modals/Permissions.vue
@@ -33,7 +33,7 @@
</span>
<div class="user-actions">
<AppSelect v-model="selectedPermission" :items="NODE_PERMISSIONS" :searchable="false" size="200px" />
- <button @click="addPermission(user)">{{ t('nodes.modals.permissions.addPermission') }}</button>
+ <AppButton type="primary" small @click="addPermission(user)">{{ t('nodes.modals.permissions.addPermission') }}</AppButton>
</div>
</div>
</div>
@@ -67,12 +67,40 @@
</div>
</li>
</ul>
+
+ <hr />
+
+ <label for="invitations">{{ t('nodes.modals.permissions.inviteLabel') }}</label>
+ <div class="invite-form">
+ <AppSelect v-model="selectedInvitationPermission" :items="NODE_PERMISSIONS" :searchable="false" />
+ <AppButton type="primary" small :disabled="isCreatingInvitation" @click="createInvitation">
+ {{ isCreatingInvitation ? t('nodes.modals.permissions.inviteCreateProgress') : t('nodes.modals.permissions.inviteCreate') }}
+ </AppButton>
+ </div>
+ <p v-if="!invitations.length" class="info-secondary">{{ t('nodes.modals.permissions.inviteEmpty') }}</p>
+ <ul id="invitations" class="permissions-list">
+ <li v-for="invitation in invitations" :key="invitation.id" class="permission-item invitation-item">
+ <div class="user-info-row invitation-row">
+ <span class="invite-meta">
+ <span class="invite-code">{{ invitation.invitation_code }}</span>
+ <span class="invite-details">
+ {{ t('nodes.modals.permissions.invitePermission') }}: {{ invitation.permission_level }} · {{ shortDate(invitation.created_timestamp) }}</span
+ >
+ </span>
+
+ <div class="user-actions">
+ <AppButton type="secondary" small @click="copyInvitationLink(invitation.invitation_code)">Copy link</AppButton>
+ <AppButton type="danger" small @click="deleteInvitation(invitation.id)">Revoke</AppButton>
+ </div>
+ </div>
+ </li>
+ </ul>
</div>
</template>
<script setup lang="ts">
import { DOCUMENT_ACCESSIBILITIES, DOCUMENT_GENERAL_ACCESS, NODE_PERMISSIONS } from '~/helpers/constants';
-import type { Node, Permission, PublicUser } from '~/stores';
+import type { Node, NodeInvitation, Permission, PublicUser } from '~/stores';
const props = defineProps<{ node: Node }>();
const { t } = useI18nT();
@@ -81,15 +109,26 @@ const usersStore = useUserStore();
const nodesStore = useNodesStore();
const { avatarURL } = useApi();
+const { shortDate } = useDateFormatters();
+const notifications = useNotifications();
const node = ref<Node>(props.node);
const query = ref('');
const users = ref<PublicUser[]>([]);
const selectedPermission = ref(1);
+const selectedInvitationPermission = ref(1);
+const invitations = ref<NodeInvitation[]>([]);
const searchError = ref<string | null>(null);
const isLoading = ref(false);
+const isCreatingInvitation = ref(false);
const link = computed(() => `${window.location.origin}/doc/${node.value?.id}`);
+const invitationLink = (code: string) => `${window.location.origin}/dashboard/join-workspace?code=${encodeURIComponent(code)}`;
+
+const refreshInvitations = async () => {
+ if (!node.value?.id) return;
+ invitations.value = await nodesStore.fetchInvitations(node.value.id);
+};
watchEffect(() => {
if (node.value.partial) nodesStore.fetch({ id: node.value.id }).then(fetched => (node.value = fetched));
@@ -98,6 +137,16 @@ watchEffect(() => {
}
});
+watch(
+ () => node.value.id,
+ () => {
+ refreshInvitations().catch(() => {
+ invitations.value = [];
+ });
+ },
+ { immediate: true },
+);
+
watch(query, async newQuery => {
users.value = [];
searchError.value = null;
@@ -139,6 +188,31 @@ const addPermission = async (user: PublicUser) => {
selectedPermission.value = 1;
};
+const createInvitation = async () => {
+ if (!node.value?.id) return;
+ isCreatingInvitation.value = true;
+ try {
+ const invitation = await nodesStore.addInvitation(node.value.id, selectedInvitationPermission.value);
+ invitations.value = [invitation, ...invitations.value];
+ selectedInvitationPermission.value = 1;
+ notifications.add({ type: 'success', title: 'Invitation created' });
+ } finally {
+ isCreatingInvitation.value = false;
+ }
+};
+
+const deleteInvitation = async (invitationId: string) => {
+ if (!node.value?.id) return;
+ await nodesStore.removeInvitation(node.value.id, invitationId);
+ invitations.value = invitations.value.filter(invitation => invitation.id !== invitationId);
+ notifications.add({ type: 'success', title: 'Invitation revoked' });
+};
+
+const copyInvitationLink = async (code: string) => {
+ await navigator.clipboard.writeText(invitationLink(code));
+ notifications.add({ type: 'success', title: 'Invitation link copied to clipboard' });
+};
+
const updatePermission = async (perm: Permission) => {
await nodesStore.updatePermission(perm);
};
@@ -239,19 +313,6 @@ form {
margin-top: 10px;
}
-button {
- padding: 4px 8px;
- border: none;
- border-radius: var(--radius-sm);
- color: white;
- background: var(--primary-color, #444);
- cursor: pointer;
-}
-
-button:hover {
- background: var(--primary-hover, #666);
-}
-
.permissions-list {
margin: 0;
padding: 0;
@@ -260,6 +321,35 @@ button:hover {
.permission-item {
padding: 8px;
- border-bottom: 1px solid var(--border, #ddd);
+ border-bottom: 1px solid var(--border);
+}
+
+.invite-form {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+
+.invitation-item {
+ .invitation-row {
+ gap: 10px;
+ }
+
+ .invite-meta {
+ display: flex;
+ min-width: 0;
+ flex-direction: column;
+ gap: 2px;
+ }
+
+ .invite-code {
+ font-weight: 700;
+ letter-spacing: 0.12em;
+ }
+
+ .invite-details {
+ font-size: 12px;
+ color: var(--text-secondary);
+ }
}
</style>
diff --git a/frontend/app/components/Node/Resource/CDN.vue b/frontend/app/components/Node/Resource/CDN.vue
new file mode 100644
index 00000000..859fcbf1
--- /dev/null
+++ b/frontend/app/components/Node/Resource/CDN.vue
@@ -0,0 +1,403 @@
+<template>
+ <div class="page-card">
+ <Teleport to="#navbar-title"><Icon name="cdn" /> {{ props.title || t('cdn.meta.title') }}</Teleport>
+
+ <Teleport to="#navbar-infos">
+ <div class="action-row">
+ <NodeFilter v-show="!device.isMobile" :nodes="nodes" @update:nodes="filteredResources = $event" />
+ <ViewSelection v-model="view" />
+ </div>
+ </Teleport>
+ <div class="storage-indicator">
+ <div class="storage-info">
+ <span class="storage-label">{{ t('cdn.storageUsed') }}</span>
+ <span class="storage-values">{{ readableFileSize(totalUsedSpace) }} / {{ readableFileSize(MAX_STORAGE) }}</span>
+ </div>
+ <div class="progress-bar">
+ <div
+ class="progress-fill"
+ :style="{ width: storagePercentage + '%' }"
+ :class="{ warning: storagePercentage > 80, danger: storagePercentage > 95 }"
+ ></div>
+ </div>
+ <span class="storage-percentage">{{ storagePercentage.toFixed(1) }}%</span>
+ </div>
+ <AppDrop ref="dropComponent" multiple :max-files="10" @select="selectFiles" />
+ <div style="display: flex; width: 100%; padding: 12px 0; align-items: center; flex-direction: column; gap: 10px">
+ <AppButton type="primary" :disabled="!selectedFiles.length" @click="submitFiles">
+ {{ selectedFiles.length ? t('cdn.actions.upload.multiple', { n: selectedFiles.length }) : t('cdn.actions.upload.idle') }}
+ </AppButton>
+ <div v-if="isLoading" class="upload-progress">
+ <LoaderSpinner />
+ <span>{{ t('cdn.actions.upload.progress', { n: uploadProgress.current, total: uploadProgress.total }) }}</span>
+ </div>
+ </div>
+ <div v-if="fileLinks.length" class="link-section">
+ <div class="links-text" v-text="linksText"></div>
+ <div class="links-actions">
+ <AppButton type="primary" @click="copyLinks">{{ t('common.actions.copy') }} {{ fileLinks.length > 1 ? 'links' : 'link' }}</AppButton>
+ <AppButton type="secondary" @click="fileLinks = []">{{ t('common.actions.clear') }}</AppButton>
+ </div>
+ </div>
+ <div v-if="filteredResources.length" class="resources-list">
+ <DataTable v-if="view === 'table'" :headers="headers" :rows="rows">
+ <template #bulk-actions="{ selected }">
+ <div class="bulk-actions">
+ <span class="selected-count">{{ selected.length }}</span>
+ <span style="height: 32px; border-left: 1px solid var(--border); margin-left: 4px"></span>
+ <span @click="bulkDelete(selected)"><Icon name="delete" fill="var(--text-secondary)" class="action-btn" /></span>
+ </div>
+ </template>
+ <template #action="{ cell }">
+ <NuxtLink :href="`/dashboard/cdn/${(cell?.data as Node).id}/preview`" style="margin-right: 10px"><Icon name="view" /> </NuxtLink>
+ <NuxtLink :to="`/dashboard/cdn/${(cell?.data as Node).id}`"><Icon name="edit" style="margin-right: 10px" /></NuxtLink>
+ <span @click="() => deleteResource(cell?.data as Node)"><Icon name="delete" /></span>
+ </template>
+ </DataTable>
+ <div v-else>
+ <hr />
+ <div class="images-grid">
+ <div
+ v-for="image in filteredResources"
+ :key="image.id"
+ class="image-item"
+ @click="router.push(`/dashboard/cdn/${image.id}/preview`)"
+ @contextmenu="event => openContextMenu(event, image)"
+ >
+ <img :src="resolvePreviewUrl(image)" :alt="image.name" class="image-preview" />
+ <div class="image-info">
+ <span class="image-name">{{ image.name }}</span>
+ <span class="image-size">{{ readableFileSize(image.size ?? 0) }}</span>
+ </div>
+ </div>
+ <div v-if="!filteredResources.length" class="not-found">
+ <p>{{ t('common.search.noResults', { filter: filter }) }}</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <NoContent v-else :title="t('cdn.page.empty')"></NoContent>
+ </div>
+</template>
+<script setup lang="ts">
+import ResourceContextMenu from '~/components/Node/Action/ResourceContextMenu.vue';
+import DeleteNodeModal from '~/components/Node/Modals/Delete.vue';
+import { readableFileSize, resolvePreviewUrl } from '~/helpers/resources';
+import { resolveNodeColor } from '~/helpers/node';
+
+import type { Field } from '~/components/DataTable.vue';
+import type { Node } from '~/stores';
+
+const props = defineProps<{
+ parentId?: string;
+ title?: string;
+}>();
+
+const nodesStore = useNodesStore();
+const resourcesStore = useResourcesStore();
+
+const router = useRouter();
+const { t } = useI18nT();
+const { numericDate } = useDateFormatters();
+const { resourceURL } = useApi();
+const tree = useNodesTree();
+const device = useDevice();
+const appColors = useAppColors();
+const contextMenu = useContextMenu();
+const modals = useModal();
+const notifications = useNotifications();
+
+const view = ref<'list' | 'table'>('list');
+const selectedFiles = ref<File[]>([]);
+const fileLinks = ref<string[]>([]);
+const isLoading = ref(false);
+const uploadProgress = ref({ current: 0, total: 0 });
+const dropComponent = ref();
+const filter = ref('');
+
+const MAX_STORAGE = 1024 * 1024 * 1024; // 1 GB in bytes
+
+const nodes = computed(() => {
+ if (props.parentId)
+ return tree
+ .getSubtreeAsArray(props.parentId)
+ .filter(node => node.data.role === 4)
+ .map(i => i.data);
+ else return nodesStore.resources;
+});
+const filteredResources = ref(nodes.value);
+
+const totalUsedSpace = computed(() => nodesStore.getTotalUsedStorage);
+const storagePercentage = computed(() => Math.min((totalUsedSpace.value / MAX_STORAGE) * 100, 100));
+const linksText = computed(() => fileLinks.value.join('\n'));
+
+// DataTable setup
+const headers = [
+ { key: 'name', label: t('common.labels.name') },
+ { key: 'size', label: t('common.labels.size') },
+ { key: 'type', label: t('common.labels.type') },
+ { key: 'parent', label: t('common.labels.parent') },
+ { key: 'date', label: t('common.labels.date') },
+ { key: 'action', label: t('common.labels.action') },
+];
+
+const rows: ComputedRef<Field[]> = computed(() =>
+ filteredResources.value.map(res => {
+ const parent = res.parent_id ? nodesStore.getById(res.parent_id) : null;
+ const category = parent ? nodesStore.getById(parent.parent_id || '') : null;
+ return {
+ action: { data: res, type: 'slot' },
+ date: { content: numericDate(res.created_timestamp), type: 'text' },
+ name: { content: res.name, type: 'text' },
+ parent: { content: category ? `<tag class="${appColors.getAppAccent(category.color)}">${parent?.name}</tag>` : '', type: 'html' },
+ size: { content: readableFileSize(res.size ?? 0), type: 'text' },
+ type: { content: `<tag class="${resolveNodeColor(res.metadata?.filetype || '')}">${res.metadata?.filetype || ''}</tag>`, type: 'html' },
+ };
+ }),
+);
+
+// Actions
+const selectFiles = (files: File | File[] | null) => {
+ if (Array.isArray(files)) {
+ selectedFiles.value = files;
+ } else if (files) {
+ selectedFiles.value = [files];
+ }
+};
+
+const openContextMenu = (event: MouseEvent, node: Node) => {
+ if (!node) return;
+ contextMenu.open(shallowRef(ResourceContextMenu), event, {
+ props: { node: node },
+ });
+};
+
+const copyLinks = () => navigator.clipboard.writeText(fileLinks.value.join('\n'));
+
+const submitFiles = async () => {
+ if (!selectedFiles.value.length) return;
+ isLoading.value = true;
+ fileLinks.value = [];
+ uploadProgress.value = { current: 0, total: selectedFiles.value.length };
+
+ const filesToUpload = [...selectedFiles.value];
+ selectedFiles.value = [];
+ dropComponent.value.reset();
+
+ for (const file of filesToUpload) {
+ const body = new FormData();
+ body.append('file', file);
+ if (props.parentId) body.append('parent_id', props.parentId);
+ try {
+ const r = await resourcesStore.post(body);
+ fileLinks.value.push(resourceURL(r));
+ } catch (e) {
+ notifications.add({ message: t('cdn.notifications.error', { error: e, file: file.name }), title: 'Error', type: 'error' });
+ }
+ uploadProgress.value.current++;
+ }
+
+ isLoading.value = false;
+ if (fileLinks.value.length) {
+ notifications.add({
+ message: t('cdn.notifications.successMsg', { n: fileLinks.value.length }),
+ title: t('cdn.notifications.successTitle'),
+ type: 'success',
+ });
+ }
+};
+
+const deleteResource = async (node: Node) => {
+ modals.add(new Modal(shallowRef(DeleteNodeModal), { props: { node: node, redirectTo: '/dashboard/cdn' }, size: 'small' }));
+};
+const bulkDelete = async (lines: Field[]) => {
+ const resources = lines.map(line => line.action?.data as Node);
+ modals.add(new Modal(shallowRef(DeleteNodeModal), { props: { nodes: resources, redirectTo: '/dashboard/cdn' }, size: 'small' }));
+};
+</script>
+
+<style scoped lang="scss">
+.storage-indicator {
+ display: flex;
+ width: 100%;
+ margin: 12px 0;
+ padding: 12px 16px;
+ border-radius: var(--radius-md);
+ align-items: center;
+ gap: 12px;
+
+ .storage-info {
+ display: flex;
+ min-width: 180px;
+ flex-direction: column;
+ gap: 2px;
+
+ .storage-label {
+ font-size: 12px;
+ color: var(--text-secondary);
+ }
+
+ .storage-values {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--text-primary);
+ }
+ }
+
+ .progress-bar {
+ height: 8px;
+ border-radius: var(--radius-xs);
+ background: var(--surface-transparent);
+ flex: 1;
+ overflow: hidden;
+
+ .progress-fill {
+ height: 100%;
+ border-radius: var(--radius-xs);
+ background: var(--primary);
+ transition: width $transition-medium ease;
+
+ &.warning {
+ background: #f59e0b;
+ }
+
+ &.danger {
+ background: #ef4444;
+ }
+ }
+ }
+
+ .storage-percentage {
+ min-width: 50px;
+ font-size: 13px;
+ font-weight: 500;
+ color: var(--text-secondary);
+ text-align: right;
+ }
+}
+
+.action-row {
+ display: flex;
+ align-items: center;
+}
+
+.upload-progress {
+ display: flex;
+ font-size: 14px;
+ color: var(--text-secondary);
+ align-items: center;
+ gap: 10px;
+}
+
+.link-section {
+ display: flex;
+ width: 100%;
+ margin: 6px 0;
+ flex-direction: column;
+ gap: 10px;
+
+ .links-text {
+ width: 100%;
+ padding: 10px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-sm);
+ font-family: $font-mono;
+ font-size: 13px;
+ color: var(--text-primary);
+ white-space: pre-wrap;
+ word-break: break-all;
+ }
+
+ .links-actions {
+ display: flex;
+ gap: 10px;
+ }
+}
+
+.bulk-actions {
+ display: flex;
+ width: 100%;
+ align-items: center;
+ gap: 8px;
+}
+
+.action-btn {
+ cursor: pointer;
+
+ &:hover {
+ background: var(--surface-transparent);
+ }
+}
+
+.selected-count {
+ display: flex;
+ width: 32px;
+ height: 34px;
+ padding: 4px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-xs);
+ font-size: 12px;
+ font-weight: bold;
+ color: var(--text-secondary);
+ align-items: center;
+ justify-content: center;
+}
+
+.resources-list {
+ width: 100%;
+}
+
+.not-found {
+ color: var(--text-secondary);
+ text-align: center;
+ grid-column: 1 / -1;
+}
+
+.images-grid {
+ display: grid;
+ padding: 16px 0;
+ flex: 1;
+ gap: 16px;
+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
+}
+
+.image-item {
+ border: 2px solid transparent;
+ border-radius: var(--radius-md);
+ cursor: pointer;
+
+ &:hover {
+ border-color: var(--primary);
+ box-shadow: var(--shadow-lg);
+ transform: translateY(-2px);
+ }
+
+ .image-preview {
+ width: 100%;
+ height: 150px;
+ border-radius: var(--radius-sm);
+ object-fit: cover;
+ }
+
+ .image-info {
+ padding: 12px;
+
+ .image-name {
+ display: block;
+ font-size: 14px;
+ font-weight: 500;
+ color: var(--text-primary);
+ margin-bottom: 4px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+
+ .image-size {
+ display: block;
+ font-size: 12px;
+ color: var(--text-secondary);
+ }
+ }
+}
+</style>
diff --git a/frontend/app/components/Node/Resource/Inline.vue b/frontend/app/components/Node/Resource/Inline.vue
index aaf39f20..d7ace483 100644
--- a/frontend/app/components/Node/Resource/Inline.vue
+++ b/frontend/app/components/Node/Resource/Inline.vue
@@ -7,12 +7,8 @@
<span class="file-size">{{ readableFileSize(node.size ?? 0) }}</span>
</div>
- <button v-if="editable" class="btn-icon file-edit" @click.prevent="openDrawioEditor">
- <Icon name="edit" />
- </button>
- <button class="btn-icon file-remove" @click.prevent="openDeleteModal">
- <Icon name="close" />
- </button>
+ <AppBtnIcon v-if="editable" nav icon="edit" :tooltip="t('common.actions.edit')" @click.prevent="openDrawioEditor" />
+ <AppBtnIcon nav icon="delete" :tooltip="t('common.actions.delete')" @click.prevent="openDeleteModal" />
</NuxtLink>
</template>
@@ -22,33 +18,20 @@ import DrawioEditorModal from '../Modals/DrawioEditor.vue';
import { isImageFile, readableFileSize, resolveFileIcon, resolvePreviewUrl } from '~/helpers/resources';
import type { Node } from '~/stores';
-const props = defineProps<{
- node: Node;
-}>();
+const props = defineProps<{ node: Node }>();
const modal = useModal();
-
-const editable = computed(() => props.node.metadata?.drawio);
+const { t } = useI18nT();
const preview = ref<string | null>(null);
-if (isImageFile(props.node.metadata?.filetype)) preview.value = resolvePreviewUrl(props.node);
+const editable = computed(() => props.node.metadata?.drawio);
-const openDeleteModal = () => {
- modal.add(new Modal(shallowRef(NodeDeleteModal), { size: 'small', props: { node: props.node, redirect: '/dashboard' } }));
-};
+if (isImageFile(props.node.metadata?.filetype)) preview.value = resolvePreviewUrl(props.node);
-function openDrawioEditor() {
- modal.add(
- new Modal(shallowRef(DrawioEditorModal), {
- props: {
- node: props.node,
- },
- size: 'large',
- noPadding: true,
- }),
- );
-}
+// Actions
+const openDeleteModal = () => modal.add(new Modal(shallowRef(NodeDeleteModal), { size: 'small', props: { node: props.node, redirect: '/dashboard' } }));
+const openDrawioEditor = () => modal.add(new Modal(shallowRef(DrawioEditorModal), { props: { node: props.node }, size: 'large', noPadding: true }));
</script>
<style scoped lang="scss">
diff --git a/frontend/app/components/Node/Stats.vue b/frontend/app/components/Node/Stats.vue
new file mode 100644
index 00000000..f455dff0
--- /dev/null
+++ b/frontend/app/components/Node/Stats.vue
@@ -0,0 +1,80 @@
+<template>
+ <section>
+ <div class="card">
+ <Icon name="files" display="xxl" class="stat-icon" fill="var(--primary)" />
+ <div class="content">
+ <span class="value">{{ countByRole(3) }}</span>
+ <span class="label">{{ t('dashboard.stats.documents') }}</span>
+ </div>
+ </div>
+ <div class="card">
+ <Icon name="categories" display="xxl" class="stat-icon" fill="var(--primary)" />
+ <div class="content">
+ <span class="value">{{ countByRole(1) }}</span>
+ <span class="label">{{ t('dashboard.stats.workspaces') }}</span>
+ </div>
+ </div>
+ <div class="card">
+ <Icon name="advanced" display="xxl" class="stat-icon" fill="var(--primary)" />
+ <div class="content">
+ <span class="value">{{ countByRole(2) }}</span>
+ <span class="label">{{ t('dashboard.stats.tags') }}</span>
+ </div>
+ </div>
+ <div class="card">
+ <Icon name="import" display="xxl" class="stat-icon" fill="var(--primary)" />
+ <div class="content">
+ <span class="value">{{ countByRole(4) }}</span>
+ <span class="label">{{ t('dashboard.stats.cdnFiles') }}</span>
+ </div>
+ </div>
+ </section>
+</template>
+
+<script setup lang="ts">
+const props = defineProps<{ parentId?: string }>();
+
+const nodesTree = useNodesTree();
+const { t } = useI18nT();
+
+const countByRole = (role: number) => nodesTree.getSubtreeAsArray(props.parentId).filter(node => node.data.role === role).length;
+</script>
+
+<style scoped lang="scss">
+section {
+ display: grid;
+ gap: 1rem;
+ grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
+}
+
+.card {
+ display: flex;
+ padding: 1.25rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-lg);
+ background: var(--surface-base);
+ align-items: center;
+ gap: 1rem;
+}
+
+.stat-icon {
+ padding: 0.4rem;
+ border-radius: var(--radius-md);
+ background: var(--primary-bg);
+}
+
+.content {
+ display: flex;
+ flex-direction: column;
+}
+
+.value {
+ font-size: 1.5rem;
+ font-weight: 700;
+}
+
+.label {
+ font-size: 0.85rem;
+ color: var(--text-secondary);
+}
+</style>
diff --git a/frontend/app/components/Node/TOC/TOC.vue b/frontend/app/components/Node/TOC/TOC.vue
index 9d7e4b32..1599aae9 100644
--- a/frontend/app/components/Node/TOC/TOC.vue
+++ b/frontend/app/components/Node/TOC/TOC.vue
@@ -24,6 +24,8 @@ import type { Node } from '~/stores';
import type { TreeItem as NodeTreeItem } from '~/helpers/TreeBuilder';
const { t } = useI18nT();
+const nodesTree = useNodesTree();
+const childs = computed(() => nodesTree.getChildren(props.doc?.id).filter(c => c.data.role === 3)) as Ref<NodeTreeItem<Node>[]>;
const props = defineProps<{ element?: HTMLElement; doc?: Node }>();
const list = ref<HTMLElement>();
@@ -116,10 +118,6 @@ function updateActiveHeader() {
}
}
}
-
-const nodesTree = useNodesTree();
-
-const childs = computed(() => nodesTree.getChildren(props.doc?.id).filter(c => c.data.role === 3)) as Ref<NodeTreeItem<Node>[]>;
</script>
<style lang="scss" scoped>
diff --git a/frontend/app/components/Node/Team/Navbar.vue b/frontend/app/components/Node/Team/Navbar.vue
new file mode 100644
index 00000000..7c87672d
--- /dev/null
+++ b/frontend/app/components/Node/Team/Navbar.vue
@@ -0,0 +1,133 @@
+<template>
+ <nav class="subnav" aria-label="Team navigation">
+ <span class="subnav__item">
+ <NuxtLink :to="`/dashboard/teams/${teamId}`">
+ <Icon name="organization" />
+ <span>Overview</span>
+ </NuxtLink>
+ </span>
+ <span class="subnav__item">
+ <NuxtLink :to="`/dashboard/teams/${teamId}/nodes`">
+ <Icon name="nodes" />
+ <span>Nodes</span>
+ </NuxtLink>
+ </span>
+ <span v-if="isAdmin" class="subnav__item">
+ <NuxtLink :to="`/dashboard/teams/${teamId}/manage-members`">
+ <Icon name="users" />
+ <span>Members</span>
+ </NuxtLink>
+ </span>
+ <span class="subnav__item">
+ <NuxtLink :to="`/dashboard/teams/${teamId}/uploads`">
+ <Icon name="cdn" />
+ <span>Uploads</span>
+ </NuxtLink>
+ </span>
+ <span class="subnav__item">
+ <NuxtLink :to="`/dashboard/teams/${teamId}/insights`">
+ <Icon name="insights" />
+ <span>Insights</span>
+ </NuxtLink>
+ </span>
+ <span v-if="isEditor" class="subnav__item">
+ <NuxtLink :to="`/dashboard/teams/${teamId}/settings`">
+ <Icon name="settings" />
+ <span>Settings</span>
+ </NuxtLink>
+ </span>
+ </nav>
+</template>
+
+<script lang="ts" setup>
+const props = defineProps<{
+ teamId: string;
+}>();
+
+const store = useNodesStore();
+const team = computed(() => store.getById(props.teamId));
+
+const isAdmin = computed(() => {
+ if (!team.value) return false;
+ return store.hasPermissions(team.value, 3);
+});
+
+const isEditor = computed(() => {
+ if (!team.value) return false;
+ return store.hasPermissions(team.value, 2);
+});
+</script>
+
+<style lang="scss" scoped>
+/* ── Container ──────────────────────────────────────────────────── */
+.subnav {
+ display: flex;
+ padding: 0 2px;
+ align-items: stretch;
+ gap: 2px;
+ // Tabs sit on the border-bottom of the header
+ margin-bottom: -1px;
+}
+
+/* ── Individual tab ─────────────────────────────────────────────── */
+.subnav__item {
+ display: inline-flex;
+
+ a {
+ display: inline-flex;
+ height: 44px;
+ padding: 0 12px;
+ border-radius: var(--radius-sm) var(--radius-sm) 0 0;
+ font-size: 13.5px;
+ font-weight: 500;
+ color: var(--text-secondary);
+ transition:
+ background-color $transition-fast ease-in-out,
+ color $transition-fast ease-in-out,
+ border-color $transition-fast ease-in-out;
+ align-items: center;
+ border-bottom: 2px solid transparent;
+ gap: 7px;
+ white-space: nowrap;
+
+ &:hover {
+ color: var(--text-primary);
+ background-color: var(--surface-raised);
+ }
+ }
+
+ // Active tab
+ &:has(a.router-link-exact-active) a {
+ font-weight: 600;
+ color: var(--primary);
+ background-color: var(--surface-raised);
+ border-bottom-color: var(--primary);
+ }
+}
+
+/* ── Mobile vertical layout (driven by Navbar wrapper's :deep) ──── */
+@media (width <= 767px) {
+ .subnav {
+ padding: 6px 8px 10px;
+ flex-direction: column;
+ gap: 2px;
+ margin-bottom: 0;
+
+ // Reset the bottom-border tab style; use left accent instead
+ .subnav__item a {
+ width: 100%;
+ height: auto;
+ padding: 10px 14px;
+ border-radius: var(--radius-sm);
+ font-size: 15px;
+ border-bottom: none;
+ }
+
+ .subnav__item:has(a.router-link-exact-active) a {
+ border-bottom: none;
+ border-left: 3px solid var(--primary);
+ padding-left: 11px; // compensate for border
+ }
+ }
+}
+</style>
diff --git a/frontend/app/components/PDFViewer.vue b/frontend/app/components/PDFViewer.vue
index 709c5fcf..c6be1e2c 100644
--- a/frontend/app/components/PDFViewer.vue
+++ b/frontend/app/components/PDFViewer.vue
@@ -304,8 +304,6 @@ onBeforeUnmount(() => {
inset: 0;
overflow: clip;
text-size-adjust: none;
- text-size-adjust: none;
- text-size-adjust: none;
transform-origin: 0 0;
}
@@ -356,8 +354,6 @@ onBeforeUnmount(() => {
.textLayer span[role='img'] {
cursor: default;
user-select: none;
- user-select: none;
- user-select: none;
}
.textLayer .highlight {
@@ -380,7 +376,6 @@ onBeforeUnmount(() => {
border-radius: 4px;
background-color: var(--selection-color);
backdrop-filter: var(--highlight-backdrop-filter);
- backdrop-filter: var(--highlight-backdrop-filter);
}
.textLayer ::selection {
@@ -406,8 +401,6 @@ onBeforeUnmount(() => {
cursor: default;
inset: 100% 0 0;
user-select: none;
- user-select: none;
- user-select: none;
}
.textLayer.selecting .endOfContent {
diff --git a/frontend/app/components/Sidebar/Sidebar.vue b/frontend/app/components/Sidebar/Sidebar.vue
index 1454b11b..b2022241 100644
--- a/frontend/app/components/Sidebar/Sidebar.vue
+++ b/frontend/app/components/Sidebar/Sidebar.vue
@@ -43,7 +43,7 @@
</div>
</div>
</div>
- <SidebarWorkspaces :options="workspaces" />
+ <SidebarWorkspaces :workspaces="workspaces" :teams="teams" />
<CollapseItem v-for="item in navigationItems(sidebarItemsPrefs)" :key="item.id" :item="item" :root="true" />
<hr style="width: 100%; margin: 5px 0" />
@@ -58,7 +58,7 @@
</template>
<script setup lang="ts">
-import { navigationItems } from './helpers';
+import { navigationItems, type Workspace } from './helpers';
import { filterTreeByLabel } from '~/helpers/TreeBuilder';
import NewCategoryModal from '~/components/Node/Modals/CreateCategory.vue';
import SidebarSkeleton from './SidebarSkeleton.vue';
@@ -85,7 +85,19 @@ const sidebarItemsPrefs = preferences.get('sidebarItems');
const filter = ref<string>('');
-const workspaces = computed(() => [...nodesStore.getAll.filter(c => c.role === 1).map(c => ({ text: c.name, value: c.id, meta: c }))]);
+const teams: ComputedRef<Workspace[]> = computed(() => [...nodesStore.teams.map(c => ({ text: c.name, value: c.id, meta: c, children: [] }))]);
+const workspaces = computed(() => {
+ const items = [];
+ for (const workspace of nodesStore.workspaces) {
+ const parentTeam = teams.value.find(t => t.value === workspace.parent_id);
+ if (parentTeam) {
+ parentTeam.children!.push({ text: workspace.name, value: workspace.id, meta: workspace });
+ continue;
+ }
+ items.push({ text: workspace.name, value: workspace.id, meta: workspace });
+ }
+ return items;
+});
const isLoading = computed(() => nodesStore.isFetching);
const tree = computed(() => {
if (!filter.value.trim()) return filtered.value;
diff --git a/frontend/app/components/Sidebar/SidebarItem.vue b/frontend/app/components/Sidebar/SidebarItem.vue
index 582f6eb9..1fa28dcd 100644
--- a/frontend/app/components/Sidebar/SidebarItem.vue
+++ b/frontend/app/components/Sidebar/SidebarItem.vue
@@ -113,7 +113,7 @@ const drop = async (event: DragEvent) => {
const draggedItem = nodesStore.getById(draggedItemId);
if (!draggedItem) return;
-
+ // @ts-expect-error -1 is a special role for nav items, which are not real nodes
if (draggedItem.role === -1) return; // Prevent dropping nav items
if (props.item.data.role === 4) return; // Prevent dropping on resource items
if (draggedItem.id === props.item.id) return; // Prevent dropping on itself
diff --git a/frontend/app/components/Sidebar/SidebarWorkspace.vue b/frontend/app/components/Sidebar/SidebarWorkspace.vue
index 83a9e174..1a188ce5 100644
--- a/frontend/app/components/Sidebar/SidebarWorkspace.vue
+++ b/frontend/app/components/Sidebar/SidebarWorkspace.vue
@@ -6,6 +6,7 @@
</span>
<span>
<Icon v-if="option.meta?.shared" name="users" />
+ <Icon v-if="option.meta?.user_id === userStore.user?.id && option.meta?.role === 0" name="owner" />
</span>
</div>
</template>
@@ -14,6 +15,7 @@
import type { Workspace } from './helpers';
defineProps<{ option: Workspace }>();
+const userStore = useUserStore();
const { getAppAccent } = useAppColors();
</script>
diff --git a/frontend/app/components/Sidebar/SidebarWorkspaces.vue b/frontend/app/components/Sidebar/SidebarWorkspaces.vue
index 0150108d..8ab37ef8 100644
--- a/frontend/app/components/Sidebar/SidebarWorkspaces.vue
+++ b/frontend/app/components/Sidebar/SidebarWorkspaces.vue
@@ -14,12 +14,25 @@
</li>
<hr />
<span class="workspaces-label">{{ t('components.sidebar.workspaces') }}</span>
- <li v-for="option in options" :key="option.meta?.id" :class="{ selected: option.value === workspaceId }" @click="selectOption(option)">
+ <li v-for="option in workspaces" :key="option.meta?.id" :class="{ selected: option.value === workspaceId }" @click="selectOption(option)">
<SidebarWorkspace :option="option" />
</li>
- <div v-if="!options.length" class="placeholder">{{ t('components.sidebar.noWorkspaces') }}</div>
+ <div v-if="!workspaces.length" class="placeholder">{{ t('components.sidebar.noWorkspaces') }}</div>
+ <hr />
+ <span class="workspaces-label">Teams</span>
+ <li
+ v-for="option in flattenedWorkspaces"
+ :key="option.meta?.id"
+ :class="{ selected: option.value === workspaceId }"
+ :style="{ paddingLeft: `${(option.depth ?? 0) * 16 + 4}px` }"
+ @click="selectOption(option)"
+ >
+ <SidebarWorkspace :option="option" />
+ </li>
+ <div v-if="!teams.length" class="placeholder">No teams found</div>
<hr />
<div class="new-workspace" @click="createWorkspace"><Icon name="plus" fill="var(--text-secondary)" /> {{ t('components.sidebar.newWorkspace') }}</div>
+ <div class="new-workspace" @click="joinWorkspace"><Icon name="link" fill="var(--text-secondary)" /> {{ t('components.sidebar.joinWorkspace') }}</div>
<NuxtLink :to="`/dashboard/categories/${selectedOption.value}/edit`" class="new-workspace">
<Icon name="settings" fill="var(--text-secondary)" /> {{ t('components.sidebar.editWorkspace') }}
</NuxtLink>
@@ -29,25 +42,33 @@
<script setup lang="ts">
import SidebarWorkspace from './SidebarWorkspace.vue';
import NewCategoryModal from '~/components/Node/Modals/CreateCategory.vue';
+import JoinModal from '~/components/Node/Modals/Join.vue';
import type { Workspace } from './helpers';
-const props = defineProps<{ options: Workspace[] }>();
+const props = defineProps<{ workspaces: Workspace[]; teams: Workspace[] }>();
const { t } = useI18nT();
const { workspaceId } = useSidebar();
const modals = useModal();
+const router = useRouter();
const isOpen = ref(false);
const allWorkspaces = computed(() => ({ text: t('components.sidebar.allWorkspaces'), value: undefined, meta: { color: -1 } }));
const sharedWorkspaces = computed(() => ({ text: t('components.sidebar.sharedWithMe'), value: 'shared', meta: { color: -1, icon: 'users' } }));
-const selectedOption = computed(() => [...props.options, sharedWorkspaces.value].find(option => option.value == workspaceId.value) || allWorkspaces.value);
+const selectedOption = computed(
+ () => [...props.workspaces, ...flattenedWorkspaces.value, sharedWorkspaces.value].find(option => option.value == workspaceId.value) || allWorkspaces.value,
+);
+const flattenWorkspaces = (workspaces: Workspace[], depth = 0): Workspace[] => {
+ return workspaces.flatMap(workspace => [{ ...workspace, depth }, ...(workspace.children ? flattenWorkspaces(workspace.children, depth + 1) : [])]);
+};
+const flattenedWorkspaces = computed(() => flattenWorkspaces(props.teams));
watch(
- () => props.options,
+ () => props.workspaces,
opts => {
const storage_item = localStorage.getItem('filterWorkspace');
- if (storage_item && [...opts, sharedWorkspaces.value].find(option => option.value == storage_item)) {
+ if (storage_item && [...opts, ...flattenedWorkspaces.value, sharedWorkspaces.value].find(option => option.value == storage_item)) {
workspaceId.value = storage_item;
}
},
@@ -57,12 +78,15 @@ watch(
// Actions
const createWorkspace = () => modals.add(new Modal(shallowRef(NewCategoryModal), { props: { role: 1 } }));
+const joinWorkspace = () => modals.add(new Modal(shallowRef(JoinModal)));
+
const toggleDropdown = () => (isOpen.value = !isOpen.value);
const closeDropdown = () => (isOpen.value = false);
const selectOption = (option: Workspace) => {
workspaceId.value = option.value;
+ if (option.meta?.role === 0) router.push('/dashboard/teams/' + option.value);
if (option.value) localStorage.setItem('filterWorkspace', option.value);
else localStorage.removeItem('filterWorkspace');
};
@@ -70,6 +94,7 @@ const handleClickOutside = (event: MouseEvent) => {
if (!(event.target as HTMLElement)!.closest('.dropdown-container')) closeDropdown();
};
+// Lifecycle hooks
onMounted(() => document.addEventListener('click', handleClickOutside));
onBeforeUnmount(() => document.removeEventListener('click', handleClickOutside));
</script>
diff --git a/frontend/app/components/Sidebar/helpers.ts b/frontend/app/components/Sidebar/helpers.ts
index f28a8935..fad2cfe1 100644
--- a/frontend/app/components/Sidebar/helpers.ts
+++ b/frontend/app/components/Sidebar/helpers.ts
@@ -43,6 +43,8 @@ export interface Workspace {
meta?: Partial<Node>;
text: string;
value?: string;
+ depth?: number;
+ children?: Workspace[];
}
const { isMobile } = useDevice();
export const navigationItems = (sidebarItemsPrefs?: Preferences['sidebarItems']): DefaultItem[] => [
@@ -78,6 +80,22 @@ export const navigationItems = (sidebarItemsPrefs?: Preferences['sidebarItems'])
route: '/dashboard/categories',
show: computed(() => sidebarItemsPrefs?.manageCategories ?? true),
},
+ {
+ data: {
+ icon: 'organization',
+ id: 'teams',
+ name: 'components.sidebar.nav.teams',
+ permissions: [],
+ role: -1,
+ shared: false,
+ },
+ icon: 'organization',
+ id: 'teams',
+ label: 'components.sidebar.nav.teams',
+ parent_id: '',
+ route: '/dashboard/teams',
+ show: computed(() => true),
+ },
{
data: {
icon: 'cdn',
diff --git a/frontend/app/components/ThemeToggle.vue b/frontend/app/components/ThemeToggle.vue
index b93fed0b..49728ef7 100644
--- a/frontend/app/components/ThemeToggle.vue
+++ b/frontend/app/components/ThemeToggle.vue
@@ -1,33 +1,4 @@
-<template>
- <button style="background: none" @click="toggleColorMode">
- <svg v-if="colorMode.value === 'light'" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
- <g stroke-width="0" />
- <g stroke-linecap="round" stroke-linejoin="round" />
- <g>
- <path
- d="M12 3V4M12 20V21M4 12H3M6.31412 6.31412L5.5 5.5M17.6859 6.31412L18.5 5.5M6.31412 17.69L5.5 18.5001M17.6859 17.69L18.5 18.5001M21 12H20M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z"
- stroke="#000000"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- />
- </g>
- </svg>
- <svg v-else-if="colorMode.value === 'dark'" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#fff">
- <g stroke-width="0" />
- <g stroke-linecap="round" stroke-linejoin="round" />
- <g>
- <path
- d="M3.32031 11.6835C3.32031 16.6541 7.34975 20.6835 12.3203 20.6835C16.1075 20.6835 19.3483 18.3443 20.6768 15.032C19.6402 15.4486 18.5059 15.6834 17.3203 15.6834C12.3497 15.6834 8.32031 11.654 8.32031 6.68342C8.32031 5.50338 8.55165 4.36259 8.96453 3.32996C5.65605 4.66028 3.32031 7.89912 3.32031 11.6835Z"
- stroke="#fff"
- stroke-width="2"
- stroke-linecap="round"
- stroke-linejoin="round"
- />
- </g>
- </svg>
- </button>
-</template>
+<template><AppBtnIcon :icon="colorMode.value === 'light' ? 'theme_light' : 'theme_dark'" fill @click="toggleColorMode" /></template>
<script setup lang="ts">
const colorMode = useColorMode();
@@ -43,10 +14,3 @@ const toggleColorMode = () => {
document.body.style.colorScheme = colorMode.preference;
};
</script>
-
-<style scoped lang="scss">
-svg {
- width: 25px;
- height: 25px;
-}
-</style>
diff --git a/frontend/app/components/Trending.vue b/frontend/app/components/Trending.vue
new file mode 100644
index 00000000..8a21c11b
--- /dev/null
+++ b/frontend/app/components/Trending.vue
@@ -0,0 +1,62 @@
+<template>
+ <article v-if="stats.length >= 2" class="chart-card">
+ <svg viewBox="0 0 100 40" preserveAspectRatio="none" class="sparkline" role="img" aria-label="Nodes monthly growth chart">
+ <polyline :points="points" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" vector-effect="non-scaling-stroke" />
+ </svg>
+ <ul class="month-row">
+ <li v-for="item in stats" :key="`nodes-${item.month}`">{{ formatMonth(item.month) }}</li>
+ </ul>
+ </article>
+ <article v-else class="chart-card">
+ <p>Not enough data to display insights. Please add more nodes to this team or come back later to see the insights.</p>
+ </article>
+</template>
+
+<script setup lang="ts">
+import type { MonthlyCount } from '~/stores';
+
+const props = defineProps<{
+ stats: MonthlyCount[];
+}>();
+
+function formatMonth(month: string): string {
+ const monthIndex = Number(month) - 1;
+ const parsed = new Date(Date.UTC(Number(new Date().getFullYear()), monthIndex, 1));
+ return parsed.toLocaleDateString(undefined, { month: 'short' });
+}
+
+const points = computed(() => toPolyline(props.stats));
+
+function toPolyline(series: MonthlyCount[]): string {
+ if (!series?.length) return '0,40 100,40';
+ const values = series.map(item => Math.max(0, item.count ?? 0));
+ const max = Math.max(...values, 1);
+ return values
+ .map((value, index) => {
+ const x = (index / Math.max(values.length - 1, 1)) * 100;
+ const y = 40 - (value / max) * 34 - 3;
+ return `${x.toFixed(2)},${y.toFixed(2)}`;
+ })
+ .join(' ');
+}
+</script>
+
+<style scoped>
+.sparkline {
+ width: 100%;
+ height: 120px;
+ color: var(--primary);
+}
+
+.month-row {
+ display: grid;
+ margin: 0;
+ padding: 0;
+ font-size: 0.72rem;
+ color: var(--text-muted);
+ text-align: center;
+ gap: 0.2rem;
+ grid-template-columns: repeat(12, minmax(0, 1fr));
+ list-style: none;
+}
+</style>
diff --git a/frontend/app/composables/useBreadcrumbs.ts b/frontend/app/composables/useBreadcrumbs.ts
index 689c3896..03b4eaf3 100644
--- a/frontend/app/composables/useBreadcrumbs.ts
+++ b/frontend/app/composables/useBreadcrumbs.ts
@@ -1,6 +1,7 @@
import type { NodeRole } from '~/stores';
const ROUTE_ROLE_MAPPING: Record<NodeRole, string> = {
+ 0: '/dashboard/teams',
1: '/dashboard/categories',
2: '/dashboard/categories',
3: '/dashboard/docs',
@@ -8,15 +9,15 @@ const ROUTE_ROLE_MAPPING: Record<NodeRole, string> = {
};
export function useBreadcrumbs() {
- const nodesStore = useNodesStore();
+ const nodesTree = useNodesTree();
function generateBreadcrumbsById(id: string) {
- const nodes = nodesStore.getByIdWithParents(id);
+ const nodes = nodesTree.getAncestors(id);
return nodes
.map(node => ({
- name: node.name,
- path: `${ROUTE_ROLE_MAPPING[node.role]}/${node.id}`,
+ name: node.label,
+ path: `${ROUTE_ROLE_MAPPING[node.data.role]}/${node.id}`,
}))
.reverse();
}
diff --git a/frontend/app/composables/useNodesTree.ts b/frontend/app/composables/useNodesTree.ts
index d42d2aac..ff8c59ae 100644
--- a/frontend/app/composables/useNodesTree.ts
+++ b/frontend/app/composables/useNodesTree.ts
@@ -2,9 +2,9 @@
* Nodes Tree Composable
* Single source of truth for the hierarchical node structure
*/
-import type { Node } from '~/stores';
-import { TreeBuilder, type TreeItem } from '~/helpers/TreeBuilder';
+import { TreeBuilder, flattenTree, type TreeItem } from '~/helpers/TreeBuilder';
import { resolveIcon, resolveNodeLink } from '~/helpers/node';
+import type { Node } from '~/stores';
// ============================================================================
// Collapse States (localStorage persistence)
@@ -70,6 +70,36 @@ const collapseStore = createCollapseStore();
// Main Composable
// ============================================================================
+let globalBuilder: ComputedRef<TreeBuilder<Node>> | null = null;
+let globalTree: ComputedRef<TreeItem<Node>[]> | null = null;
+
+function initGlobalTree() {
+ const nodesStore = useNodesStore();
+
+ if (!globalBuilder) {
+ console.log('[useNodesTree] 🏗️ Building global TreeBuilder');
+ globalBuilder = computed(() => {
+ const _ = nodesStore.getAll.size; // Trigger reactivity on nodesStore.getAll
+ const rawCollection = toRaw(nodesStore.nodes);
+ return new TreeBuilder<Node>(rawCollection, transformNode);
+ });
+ }
+
+ if (!globalTree) {
+ console.log('[useNodesTree] 🌳 Building global tree');
+ globalTree = computed(() => {
+ return globalBuilder!.value.buildTree({
+ rootFilter: node => {
+ if (node?.role === 0) return false;
+ if (node?.role === 1 && !nodesStore.getById(node.parent_id ?? '')) return true;
+ if (!nodesStore.getById(node.parent_id ?? '')) return true;
+ return false;
+ },
+ });
+ });
+ }
+}
+
/** Transform Node to TreeItem */
function transformNode(node: Node): Omit<TreeItem<Node>, 'children'> {
return {
@@ -81,51 +111,69 @@ function transformNode(node: Node): Omit<TreeItem<Node>, 'children'> {
data: node,
};
}
-
export function useNodesTree() {
const nodesStore = useNodesStore();
- // Sorted nodes
- const sortedNodes = computed(() => nodesStore.nodes.toArray().sort((a, b) => (a.order ?? 0) - (b.order ?? 0) || a.name.localeCompare(b.name)));
+ initGlobalTree();
- // Tree builder instance (recreated when nodes change)
- const builder = computed(() => new TreeBuilder(sortedNodes.value, transformNode));
+ const builder = globalBuilder!;
+ const tree = globalTree!;
- // Full tree
- const tree = computed(() => {
- const tree = builder.value.buildTree(node => node?.role === 1);
- return tree;
- });
-
- const treeUpToRole = (maxRole: number) =>
+ const getTreeUpToRole = (maxRole: number) =>
computed(() => {
- const filtered = sortedNodes.value.filter(n => n.role <= maxRole);
- return new TreeBuilder(filtered, transformNode).buildTree(node => node?.role === 1);
+ return builder.value.buildTree({
+ nodeFilter: node => node.role <= maxRole,
+ rootFilter: node => {
+ if (node.role === 0) return true;
+ if (node.role === 1 && !nodesStore.getById(node.parent_id ?? '')) return true;
+ return false;
+ },
+ });
});
- // === Filtered views ===
- const workspaceTree = (workspaceId?: string): TreeItem<Node>[] => {
+ // Workspace-specific tree retrieval
+ const getWorkspaceTree = (workspaceId?: string, fullTree: boolean = false): TreeItem<Node>[] => {
if (!workspaceId) return tree.value;
if (workspaceId === 'shared') {
return tree.value.filter(item => item.data?.shared);
}
- const workspace = tree.value.find(item => item.id === workspaceId);
- if (!workspace) return tree.value;
- return (workspace?.children as TreeItem<Node>[]) ?? [];
+
+ const subtree = builder.value.buildSubtree(workspaceId);
+ if (fullTree) return subtree ? [subtree] : [];
+ return (subtree?.children as TreeItem<Node>[]) ?? [];
};
- // === Get subtree as flat array ===
- const getSubtreeAsArray = (id: string): TreeItem<Node>[] => {
+ // Subtree retrieval as flat array
+ const getSubtreeAsArray = (id?: string): TreeItem<Node>[] => {
+ if (!id) return flattenTree(tree.value);
const subtree = builder.value.buildSubtree(id);
- return subtree?.children ? builder.value.flatten(subtree.children as TreeItem<Node>[]) : [];
+ return subtree?.children ? flattenTree(subtree.children as TreeItem<Node>[]) : [];
};
- // === Navigation ===
- const getAncestorCategory = (nodeId?: string | null): TreeItem<Node> | null => {
+ // Get ancestors of a node as TreeItems[]
+ const getAncestors = (fromNodeId?: string): TreeItem<Node>[] => {
+ const node = builder.value.getTransformedItem(fromNodeId ?? '');
+ if (!node) return [];
+
+ const result = [node];
+ let current = node;
+ while (current.parentId) {
+ const parentNode = nodesStore.nodes.get(current.parentId);
+ if (!parentNode) break;
+ const transformed = builder.value.getTransformedItem(parentNode.id)!;
+ result.push(transformed);
+ current = transformed;
+ }
+ return result;
+ };
+
+ // Get the first ancestor that is a category (role 1 or 2)
+ const getClosestCategoryAncestor = (nodeId?: string | null): TreeItem<Node> | null => {
if (!nodeId) return null;
- let current = builder.value.get(nodeId);
+
+ let current = builder.value.getTransformedItem(nodeId);
while (current?.parentId) {
- const parent = builder.value.get(current.parentId);
+ const parent = builder.value.getTransformedItem(current.parentId);
if (parent && (parent.data?.role === 1 || parent.data?.role === 2)) {
return parent;
}
@@ -137,7 +185,7 @@ export function useNodesTree() {
const nextDocument = (id?: string) => (id ? builder.value.getSibling(id, 'next', n => n?.role === 3)?.data : undefined);
const prevDocument = (id?: string) => (id ? builder.value.getSibling(id, 'prev', n => n?.role === 3)?.data : undefined);
- // === Get children of a node ===
+ // Get children of a node (descendants) as TreeItems[]
const getChildren = (parentId?: string | null): TreeItem<Node>[] => {
return builder.value.getChildren(parentId ?? null);
};
@@ -145,10 +193,11 @@ export function useNodesTree() {
return {
// Tree data
tree,
- treeUpToRole,
- workspaceTree,
+ getTreeUpToRole,
+ getWorkspaceTree,
getSubtreeAsArray,
- getAncestorCategory,
+ getAncestors,
+ getClosestCategoryAncestor,
getChildren,
builder,
diff --git a/frontend/app/composables/useSidebar.ts b/frontend/app/composables/useSidebar.ts
index 9b145021..d40ef615 100644
--- a/frontend/app/composables/useSidebar.ts
+++ b/frontend/app/composables/useSidebar.ts
@@ -20,7 +20,7 @@ export function useSidebar() {
// Filtered tree based on current workspace and preferences
const filtered = computed((): TreeItem<Node>[] => {
- const items = nodesTree.workspaceTree(workspaceId.value);
+ const items = nodesTree.getWorkspaceTree(workspaceId.value);
if (!preferences.get('displayUncategorizedResources').value) {
return items.filter(item => item.data.role !== 4);
}
diff --git a/frontend/app/helpers/IndexedCollection.ts b/frontend/app/helpers/IndexedCollection.ts
new file mode 100644
index 00000000..c8344a88
--- /dev/null
+++ b/frontend/app/helpers/IndexedCollection.ts
@@ -0,0 +1,145 @@
+import type { Node } from '~/stores/db_structures';
+
+export class IndexedCollection {
+ // Unique storage for nodes, indexed by ID
+ private store = new Map<string, Node>();
+
+ // Index
+ private byParent = new Map<string, string[]>();
+ private byRole = new Map<number, string[]>();
+ private sortedArray: Node[] = [];
+
+ // Flag to indicate bulk loading mode (to avoid unnecessary sorting during batch operations)
+ private isBulkLoading = false;
+
+ get size(): number {
+ return this.store.size;
+ }
+
+ get(id: string): Node | undefined {
+ return this.store.get(id);
+ }
+
+ has(id: string): boolean {
+ return this.store.has(id);
+ }
+
+ /**
+ * Access O(1) to children of a parent
+ */
+ getChildrenIds(parentId: string | null | undefined): string[] {
+ return this.byParent.get(parentId ?? '') ?? [];
+ }
+
+ /**
+ * Access O(1) to nodes by role
+ */
+ getIdsByRole(role: number): string[] {
+ return this.byRole.get(role) ?? [];
+ }
+
+ /**
+ * Access O(1) to nodes up to a certain role (inclusive)
+ */
+ getIdsUpToRole(maxRole: number): string[] {
+ const ids: string[] = [];
+ for (let role = 0; role <= maxRole; role++) {
+ ids.push(...this.getIdsByRole(role));
+ }
+ return ids;
+ }
+
+ /**
+ * Return pre-sorted array of nodes for iteration
+ */
+ toSortedArray(): readonly Node[] {
+ return this.sortedArray;
+ }
+
+ set(id: string, node: Node): void {
+ const oldNode = this.store.get(id);
+
+ // If the node structure hasn't changed, we can skip the re-indexing
+ if (oldNode && oldNode.parent_id === node.parent_id && oldNode.role === node.role && oldNode.name === node.name && oldNode.order === node.order) {
+ this.store.set(id, node);
+ // Update the sorted array in place if the node's order or name has changed
+ const idx = this.sortedArray.findIndex(n => n.id === id);
+ if (idx !== -1) this.sortedArray[idx] = node;
+ return;
+ }
+
+ // Clean up old indexes if the node already exists
+ if (oldNode) {
+ this.removeFromIndexes(id, oldNode);
+ }
+
+ // Add the new node to the store
+ this.store.set(id, node);
+
+ // Build indexes for parent and role
+ const pId = node.parent_id ?? '';
+ if (!this.byParent.has(pId)) this.byParent.set(pId, []);
+ this.byParent.get(pId)!.push(id);
+
+ if (!this.byRole.has(node.role)) this.byRole.set(node.role, []);
+ this.byRole.get(node.role)!.push(id);
+
+ if (!this.isBulkLoading) {
+ this.rebuildSortedArray();
+ }
+ }
+
+ delete(id: string): boolean {
+ const node = this.store.get(id);
+ if (!node) return false;
+
+ this.removeFromIndexes(id, node);
+ this.store.delete(id);
+
+ if (!this.isBulkLoading) this.rebuildSortedArray();
+ return true;
+ }
+
+ clear(): void {
+ this.store.clear();
+ this.byParent.clear();
+ this.byRole.clear();
+ this.sortedArray = [];
+ }
+
+ forEach(callback: (node: Node, id: string) => void): void {
+ this.store.forEach(callback);
+ }
+
+ // Bulk operations to optimize performance when adding/removing multiple nodes
+ startBulk() {
+ this.isBulkLoading = true;
+ }
+ endBulk() {
+ this.isBulkLoading = false;
+ this.rebuildSortedArray();
+ }
+
+ // Internal helper to remove a node from the indexes
+ private removeFromIndexes(id: string, node: Node) {
+ const pId = node.parent_id ?? '';
+ const parentArr = this.byParent.get(pId);
+ if (parentArr) {
+ const idx = parentArr.indexOf(id);
+ if (idx !== -1) parentArr.splice(idx, 1);
+ }
+
+ const roleArr = this.byRole.get(node.role);
+ if (roleArr) {
+ const idx = roleArr.indexOf(id);
+ if (idx !== -1) roleArr.splice(idx, 1);
+ }
+ }
+
+ /*
+ Builds the sorted array of nodes based on their order and name.
+ */
+ private rebuildSortedArray() {
+ this.sortedArray = Array.from(this.store.values()).sort((a, b) => (a.order ?? 0) - (b.order ?? 0) || a.name.localeCompare(b.name));
+ }
+}
diff --git a/frontend/app/helpers/TreeBuilder.ts b/frontend/app/helpers/TreeBuilder.ts
index 71f67226..0de49230 100644
--- a/frontend/app/helpers/TreeBuilder.ts
+++ b/frontend/app/helpers/TreeBuilder.ts
@@ -1,20 +1,5 @@
-/**
- * TreeBuilder - Pure utility class for tree operations
- * No reactivity, no side effects - just data transformation
- */
-
-/** Base tree node interface */
-export interface TreeNode<T = unknown, id = string> {
- id: id;
- parentId?: string | null;
- label: string;
- data: T;
- children?: TreeNode<T>[];
-}
-
-/** Extended tree item with routing and display properties */
-export interface TreeItem<T = unknown> {
- id: string;
+export interface TreeItem<T = unknown, ID = string> {
+ id: ID;
parentId?: string | null;
label: string;
data: T;
@@ -23,82 +8,132 @@ export interface TreeItem<T = unknown> {
children?: TreeItem<T>[];
onClick?: () => void;
}
-
-/**
- * Builds and manages tree structures from flat arrays
- * Uses Maps for O(1) lookups
- */
-export class TreeBuilder<T extends { id: string; parent_id?: string | null }> {
- private readonly items: TreeItem<T>[];
- private readonly itemMap: Map<string, TreeItem<T>>;
- private readonly childrenMap: Map<string, TreeItem<T>[]>;
+export interface ReadonlyIndexedCollection<T> {
+ size: number;
+ get(id: string): T | undefined;
+ getChildrenIds(parentId: string | null | undefined): string[];
+}
+export class TreeBuilder<T extends { id: string; parent_id?: string | null; role?: number; order?: number }> {
+ private transformCache = new Map<string, TreeItem<T>>();
constructor(
- sourceItems: T[],
+ private readonly collection: ReadonlyIndexedCollection<T>,
private readonly transform: (item: T) => Omit<TreeItem<T>, 'children'>,
- ) {
- this.items = sourceItems.map(item => this.transform(item) as TreeItem<T>);
- this.itemMap = new Map(this.items.map(item => [item.id, item]));
- this.childrenMap = new Map();
-
- for (const item of this.items) {
- const parentId = item.parentId ?? '';
- if (!this.childrenMap.has(parentId)) {
- this.childrenMap.set(parentId, []);
- }
- this.childrenMap.get(parentId)!.push(item);
+ ) {}
+
+ /**
+ * Transforme un nœud pur en item UI de manière isolée et le met en cache
+ */
+ public getTransformedItem(id: string): TreeItem<T> | undefined {
+ if (this.transformCache.has(id)) {
+ return this.transformCache.get(id);
}
- }
- /** Get item by ID */
- get(id: string): TreeItem<T> | undefined {
- return this.itemMap.get(id);
- }
+ const rawNode = this.collection.get(id) as T;
+ if (!rawNode) return undefined;
+
+ const item: TreeItem<T> = {
+ ...this.transform(rawNode),
+ children: [],
+ };
- /** Get children of a parent */
- getChildren(parentId?: string | null): TreeItem<T>[] {
- return this.childrenMap.get(parentId ?? '') ?? [];
+ this.transformCache.set(id, item);
+ return item;
}
- /** Build complete tree from roots */
- buildTree(isRoot: (item?: T) => boolean = item => !item?.parent_id): TreeItem<T>[] {
- return this.items
- .filter(item => isRoot(item.data) || !this.itemMap.has(item.parentId ?? ''))
- .map(root => this.buildSubtree(root.id))
- .filter((item): item is TreeItem<T> => item !== undefined);
+ /**
+ * Build the direct children of a given parentId
+ */
+ getChildren(parentId: string | null): TreeItem<T>[] {
+ const childrenIds = this.collection.getChildrenIds(parentId);
+ const result: TreeItem<T>[] = [];
+ for (const childId of childrenIds) {
+ const item = this.getTransformedItem(childId);
+ if (item) result.push(item);
+ }
+ return result;
}
- /** Build subtree from a specific node */
- buildSubtree(id: string, visited = new Set<string>()): TreeItem<T> | undefined {
- const item = this.itemMap.get(id);
- if (!item || visited.has(id)) return undefined;
+ /**
+ * Build the entire descending tree recursively, starting from the roots
+ * @param options Optional filters for nodes and roots
+ * @returns An array of TreeItem representing the tree structure
+ */
+ buildTree(options?: { nodeFilter?: (node: T) => boolean; rootFilter?: (node: T) => boolean }): TreeItem<T>[] {
+ const rootIds = this.collection.getChildrenIds(null);
- visited.add(id);
- const children = this.getChildren(id)
- .map(child => this.buildSubtree(child.id, new Set(visited)))
- .filter((c): c is TreeItem<T> => c !== undefined);
+ const buildSubtree = (id: string): TreeItem<T> | undefined => {
+ const rawNode = this.collection.get(id) as T;
+ if (!rawNode) return undefined;
+
+ if (options?.nodeFilter && !options.nodeFilter(rawNode)) {
+ return undefined;
+ }
- return { ...item, children: children.length ? children : undefined };
+ const item = this.getTransformedItem(id);
+ if (!item) return undefined;
+
+ const childrenIds = this.collection.getChildrenIds(id);
+ if (childrenIds.length > 0) {
+ item.children = childrenIds.map(childId => buildSubtree(childId)).filter((c): c is TreeItem<T> => !!c); // On élimine les enfants filtrés
+ } else {
+ item.children = undefined;
+ }
+ return item;
+ };
+
+ return rootIds
+ .filter(id => {
+ const node = this.collection.get(id) as T;
+ if (!node) return false;
+ if (options?.rootFilter && !options.rootFilter(node)) return false;
+ return true;
+ })
+ .map(id => buildSubtree(id))
+ .filter((item): item is TreeItem<T> => !!item);
}
- /** Flatten a tree back to array */
- flatten(tree: TreeItem<T>[]): TreeItem<T>[] {
- const result: TreeItem<T>[] = [];
- const stack: TreeItem<T>[] = [...tree];
- while (stack.length) {
- const node = stack.pop()!;
- result.push(node);
- if (node.children) stack.push(...(node.children as TreeItem<T>[]));
- }
- return result;
+ /**
+ * Build a subtree starting from a specific parentId, recursively
+ */
+ buildSubtree(parentId: string): TreeItem<T> | undefined {
+ const buildSubtreeRecursive = (id: string): TreeItem<T> | undefined => {
+ const cachedItem = this.getTransformedItem(id);
+ if (!cachedItem) return undefined;
+
+ const childrenIds = this.collection.getChildrenIds(id);
+ if (childrenIds.length === 0) {
+ return { ...cachedItem, children: undefined };
+ }
+
+ const validChildren: TreeItem<T>[] = [];
+ for (let i = 0; i < childrenIds.length; i++) {
+ const child = buildSubtreeRecursive(childrenIds[i]!);
+ if (child) validChildren.push(child);
+ }
+
+ if (validChildren.length > 1) {
+ validChildren.sort((a, b) => (a.data.order ?? 0) - (b.data.order ?? 0));
+ }
+
+ return {
+ ...cachedItem,
+ children: validChildren.length > 0 ? validChildren : undefined,
+ };
+ };
+
+ return buildSubtreeRecursive(parentId);
}
- /** Get next/previous sibling for navigation */
+ /**
+ * Get the next or previous sibling of a node, optionally filtered by a predicate
+ */
getSibling(id: string, direction: 'next' | 'prev', filter?: (item?: T) => boolean): TreeItem<T> | undefined {
- const item = this.itemMap.get(id);
- if (!item) return undefined;
+ const currentItem = this.getTransformedItem(id);
+ if (!currentItem) return undefined;
- let siblings = this.getChildren(item.parentId);
+ // On récupère instantanément les frères via le parent commun
+ let siblings = this.getChildren(currentItem.parentId ?? null);
if (filter) siblings = siblings.filter(s => filter(s.data));
const index = siblings.findIndex(s => s.id === id);
@@ -108,9 +143,8 @@ export class TreeBuilder<T extends { id: string; parent_id?: string | null }> {
return siblings[targetIndex];
}
}
-
/** Filter tree recursively, keeping branches with matches */
-export function filterTree<T extends TreeNode<unknown>>(items: T[], predicate: (item: T) => boolean): T[] {
+export function filterTree<T extends TreeItem<unknown>>(items: T[], predicate: (item: T) => boolean): T[] {
const result: T[] = [];
for (const item of items) {
const filteredChildren = item.children ? filterTree(item.children as T[], predicate) : [];
@@ -121,8 +155,25 @@ export function filterTree<T extends TreeNode<unknown>>(items: T[], predicate: (
return result;
}
-/** Filter tree by label (case-insensitive) */
-export function filterTreeByLabel<T extends TreeNode>(items: T[], query: string): T[] {
+export function filterTreeByLabel<T extends TreeItem>(items: T[], query: string): T[] {
const lowerQuery = query.toLowerCase();
return filterTree(items, item => item.label.toLowerCase().includes(lowerQuery));
}
+
+/**
+ * Flatten a tree structure into a flat array of TreeItems, preserving the order
+ * @param items The tree structure to flatten
+ * @returns A flat array of TreeItems
+ */
+export function flattenTree<T>(items: TreeItem<T>[]): TreeItem<T>[] {
+ const result: TreeItem<T>[] = [];
+ const stack = [...items].reverse();
+ while (stack.length > 0) {
+ const node = stack.pop()!;
+ result.push(node);
+ if (node.children) {
+ stack.push(...[...node.children].reverse());
+ }
+ }
+ return result;
+}
diff --git a/frontend/app/helpers/node.ts b/frontend/app/helpers/node.ts
index 241f12e8..7a9f1f86 100644
--- a/frontend/app/helpers/node.ts
+++ b/frontend/app/helpers/node.ts
@@ -1,12 +1,13 @@
/**
- * Node utilities - centralized helpers for working with nodes (documents, categories, workspaces, resources)
- * Roles: 1 = Workspace, 2 = Category, 3 = Document, 4 = Resource
+ * Node utilities - centralized helpers for working with nodes (documents, categories, workspaces, teams, resources)
+ * Roles: 0 = Team, 1 = Workspace, 2 = Category, 3 = Document, 4 = Resource
*/
import type { DB_Node, Node, NodeSearchResult } from '~/stores';
/** Resolve the appropriate icon for a node based on its role and properties */
export const resolveIcon = (item: Node | DB_Node | NodeSearchResult): string => {
if (item.icon) return item.icon;
+ if (item.role === 0) return 'organization';
if (item.role === 1) return 'workspace';
if (item.role === 2 && 'shared' in item) return item.shared ? 'shared_folder' : 'folder';
if (item.role === 3) return item.accessibility == 1 ? 'sidebar/file' : item.accessibility == 2 ? 'draft' : 'shared_doc';
@@ -23,6 +24,7 @@ export const resolveIcon = (item: Node | DB_Node | NodeSearchResult): string =>
/** Get the dashboard route for a node */
export const resolveNodeLink = (node: Node): string => {
+ if (node.role === 0) return `/dashboard/teams/${node.id}`;
if (node.role === 1 || node.role === 2) return `/dashboard/categories/${node.id}`;
if (node.role === 3) return `/dashboard/docs/${node.id}`;
if (node.role === 4) return `/dashboard/cdn/${node.id}/preview`;
@@ -31,16 +33,22 @@ export const resolveNodeLink = (node: Node): string => {
export const getRoleName = (role?: number): string => {
if (role === undefined) return 'Node';
- const roles: Record<number, string> = { 1: 'Workspace', 2: 'Category', 3: 'Document', 4: 'Resource' };
+ const roles: Record<number, string> = { 0: 'Team', 1: 'Workspace', 2: 'Category', 3: 'Document', 4: 'Resource' };
return roles[role] || 'Unknown';
};
/** Get human-readable type name for a node */
export const resolveNodeType = (node: Node): string => {
- const types: Record<number, string> = { 1: 'Workspace', 2: 'Category', 3: 'Document', 4: 'Resource' };
+ const types: Record<number, string> = { 0: 'Team', 1: 'Workspace', 2: 'Category', 3: 'Document', 4: 'Resource' };
return types[node.role] || '';
};
+/** Get the name of the permission level */
+const permissions: Record<number, string> = { 1: 'Viewer', 2: 'Editor', 3: 'Admin' };
+export const resolvePermissionName = (permission: number): string => {
+ return permissions[permission] || 'Unknown';
+};
+
/** Resolve color for a resource-node based on its type */
export const resolveNodeColor = (type: string) =>
type.includes('image') ? 'green' : type.includes('video') ? 'blue' : type.includes('pdf') ? 'yellow' : 'red';
diff --git a/frontend/app/pages/dashboard/admin/users/index.vue b/frontend/app/pages/dashboard/admin/users/index.vue
index f1c219d3..68273510 100644
--- a/frontend/app/pages/dashboard/admin/users/index.vue
+++ b/frontend/app/pages/dashboard/admin/users/index.vue
@@ -16,8 +16,8 @@ import { useAdminStore } from '~/stores/admin.store';
import type { User } from '~/stores';
const adminStore = useAdminStore();
-const { t } = useI18nT();
+const { t } = useI18nT();
const { avatarURL } = useApi();
const { numericDate } = useDateFormatters();
diff --git a/frontend/app/pages/dashboard/categories/[id]/edit.vue b/frontend/app/pages/dashboard/categories/[id]/edit.vue
index 264db968..06f559be 100644
--- a/frontend/app/pages/dashboard/categories/[id]/edit.vue
+++ b/frontend/app/pages/dashboard/categories/[id]/edit.vue
@@ -1,7 +1,11 @@
<template>
<div class="page-card">
- <h1 style="font-size: 24px">{{ t('nodes.category.editTitle') }}</h1>
+ <Teleport to="#navbar-title">{{ t('nodes.category.editTitle') }}</Teleport>
<form v-if="category" @submit.prevent>
+ <Teleport to="#navbar-actions">
+ <AppBtnIcon nav icon="delete" :tooltip="t('common.actions.delete')" @click="deleteCategory" />
+ <AppBtnIcon nav icon="save" :tooltip="t('common.actions.update')" @click="updateCategory" />
+ </Teleport>
<div class="form-row">
<div class="form-column">
<label>{{ t('common.labels.name') }}</label>
@@ -34,11 +38,6 @@
<label for="color">{{ t('common.labels.color') }}</label>
<AppColorPicker v-model="category.color" name="color" nullable />
-
- <div class="actions-row">
- <AppButton type="danger" @click="deleteCategory()">{{ t('common.actions.delete') }}</AppButton>
- <AppButton type="primary" class="btn primary" @click="updateCategory">{{ t('common.actions.update') }}</AppButton>
- </div>
</form>
</div>
</template>
@@ -59,7 +58,7 @@ const route = useRoute();
const router = useRouter();
const category = computed(() => nodesStore.getById(route.params.id as string));
-const categoriesItem = nodesTree.treeUpToRole(2);
+const categoriesItem = nodesTree.getTreeUpToRole(2);
// Actions
const updateCategory = async () => {
@@ -116,8 +115,4 @@ label {
min-width: 200px;
flex: 1;
}
-
-.actions-row {
- justify-content: flex-end;
-}
</style>
diff --git a/frontend/app/pages/dashboard/categories/[id]/index.vue b/frontend/app/pages/dashboard/categories/[id]/index.vue
index 8d45dfcf..6b39a2d9 100644
--- a/frontend/app/pages/dashboard/categories/[id]/index.vue
+++ b/frontend/app/pages/dashboard/categories/[id]/index.vue
@@ -14,6 +14,7 @@ definePageMeta({
});
const nodesStore = useNodesStore();
+const nodesTree = useNodesTree();
const modals = useModal();
const route = useRoute();
@@ -26,7 +27,10 @@ watchEffect(() => {
});
const nodes = computed(() => {
- return nodesStore.getAllChildrens(parent.value?.id || '').filter(d => d.role == 3);
+ return nodesTree
+ .getSubtreeAsArray(parent.value?.id || '')
+ .filter(d => d.data.role === 3)
+ .map(c => c.data);
});
const openDeleteModal = () => {
diff --git a/frontend/app/pages/dashboard/categories/index.vue b/frontend/app/pages/dashboard/categories/index.vue
index 3b92abe3..8996373d 100644
--- a/frontend/app/pages/dashboard/categories/index.vue
+++ b/frontend/app/pages/dashboard/categories/index.vue
@@ -1,15 +1,15 @@
<template>
<div class="page-card">
- <header>
- <h1>{{ t('nodes.container.title') }}</h1>
- <div class="actions-row">
- <AppButton type="primary" @click="createWorkspace">{{ t('nodes.container.newWorkspace') }}</AppButton>
- <AppButton type="primary" @click="createCategory">{{ t('nodes.container.newCategory') }}</AppButton>
- <NuxtLink to="/dashboard/import"
- ><AppButton type="secondary" variant="outline">{{ t('nodes.container.import') }}</AppButton></NuxtLink
- >
- </div>
- </header>
+ <Teleport to="#navbar-title"><Icon name="categories" display="lg" />{{ t('nodes.container.title') }}</Teleport>
+
+ <Teleport to="#navbar-actions">
+ <AppButton type="primary" @click="createWorkspace">{{ t('nodes.container.newWorkspace') }}</AppButton>
+ <AppButton type="primary" @click="createCategory">{{ t('nodes.container.newCategory') }}</AppButton>
+ <NuxtLink to="/dashboard/import">
+ <AppButton type="secondary" variant="outline">{{ t('nodes.container.import') }}</AppButton>
+ </NuxtLink>
+ </Teleport>
+
<div style="padding-bottom: 10px">
<input v-model="filter" :placeholder="t('nodes.container.searchPlaceholder')" />
</div>
@@ -39,7 +39,7 @@ const router = useRouter();
const filter = ref('');
const filteredItems = computed(() => {
- const items = nodesTree.treeUpToRole(2).value;
+ const items = nodesTree.getTreeUpToRole(2).value;
if (!filter.value.trim()) return items;
return filterTreeByLabel(items, filter.value);
});
diff --git a/frontend/app/pages/dashboard/cdn/[id]/index.vue b/frontend/app/pages/dashboard/cdn/[id]/index.vue
index 92461d20..dc777a13 100644
--- a/frontend/app/pages/dashboard/cdn/[id]/index.vue
+++ b/frontend/app/pages/dashboard/cdn/[id]/index.vue
@@ -1,11 +1,11 @@
<template>
<div class="page-card">
- <header>
- <h1>{{ t('cdn.edit.title') }}</h1>
- <NuxtLink :to="`/dashboard/cdn/${resource?.id}/preview`" class="btn-icon">
- <AppButton type="secondary">Preview</AppButton>
- </NuxtLink>
- </header>
+ <Teleport to="#navbar-title">{{ t('cdn.edit.title') }}</Teleport>
+ <Teleport to="#navbar-actions">
+ <AppBtnIcon nav icon="eye" :tooltip="t('common.actions.preview')" :to="`/dashboard/cdn/${resource?.id}/preview`" />
+ <AppBtnIcon nav icon="save" :tooltip="t('common.actions.update')" @click="updateCategory" />
+ <AppBtnIcon nav icon="delete" :tooltip="t('common.actions.delete')" @click="openDeleteModal" />
+ </Teleport>
<p>{{ t('cdn.edit.description') }}</p>
<form v-if="resource" @submit.prevent>
<div class="form-row">
@@ -32,10 +32,6 @@
Resource:
<a :href="resourceURL(resource)" target="_blank">{{ resourceURL(resource) }}</a>
</p>
- <div class="actions-row">
- <AppButton type="primary" class="btn primary" @click="updateCategory">{{ t('common.actions.update') }}</AppButton>
- <AppButton type="danger" @click="openDeleteModal">{{ t('common.actions.delete') }}</AppButton>
- </div>
</form>
</div>
</template>
@@ -55,7 +51,7 @@ const notifications = useNotifications();
const route = useRoute();
const router = useRouter();
-const nodesTree = useNodesTree().treeUpToRole(3);
+const nodesTree = useNodesTree().getTreeUpToRole(3);
const resource = computed(() => nodeStore.getById(route.params.id as string));
// Actions
@@ -92,20 +88,10 @@ onUnmounted(() => {
</script>
<style scoped lang="scss">
-h2 {
- font-size: 26px;
-}
-
label {
margin-top: 10px;
}
-input,
-textarea,
-select {
- width: 100%;
-}
-
.form-row {
display: flex;
flex-wrap: wrap;
@@ -121,8 +107,4 @@ a {
color: var(--primary);
text-decoration: underline;
}
-
-.actions-row {
- justify-content: flex-end;
-}
</style>
diff --git a/frontend/app/pages/dashboard/cdn/[id]/preview.vue b/frontend/app/pages/dashboard/cdn/[id]/preview.vue
index 48e88195..eba4136e 100644
--- a/frontend/app/pages/dashboard/cdn/[id]/preview.vue
+++ b/frontend/app/pages/dashboard/cdn/[id]/preview.vue
@@ -1,32 +1,17 @@
<template>
<div class="page-card">
<template v-if="resource">
- <header>
- <h1>{{ t('cdn.preview.title') }} <tag orange>Beta</tag> • {{ resource.name }}</h1>
- <div class="actions-row">
- <AppSelect v-if="isPdfFile(mimeType)" v-model="zoom" :items="PDF_SCALES" :searchable="false" label="Scale" style="width: 200px" />
- <NuxtLink :to="`/dashboard/cdn/${resource.id}`" class="btn-icon">
- <Icon name="edit" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.edit') }}</p>
- </NuxtLink>
- <button v-if="resource.metadata?.drawio" class="btn-icon" @click="openDrawioEditor">
- <Icon name="format/diagrams" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.edit') }}</p>
- </button>
- <span class="btn-icon" @click="copyLink">
- <Icon name="copy" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.copyLink') }}</p>
- </span>
- <NuxtLink :href="resourceURL(resource, true)" download rel="noopener" class="btn-icon">
- <Icon name="download" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.download') }}</p>
- </NuxtLink>
- <button class="btn-icon" @click="openDeleteModal">
- <Icon name="delete" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.delete') }}</p>
- </button>
- </div>
- </header>
+ <Teleport to="#navbar-title"
+ >{{ t('cdn.preview.title') }} • <span class="page-subtitle">{{ resource.name }}</span></Teleport
+ >
+ <Teleport to="#navbar-actions">
+ <AppSelect v-if="isPdfFile(mimeType)" v-model="zoom" :items="PDF_SCALES" :searchable="false" label="Scale" style="width: 200px" />
+ <AppBtnIcon nav icon="edit" :to="`/dashboard/cdn/${resource.id}`" :tooltip="t('common.actions.edit')" />
+ <AppBtnIcon v-if="resource.metadata?.drawio" nav icon="format/diagrams" :tooltip="t('common.actions.edit')" @click="openDrawioEditor" />
+ <AppBtnIcon nav icon="copy" :tooltip="t('common.actions.copyLink')" @click="copyLink" />
+ <AppBtnIcon nav :href="resourceURL(resource, true)" download icon="download" :tooltip="t('common.actions.download')" />
+ <AppBtnIcon nav icon="delete" :tooltip="t('common.actions.delete')" @click="openDeleteModal" />
+ </Teleport>
<div ref="previewElement" class="preview">
<object v-if="resource.metadata?.drawio" :data="resourceURL(resource)" alt="Preview" />
<img v-else-if="isImageFile(mimeType)" :src="resourceURL(resource)" alt="Preview" />
@@ -105,16 +90,6 @@ onUnmounted(() => {
});
</script>
<style scoped lang="scss">
-.btn-icon {
- position: relative;
- margin: 0 1px;
-
- &:hover .hint-tooltip {
- opacity: 1;
- visibility: visible;
- }
-}
-
header {
display: flex;
align-items: center;
diff --git a/frontend/app/pages/dashboard/cdn/diagram.vue b/frontend/app/pages/dashboard/cdn/diagram.vue
index a1116dd7..68a068ba 100644
--- a/frontend/app/pages/dashboard/cdn/diagram.vue
+++ b/frontend/app/pages/dashboard/cdn/diagram.vue
@@ -1,17 +1,15 @@
<template>
<div class="drawio-editor-modal">
+ <Teleport to="#navbar-title">{{ t('cdn.diagram') }}</Teleport>
<aside>
<input v-model="node.name" type="text" :placeholder="t('common.labels.name')" />
-
- <button class="btn-icon" @click="requestSaveDiagram">
- <Icon name="save" display="lg" />
- <p class="hint-tooltip">{{ t('common.actions.save') }}</p>
- </button>
+ <Teleport to="#navbar-actions">
+ <AppBtnIcon nav icon="save" :tooltip="t('common.actions.save')" @click="requestSaveDiagram" />
+ </Teleport>
</aside>
<div class="drawio-content">
<iframe :key="iframeKey" ref="iframe" class="drawio-iframe" :src="iframeUrl" />
-
<div v-if="!isReady" class="loading-overlay">
<LoaderSpinner />
<p>{{ t('common.status.loading') }}</p>
@@ -43,15 +41,16 @@ function requestSaveDiagram() {
});
}
-function postMessageToIframe(msg: object) {
+const postMessageToIframe = (msg: object) => {
if (!iframe.value?.contentWindow) return;
iframe.value.contentWindow.postMessage(JSON.stringify(msg), '*');
-}
+};
const exitHandleMessage = async (e: MessageEvent) => {
const result = await handleMessage(e, node.value.name);
if (result) router.push(`/dashboard/cdn`);
};
+// Lifecycle hooks
onMounted(() => window.addEventListener('message', exitHandleMessage));
onBeforeUnmount(() => window.removeEventListener('message', exitHandleMessage));
diff --git a/frontend/app/pages/dashboard/cdn/index.vue b/frontend/app/pages/dashboard/cdn/index.vue
index 0ea08bb1..22f9e7b3 100644
--- a/frontend/app/pages/dashboard/cdn/index.vue
+++ b/frontend/app/pages/dashboard/cdn/index.vue
@@ -1,387 +1,3 @@
<template>
- <div class="page-card">
- <header>
- <h1>{{ t('cdn.meta.title') }}</h1>
- <div class="action-row">
- <NodeFilter v-show="!device.isMobile" :nodes="nodes" @update:nodes="filteredResources = $event" />
- <ViewSelection v-model="view" />
- </div>
- </header>
- <div class="storage-indicator">
- <div class="storage-info">
- <span class="storage-label">{{ t('cdn.storageUsed') }}</span>
- <span class="storage-values">{{ readableFileSize(totalUsedSpace) }} / {{ readableFileSize(MAX_STORAGE) }}</span>
- </div>
- <div class="progress-bar">
- <div
- class="progress-fill"
- :style="{ width: storagePercentage + '%' }"
- :class="{ warning: storagePercentage > 80, danger: storagePercentage > 95 }"
- ></div>
- </div>
- <span class="storage-percentage">{{ storagePercentage.toFixed(1) }}%</span>
- </div>
- <AppDrop ref="dropComponent" multiple :max-files="10" @select="selectFiles" />
- <div style="display: flex; width: 100%; padding: 12px 0; align-items: center; flex-direction: column; gap: 10px">
- <AppButton type="primary" :disabled="!selectedFiles.length" @click="submitFiles">
- {{ selectedFiles.length ? t('cdn.actions.upload.multiple', { n: selectedFiles.length }) : t('cdn.actions.upload.idle') }}
- </AppButton>
- <div v-if="isLoading" class="upload-progress">
- <LoaderSpinner />
- <span>{{ t('cdn.actions.upload.progress', { n: uploadProgress.current, total: uploadProgress.total }) }}</span>
- </div>
- </div>
- <div v-if="fileLinks.length" class="link-section">
- <div class="links-text" v-text="linksText"></div>
- <div class="links-actions">
- <AppButton type="primary" @click="copyLinks">{{ t('common.actions.copy') }} {{ fileLinks.length > 1 ? 'links' : 'link' }}</AppButton>
- <AppButton type="secondary" @click="fileLinks = []">{{ t('common.actions.clear') }}</AppButton>
- </div>
- </div>
- <div v-if="filteredResources.length" class="resources-list">
- <DataTable v-if="view === 'table'" :headers="headers" :rows="rows">
- <template #bulk-actions="{ selected }">
- <div class="bulk-actions">
- <span class="selected-count">{{ selected.length }}</span>
- <span style="height: 32px; border-left: 1px solid var(--border); margin-left: 4px"></span>
- <span @click="bulkDelete(selected)"><Icon name="delete" fill="var(--text-secondary)" class="action-btn" /></span>
- </div>
- </template>
- <template #action="{ cell }">
- <NuxtLink :href="`/dashboard/cdn/${(cell?.data as Node).id}/preview`" style="margin-right: 10px"><Icon name="view" /> </NuxtLink>
- <NuxtLink :to="`/dashboard/cdn/${(cell?.data as Node).id}`"><Icon name="edit" style="margin-right: 10px" /></NuxtLink>
- <span @click="() => deleteResource(cell?.data as Node)"><Icon name="delete" /></span>
- </template>
- </DataTable>
- <div v-else>
- <hr />
- <div class="images-grid">
- <div
- v-for="image in filteredResources"
- :key="image.id"
- class="image-item"
- @click="router.push(`/dashboard/cdn/${image.id}/preview`)"
- @contextmenu="event => openContextMenu(event, image)"
- >
- <img :src="resolvePreviewUrl(image)" :alt="image.name" class="image-preview" />
- <div class="image-info">
- <span class="image-name">{{ image.name }}</span>
- <span class="image-size">{{ readableFileSize(image.size ?? 0) }}</span>
- </div>
- </div>
- <div v-if="!filteredResources.length" class="not-found">
- <p>{{ t('common.search.noResults', { filter: filter }) }}</p>
- </div>
- </div>
- </div>
- </div>
- <NoContent v-else :title="t('cdn.page.empty')"></NoContent>
- </div>
+ <NodeResourceCDN />
</template>
-<script setup lang="ts">
-import ResourceContextMenu from '~/components/Node/Action/ResourceContextMenu.vue';
-import DeleteNodeModal from '~/components/Node/Modals/Delete.vue';
-import { readableFileSize, resolvePreviewUrl } from '~/helpers/resources';
-import { resolveNodeColor } from '~/helpers/node';
-import type { Field } from '~/components/DataTable.vue';
-import type { Node } from '~/stores';
-
-const nodesStore = useNodesStore();
-const resourcesStore = useResourcesStore();
-
-const router = useRouter();
-const { t } = useI18nT();
-const device = useDevice();
-const appColors = useAppColors();
-const { numericDate } = useDateFormatters();
-const contextMenu = useContextMenu();
-const { resourceURL } = useApi();
-const modals = useModal();
-const notifications = useNotifications();
-
-const view = ref<'list' | 'table'>('list');
-const selectedFiles = ref<File[]>([]);
-const fileLinks = ref<string[]>([]);
-const isLoading = ref(false);
-const uploadProgress = ref({ current: 0, total: 0 });
-const dropComponent = ref();
-const filter = ref('');
-
-const MAX_STORAGE = 1024 * 1024 * 1024; // 1 GB in bytes
-
-const nodes = computed(() => nodesStore.resources.toArray());
-const filteredResources = ref(nodes.value);
-
-const totalUsedSpace = computed(() => nodesStore.getTotalUsedStorage);
-const storagePercentage = computed(() => Math.min((totalUsedSpace.value / MAX_STORAGE) * 100, 100));
-const linksText = computed(() => fileLinks.value.join('\n'));
-
-// DataTable setup
-const headers = [
- { key: 'name', label: t('common.labels.name') },
- { key: 'size', label: t('common.labels.size') },
- { key: 'type', label: t('common.labels.type') },
- { key: 'parent', label: t('common.labels.parent') },
- { key: 'date', label: t('common.labels.date') },
- { key: 'action', label: t('common.labels.action') },
-];
-
-const rows: ComputedRef<Field[]> = computed(() =>
- filteredResources.value.map(res => {
- const parent = res.parent_id ? nodesStore.getById(res.parent_id) : null;
- const category = parent ? nodesStore.getById(parent.parent_id || '') : null;
- return {
- action: { data: res, type: 'slot' },
- date: { content: numericDate(res.created_timestamp), type: 'text' },
- name: { content: res.name, type: 'text' },
- parent: { content: category ? `<tag class="${appColors.getAppAccent(category.color)}">${parent?.name}</tag>` : '', type: 'html' },
- size: { content: readableFileSize(res.size ?? 0), type: 'text' },
- type: { content: `<tag class="${resolveNodeColor(res.metadata?.filetype || '')}">${res.metadata?.filetype || ''}</tag>`, type: 'html' },
- };
- }),
-);
-
-// Actions
-const selectFiles = (files: File | File[] | null) => {
- if (Array.isArray(files)) {
- selectedFiles.value = files;
- } else if (files) {
- selectedFiles.value = [files];
- }
-};
-
-const openContextMenu = (event: MouseEvent, node: Node) => {
- if (!node) return;
- contextMenu.open(shallowRef(ResourceContextMenu), event, {
- props: { node: node },
- });
-};
-
-const copyLinks = () => navigator.clipboard.writeText(fileLinks.value.join('\n'));
-
-const submitFiles = async () => {
- if (!selectedFiles.value.length) return;
- isLoading.value = true;
- fileLinks.value = [];
- uploadProgress.value = { current: 0, total: selectedFiles.value.length };
-
- const filesToUpload = [...selectedFiles.value];
- selectedFiles.value = [];
- dropComponent.value.reset();
-
- for (const file of filesToUpload) {
- const body = new FormData();
- body.append('file', file);
- try {
- const r = await resourcesStore.post(body);
- fileLinks.value.push(resourceURL(r));
- } catch (e) {
- notifications.add({ message: t('cdn.notifications.error', { error: e, file: file.name }), title: 'Error', type: 'error' });
- }
- uploadProgress.value.current++;
- }
-
- isLoading.value = false;
- if (fileLinks.value.length) {
- notifications.add({
- message: t('cdn.notifications.successMsg', { n: fileLinks.value.length }),
- title: t('cdn.notifications.successTitle'),
- type: 'success',
- });
- }
-};
-
-const deleteResource = async (node: Node) => {
- modals.add(new Modal(shallowRef(DeleteNodeModal), { props: { node: node, redirectTo: '/dashboard/cdn' }, size: 'small' }));
-};
-const bulkDelete = async (lines: Field[]) => {
- const resources = lines.map(line => line.action?.data as Node);
- modals.add(new Modal(shallowRef(DeleteNodeModal), { props: { nodes: resources, redirectTo: '/dashboard/cdn' }, size: 'small' }));
-};
-</script>
-
-<style scoped lang="scss">
-.storage-indicator {
- display: flex;
- width: 100%;
- margin: 12px 0;
- padding: 12px 16px;
- border-radius: var(--radius-md);
- align-items: center;
- gap: 12px;
-
- .storage-info {
- display: flex;
- min-width: 180px;
- flex-direction: column;
- gap: 2px;
-
- .storage-label {
- font-size: 12px;
- color: var(--text-secondary);
- }
-
- .storage-values {
- font-size: 14px;
- font-weight: 600;
- color: var(--text-primary);
- }
- }
-
- .progress-bar {
- height: 8px;
- border-radius: var(--radius-xs);
- background: var(--surface-transparent);
- flex: 1;
- overflow: hidden;
-
- .progress-fill {
- height: 100%;
- border-radius: var(--radius-xs);
- background: var(--primary);
- transition: width $transition-medium ease;
-
- &.warning {
- background: #f59e0b;
- }
-
- &.danger {
- background: #ef4444;
- }
- }
- }
-
- .storage-percentage {
- min-width: 50px;
- font-size: 13px;
- font-weight: 500;
- color: var(--text-secondary);
- text-align: right;
- }
-}
-
-.action-row {
- display: flex;
- align-items: center;
-}
-
-.upload-progress {
- display: flex;
- font-size: 14px;
- color: var(--text-secondary);
- align-items: center;
- gap: 10px;
-}
-
-.link-section {
- display: flex;
- width: 100%;
- margin: 6px 0;
- flex-direction: column;
- gap: 10px;
-
- .links-text {
- width: 100%;
- padding: 10px;
- border: 1px solid var(--border);
- border-radius: var(--radius-sm);
- font-family: $font-mono;
- font-size: 13px;
- color: var(--text-primary);
- white-space: pre-wrap;
- word-break: break-all;
- }
-
- .links-actions {
- display: flex;
- gap: 10px;
- }
-}
-
-.bulk-actions {
- display: flex;
- width: 100%;
- align-items: center;
- gap: 8px;
-}
-
-.action-btn {
- cursor: pointer;
-
- &:hover {
- background: var(--surface-transparent);
- }
-}
-
-.selected-count {
- display: flex;
- width: 32px;
- height: 34px;
- padding: 4px;
- border: 1px solid var(--border);
- border-radius: var(--radius-xs);
- font-size: 12px;
- font-weight: bold;
- color: var(--text-secondary);
- align-items: center;
- justify-content: center;
-}
-
-.resources-list {
- width: 100%;
-}
-
-.not-found {
- color: var(--text-secondary);
- text-align: center;
- grid-column: 1 / -1;
-}
-
-.images-grid {
- display: grid;
- padding: 16px 0;
- flex: 1;
- gap: 16px;
- grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
-}
-
-.image-item {
- border: 2px solid transparent;
- border-radius: var(--radius-md);
- cursor: pointer;
-
- &:hover {
- border-color: var(--primary);
- box-shadow: var(--shadow-lg);
- transform: translateY(-2px);
- }
-
- .image-preview {
- width: 100%;
- height: 150px;
- border-radius: var(--radius-sm);
- object-fit: cover;
- }
-
- .image-info {
- padding: 12px;
-
- .image-name {
- display: block;
- font-size: 14px;
- font-weight: 500;
- color: var(--text-primary);
- margin-bottom: 4px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .image-size {
- display: block;
- font-size: 12px;
- color: var(--text-secondary);
- }
- }
-}
-</style>
diff --git a/frontend/app/pages/dashboard/docs/edit/[id].vue b/frontend/app/pages/dashboard/docs/edit/[id].vue
index 140319c5..c791cea9 100644
--- a/frontend/app/pages/dashboard/docs/edit/[id].vue
+++ b/frontend/app/pages/dashboard/docs/edit/[id].vue
@@ -9,6 +9,7 @@ definePageMeta({ breadcrumb: { i18n: 'common.actions.edit' } });
const store = useNodesStore();
const route = useRoute();
+const router = useRouter();
const nodeId = route.params.id as string;
const node = ref<Node | undefined>(undefined);
@@ -33,5 +34,10 @@ const save = (doc: Node) => {
.catch(e => notifications.add({ message: e, title: 'Error', type: 'error' }));
};
const autoSave = (doc: Node) => store.update(doc);
-const exit = () => useRouter().push(`/dashboard/docs/${nodeId}`);
+
+const exit = () => {
+ const redirect = route.query.redirect as string | undefined;
+ if (redirect) router.push(redirect);
+ else router.push(`/dashboard/docs/${nodeId}`);
+};
</script>
diff --git a/frontend/app/pages/dashboard/home.vue b/frontend/app/pages/dashboard/home.vue
index 030decc7..d0833443 100644
--- a/frontend/app/pages/dashboard/home.vue
+++ b/frontend/app/pages/dashboard/home.vue
@@ -1,149 +1,125 @@
<template>
<div class="home-container">
- <!-- Header with greeting and quick actions -->
- <header class="home-header">
- <div class="greeting">
- <h1>{{ t('dashboard.greeting', { userName }) }}</h1>
- <p class="subtitle">
- {{ todayFormatted }} · {{ documentsCount }} {{ t('dashboard.stats.documents') }} · {{ workspacesCount }} {{ t('dashboard.stats.workspaces') }}
- </p>
- </div>
- <div class="quick-actions">
- <AppButton type="primary" @click="createNewDocument">{{ t('dashboard.actions.newDocument') }}</AppButton>
- </div>
- </header>
-
- <!-- Quick search bar -->
- <div class="search-section">
- <div class="search-wrapper" :class="{ focused: isSearchFocused }">
- <Icon name="search" class="search-icon" />
- <input
- v-model="searchQuery"
- type="text"
- :placeholder="t('dashboard.search')"
- class="search-input"
- @focus="isSearchFocused = true"
- @blur="isSearchFocused = false"
- />
- <div v-if="searchQuery" class="search-clear" @click="searchQuery = ''">
- <Icon name="close" />
+ <Teleport to="#navbar-title"> {{ t('dashboard.dashboard') }}</Teleport>
+
+ <section class="home-top">
+ <header class="home-header">
+ <div class="greeting">
+ <h1>{{ t('dashboard.greeting', { userName }) }}</h1>
+ <p class="subtitle">
+ {{ todayFormatted }} · {{ documentsCount }} {{ t('dashboard.stats.documents') }} · {{ workspacesCount }} {{ t('dashboard.stats.workspaces') }}
+ </p>
</div>
- </div>
- <Transition name="dropdown">
- <div v-if="searchResults?.length" class="search-results">
- <NuxtLink v-for="result in searchResults" :key="result.id" class="search-result" :to="getNodeLink(result)">
- <Icon :name="resolveIcon(result)" :class="['node-icon', getAppAccent(result.color as number, true)]" />
- <div class="result-content">
- <span class="result-name">{{ result.name }}</span>
- <span class="result-path">{{ getNodePath(result) }}</span>
- </div>
- <span class="result-type">{{ getNodeType(result) }}</span>
- </NuxtLink>
+ <div class="quick-actions">
+ <AppButton type="primary" @click="createNewDocument">{{ t('dashboard.actions.newDocument') }}</AppButton>
+ <AppButton type="secondary" @click="openJoinModal"><Icon name="join" display="sm" /> {{ t('dashboard.actions.joinWorkspace') }}</AppButton>
</div>
- </Transition>
- </div>
-
- <!-- Section "Continue Working" -->
- <section v-if="recentlyEdited.length" class="section">
- <div class="section-header">
- <h2><Icon name="work" />{{ t('dashboard.sections.continueWorking') }}</h2>
- <NuxtLink to="/dashboard/docs" class="see-all">{{ t('dashboard.links.seeAll') }}</NuxtLink>
- </div>
- <div class="continue-working">
- <NuxtLink v-for="doc in recentlyEdited" :key="doc.id" :to="`/dashboard/docs/${doc.id}`">
- <NodeCardRecent :node="doc" />
- </NuxtLink>
- </div>
- </section>
-
- <!-- Section Pinned Documents -->
- <section v-if="pinnedDocuments.length" class="section">
- <div class="section-header">
- <h2><Icon name="pin" /> {{ t('dashboard.sections.pinnedDocuments') }}</h2>
- </div>
- <div class="pinned-grid">
- <NuxtLink v-for="doc in pinnedDocuments" :key="doc.id" :to="`/dashboard/docs/${doc.id}`">
- <NodeCardRecent :node="doc" />
- </NuxtLink>
- </div>
- </section>
-
- <!-- Workspaces Section -->
- <section class="section">
- <div class="section-header">
- <h2><Icon name="workspace" /> {{ t('dashboard.sections.yourWorkspaces') }}</h2>
- <NuxtLink to="/dashboard/categories" class="see-all">{{ t('dashboard.links.manage') }}</NuxtLink>
- </div>
- <div class="workspaces-grid">
- <NuxtLink v-for="workspace in workspaces" :key="workspace.id" :to="`/dashboard/categories/${workspace.id}`">
- <NodeCardWorkspace :workspace="workspace" />
- </NuxtLink>
- <button class="add-workspace" @click="openCreateWorkspace">{{ t('dashboard.actions.newWorkspace') }}</button>
- </div>
- </section>
-
- <!-- Recent Activity Section -->
- <section class="section">
- <div class="section-header">
- <h2><Icon name="recent" /> {{ t('dashboard.sections.recentActivity') }}</h2>
- </div>
- <div class="activity-timeline">
- <div v-for="(group, date) in activityByDate" :key="date" class="activity-group">
- <div class="activity-date">{{ date }}</div>
- <div class="activity-items">
- <NuxtLink v-for="item in group" :key="item.id" :to="getNodeLink(item)" class="activity-item">
- <Icon
- :name="resolveIcon(item)"
- display="md"
- :class="['activity-icon', getAppAccent(item.color || (getCategory(item.parent_id)?.color as number), true)]"
- />
- <div class="activity-content">
- <span class="activity-name">{{ item.name }}</span>
- <span class="activity-time">{{ formatTime(item.updated_timestamp) }}</span>
+ </header>
+
+ <!-- Quick search bar -->
+ <div class="search-section">
+ <div class="search-wrapper" :class="{ focused: isSearchFocused }">
+ <Icon name="search" class="search-icon" />
+ <input
+ v-model="searchQuery"
+ type="text"
+ :placeholder="t('dashboard.search')"
+ class="search-input"
+ @focus="isSearchFocused = true"
+ @blur="isSearchFocused = false"
+ />
+ <div v-if="searchQuery" class="search-clear" @click="searchQuery = ''">
+ <Icon name="close" />
+ </div>
+ </div>
+ <Transition name="dropdown">
+ <div v-if="searchResults?.length" class="search-results">
+ <NuxtLink v-for="result in searchResults" :key="result.id" class="search-result" :to="resolveNodeLink(result)">
+ <Icon :name="resolveIcon(result)" :class="['node-icon', getAppAccent(result.color as number, true)]" />
+ <div class="result-content">
+ <span class="result-name">{{ result.name }}</span>
+ <span class="result-path">{{ getNodePath(result) }}</span>
</div>
+ <span class="result-type">{{ resolveNodeType(result) }}</span>
</NuxtLink>
</div>
- </div>
+ </Transition>
</div>
</section>
- <!-- Quick stats -->
- <section class="section stats-section">
- <div class="stat-card">
- <Icon name="files" display="xxl" class="stat-icon" fill="var(--primary)" />
- <div class="stat-content">
- <span class="stat-value">{{ documentsCount }}</span>
- <span class="stat-label">{{ t('dashboard.stats.documents') }}</span>
+ <div class="sections">
+ <!-- Section "Continue Working" -->
+ <section v-if="recentlyEdited.length" class="section">
+ <div class="section-header">
+ <h2><Icon name="work" />{{ t('dashboard.sections.continueWorking') }}</h2>
</div>
- </div>
- <div class="stat-card">
- <Icon name="categories" display="xxl" class="stat-icon" fill="var(--primary)" />
- <div class="stat-content">
- <span class="stat-value">{{ workspacesCount }}</span>
- <span class="stat-label">{{ t('dashboard.stats.workspaces') }}</span>
+ <div class="continue-working">
+ <NuxtLink v-for="doc in recentlyEdited" :key="doc.id" :to="`/dashboard/docs/${doc.id}`">
+ <NodeCardRecent :node="doc" />
+ </NuxtLink>
</div>
- </div>
- <div class="stat-card">
- <Icon name="advanced" display="xxl" class="stat-icon" fill="var(--primary)" />
- <div class="stat-content">
- <span class="stat-value">{{ tagsCount }}</span>
- <span class="stat-label">{{ t('dashboard.stats.tags') }}</span>
+ </section>
+
+ <!-- Section Pinned Documents -->
+ <section v-if="pinnedDocuments.length" class="section">
+ <div class="section-header">
+ <h2><Icon name="pin" /> {{ t('dashboard.sections.pinnedDocuments') }}</h2>
</div>
- </div>
- <div class="stat-card">
- <Icon name="import" display="xxl" class="stat-icon" fill="var(--primary)" />
- <div class="stat-content">
- <span class="stat-value">{{ resourcesCount }}</span>
- <span class="stat-label">{{ t('dashboard.stats.cdnFiles') }}</span>
+ <div class="pinned-grid">
+ <NuxtLink v-for="doc in pinnedDocuments" :key="doc.id" :to="`/dashboard/docs/${doc.id}`">
+ <NodeCardRecent :node="doc" />
+ </NuxtLink>
</div>
- </div>
- </section>
+ </section>
+
+ <!-- Workspaces Section -->
+ <section class="section">
+ <div class="section-header">
+ <h2><Icon name="workspace" /> {{ t('dashboard.sections.yourWorkspaces') }}</h2>
+ </div>
+ <div class="workspaces-grid">
+ <NuxtLink v-for="workspace in workspaces" :key="workspace.id" :to="`/dashboard/categories/${workspace.id}`">
+ <NodeCardWorkspace :workspace="workspace" />
+ </NuxtLink>
+ <button class="add-workspace" @click="openCreateWorkspace">{{ t('dashboard.actions.newWorkspace') }}</button>
+ </div>
+ </section>
+
+ <!-- Recent Activity Section -->
+ <section class="section">
+ <div class="section-header">
+ <h2><Icon name="recent" /> {{ t('dashboard.sections.recentActivity') }}</h2>
+ </div>
+ <div class="activity-timeline">
+ <div v-for="(group, date) in activityByDate" :key="date" class="activity-group">
+ <div class="activity-date">{{ date }}</div>
+ <div class="activity-items">
+ <NuxtLink v-for="item in group" :key="item.id" :to="resolveNodeLink(item)" class="activity-item">
+ <Icon
+ :name="resolveIcon(item)"
+ display="md"
+ :class="['activity-icon', getAppAccent(item.color || (getCategory(item.parent_id)?.color as number), true)]"
+ />
+ <div class="activity-content">
+ <span class="activity-name">{{ item.name }}</span>
+ <span class="activity-time">{{ formatTime(item.updated_timestamp) }}</span>
+ </div>
+ </NuxtLink>
+ </div>
+ </div>
+ </div>
+ </section>
+
+ <!-- Quick stats -->
+ <NodeStats />
+ </div>
</div>
</template>
<script setup lang="ts">
import { resolveIcon, resolveNodeLink, resolveNodeType } from '~/helpers/node';
import CreateCategoryModal from '~/components/Node/Modals/CreateCategory.vue';
+import NodeJoin from '~/components/Node/Modals/Join.vue';
import type { Node } from '~/stores';
definePageMeta({ breadcrumb: { i18n: 'dashboard.pages.home' } });
@@ -165,38 +141,31 @@ const isSearchFocused = ref(false);
const userName = computed(() => userStore.user?.firstname || userStore.user?.username || '');
// Stats
-const documentsCount = computed(() => nodesStore.documents.size);
-const workspacesCount = computed(() => nodesStore.getAll.filter(n => n.role === 1).size);
-const tagsCount = computed(() => nodesStore.getAllTags.length);
-const resourcesCount = computed(() => nodesStore.resources.size);
+const documentsCount = computed(() => nodesStore.getAll.getIdsByRole(3).length);
+const workspacesCount = computed(() => nodesStore.getAll.getIdsByRole(1).length);
// Recently edited documents (last 5, sorted by update time)
const recentlyEdited = computed(() => {
- return nodesStore.documents
- .toArray()
- .toSorted((a, b) => b.updated_timestamp - a.updated_timestamp)
+ return nodesStore.getAll
+ .toSortedArray()
+ .filter(node => node.role === 3)
.slice(0, 5);
});
// Pinned documents (order === -1)
const pinnedDocuments = computed(() => {
- return nodesStore.documents.filter(d => d.order === -1).toArray();
+ return nodesStore.getAll.toSortedArray().filter(node => node.role === 3 && node.order === -1);
});
// Workspaces
const workspaces = computed(() => {
- return nodesStore.getAll
- .filter(n => n.role === 1)
- .toArray()
- .toSorted((a, b) => a.name.localeCompare(b.name));
+ const workspaceNodes = nodesStore.workspaces.filter((n): n is Node => !!n);
+ return workspaceNodes.sort((a, b) => a.name.localeCompare(b.name));
});
// Activity grouped by date
const activityByDate = computed(() => {
- const docs = nodesStore.documents
- .toArray()
- .toSorted((a, b) => b.updated_timestamp - a.updated_timestamp)
- .slice(0, 15);
+ const docs = nodesStore.documents.toSorted((a, b) => b.updated_timestamp - a.updated_timestamp).slice(0, 15);
const groups: Record<string, Node[]> = {};
docs.forEach(doc => {
@@ -212,21 +181,19 @@ const searchResults = computed(() => {
const query = searchQuery.value.toLowerCase().trim();
if (!query) return [];
- return nodesStore.getAll
+ return nodesStore.nodes
+ .toSortedArray()
.filter((node: Node) => {
const name = (node.name || '').toLowerCase();
const description = (node.description || '').toLowerCase();
const tags = (node.tags || '').toLowerCase();
return name.includes(query) || description.includes(query) || tags.includes(query);
})
- .toArray()
.slice(0, 8);
});
// Helpers
const getCategory = (id?: string) => nodesStore.getById(id || '');
-const getNodeLink = resolveNodeLink; // Use centralized helper
-const getNodeType = resolveNodeType; // Use centralized helper
const getNodePath = (node: Node) => {
const parts: string[] = [];
@@ -244,14 +211,24 @@ const getNodePath = (node: Node) => {
// Actions
const createNewDocument = () => router.push('/dashboard/docs/new');
const openCreateWorkspace = () => modals.add(new Modal(shallowRef(CreateCategoryModal), { props: { role: 1 } }));
+const openJoinModal = () => modals.add(new Modal(shallowRef(NodeJoin), { size: 'small' }));
</script>
<style scoped lang="scss">
+.home-top {
+ padding: 3rem 1.5rem;
+ border-radius: var(--radius-xl);
+ background:
+ radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 18%, transparent), transparent 28%),
+ linear-gradient(135deg, var(--surface-base), var(--surface-raised));
+ margin-top: 0.5rem;
+}
+
.home-container {
width: 100%;
max-width: 1400px;
margin: 0 auto;
- padding: 2rem;
+ padding: 1rem;
}
// Header
@@ -276,6 +253,10 @@ const openCreateWorkspace = () => modals.add(new Modal(shallowRef(CreateCategory
text-transform: capitalize;
}
+.sections {
+ padding: 2rem;
+}
+
.quick-actions {
display: flex;
gap: 0.75rem;
@@ -423,16 +404,6 @@ const openCreateWorkspace = () => modals.add(new Modal(shallowRef(CreateCategory
}
}
-.see-all {
- font-size: 0.9rem;
- color: var(--primary);
- text-decoration: none;
-
- &:hover {
- text-decoration: underline;
- }
-}
-
// Continue working cards
.continue-working {
display: grid;
@@ -544,44 +515,6 @@ const openCreateWorkspace = () => modals.add(new Modal(shallowRef(CreateCategory
color: var(--text-secondary);
}
-// Stats
-.stats-section {
- display: grid;
- gap: 1rem;
- grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
-}
-
-.stat-card {
- display: flex;
- padding: 1.25rem;
- border: 1px solid var(--border);
- border-radius: var(--radius-lg);
- background: var(--surface-base);
- align-items: center;
- gap: 1rem;
-}
-
-.stat-icon {
- padding: 0.4rem;
- border-radius: var(--radius-md);
- background: var(--primary-bg);
-}
-
-.stat-content {
- display: flex;
- flex-direction: column;
-}
-
-.stat-value {
- font-size: 1.5rem;
- font-weight: 700;
-}
-
-.stat-label {
- font-size: 0.85rem;
- color: var(--text-secondary);
-}
-
// Transitions
.dropdown-enter-active,
.dropdown-leave-active {
diff --git a/frontend/app/pages/dashboard/import/_components/ImportHeader.vue b/frontend/app/pages/dashboard/import/_components/ImportHeader.vue
index 99b2f9a9..6048243e 100644
--- a/frontend/app/pages/dashboard/import/_components/ImportHeader.vue
+++ b/frontend/app/pages/dashboard/import/_components/ImportHeader.vue
@@ -1,12 +1,13 @@
<template>
<div>
- <header>
- <h2>{{ t('import.header.title') }} <tag orange>Beta</tag></h2>
+ <Teleport to="#navbar-title">{{ t('import.header.title') }}</Teleport>
+
+ <Teleport to="#navbar-actions">
<AppButton type="secondary" size="sm" class="btn-close" @click="resetImport">
<Icon name="close" :size="14" />
{{ t('import.header.changeFile') }}
</AppButton>
- </header>
+ </Teleport>
<div class="info-grid">
<div class="info-item">
@@ -60,10 +61,6 @@ const { numericDate } = useDateFormatters();
</script>
<style scoped lang="scss">
-h2 {
- border-bottom: none;
-}
-
.btn-close {
display: flex;
align-items: center;
diff --git a/frontend/app/pages/dashboard/import/advanced.vue b/frontend/app/pages/dashboard/import/advanced.vue
index 695b8bf9..472c2afd 100644
--- a/frontend/app/pages/dashboard/import/advanced.vue
+++ b/frontend/app/pages/dashboard/import/advanced.vue
@@ -1,13 +1,9 @@
<template>
<div class="page-card files-import">
- <header>
- <div>
- <h1>{{ t('import.files.meta.title') }} <tag class="orange">Beta</tag></h1>
- <p class="subtitle">
- {{ t('import.files.meta.description') }}
- </p>
- </div>
- </header>
+ <Teleport to="#navbar-title">{{ t('import.files.meta.title') }} <tag class="orange">Beta</tag></Teleport>
+ <p class="subtitle">
+ {{ t('import.files.meta.description') }}
+ </p>
<AppDrop ref="dropComponent" multiple allow-folders :max-files="200" @select="selectFiles" />
<small>{{ t('import.files.importable') }}</small>
@@ -107,19 +103,15 @@ const nodesStore = useNodesStore();
const nodesTree = useNodesTree();
const { t } = useI18nT();
-const categoriesItem = nodesTree.treeUpToRole(2);
+const categoriesItem = nodesTree.getTreeUpToRole(2);
const selectedNodes = ref<string[]>([]);
const toCreate = ref(0);
const files = ref<File[]>([]);
-
-// On garde "nodes" pour l'affichage de la liste de prévisualisation dans le template
const nodes = ref<DB_Node[]>([]);
-// On stocke les ressources binaires correspondantes en parallèle
const resourcesToUpload = ref<ResourceImportTask[]>([]);
-// Calcule le total (nodes + ressources) pour la vue et la barre de progression
const totalItemsToImport = computed(() => nodes.value.length + resourcesToUpload.value.length);
const options = ref({
@@ -169,7 +161,6 @@ async function processImport() {
});
await imp.handleFiles(files.value);
- // Utilisation de la nouvelle structure destructurée
const result = await imp.normalizedToNodes();
nodes.value = result.nodesToCreate;
resourcesToUpload.value = result.resourcesToUpload;
@@ -182,15 +173,12 @@ function toggleSelection(id: string) {
}
const importSingle = (node: DB_Node) => {
- // Pour un import single depuis la liste, on regarde si c'est un node text/folder
- // On filtre aussi la liste des ressources si jamais elle était liée à cet ID de chemin
const relatedResources = resourcesToUpload.value.filter(r => r.id === node.id || r.parent_id === node.id);
importNodes([node], relatedResources);
};
const importSelected = () => {
const targetNodes = nodes.value.filter(n => selectedNodes.value.includes(n.id));
- // On récupère les ressources sélectionnées (ou dont le parent est sélectionné)
const targetResources = resourcesToUpload.value.filter(r => selectedNodes.value.includes(r.id) || (r.parent_id && selectedNodes.value.includes(r.parent_id)));
importNodes(targetNodes, targetResources);
};
@@ -203,10 +191,8 @@ async function importNodes(nodesToImport: DB_Node[], resourcesImport: ResourceIm
importJob.value.toCreate = totalCount;
importJob.value.status = 'in_progress';
- // Appel de la nouvelle méthode orchestrée du store (définie à l'étape précédente)
await nodesStore.importAllNodesAndResources(nodesToImport, resourcesImport, importJob);
- // Nettoyage de l'interface après import réussi
nodes.value = nodes.value.filter(n => !importJob.value.created.includes(n.id));
resourcesToUpload.value = resourcesToUpload.value.filter(r => !importJob.value.created.includes(r.id));
diff --git a/frontend/app/pages/dashboard/import/backup.vue b/frontend/app/pages/dashboard/import/backup.vue
index 4f4952d0..6f3e3cb1 100644
--- a/frontend/app/pages/dashboard/import/backup.vue
+++ b/frontend/app/pages/dashboard/import/backup.vue
@@ -2,9 +2,7 @@
<div class="import-page page-card">
<!-- Step 1: File Selection -->
<div v-if="step === 'select'">
- <header>
- <h1 style="font-size: 20px">{{ t('import.meta.title') }}</h1>
- </header>
+ <Teleport to="#navbar-title">{{ t('import.meta.title') }}</Teleport>
<p>
{{ t('import.meta.description') }}
<NuxtLink to="/dashboard/settings?p=backup" style="color: var(--primary)">{{ t('import.meta.settingsLink') }}</NuxtLink
diff --git a/frontend/app/pages/dashboard/import/files.vue b/frontend/app/pages/dashboard/import/files.vue
index 84ace390..c2b2d837 100644
--- a/frontend/app/pages/dashboard/import/files.vue
+++ b/frontend/app/pages/dashboard/import/files.vue
@@ -1,13 +1,9 @@
<template>
<div class="page-card files-import">
- <header>
- <div>
- <h1>{{ t('import.files.meta.title') }} <tag class="orange">Beta</tag></h1>
- <p class="subtitle">
- {{ t('import.files.meta.description') }}
- </p>
- </div>
- </header>
+ <Teleport to="#navbar-title">{{ t('import.files.meta.title') }} <tag class="orange">Beta</tag></Teleport>
+ <p class="subtitle">
+ {{ t('import.files.meta.description') }}
+ </p>
<AppDrop ref="dropComponent" multiple allow-folders :max-files="100" @select="selectFiles" />
<small>{{ t('import.files.importable') }}</small>
diff --git a/frontend/app/pages/dashboard/import/index.vue b/frontend/app/pages/dashboard/import/index.vue
index 2b349c3d..a3269e79 100644
--- a/frontend/app/pages/dashboard/import/index.vue
+++ b/frontend/app/pages/dashboard/import/index.vue
@@ -1,15 +1,11 @@
<template>
<div class="import-page page-card">
- <header>
- <div>
- <h1>{{ t('import.meta.title') }} <tag class="orange">Beta</tag></h1>
- <p class="subtitle">
- {{ t('import.meta.description') }}
- <NuxtLink to="/dashboard/settings?p=backup">{{ t('import.meta.settingsLink') }}</NuxtLink
- >.
- </p>
- </div>
- </header>
+ <Teleport to="#navbar-title">{{ t('import.meta.title') }} <tag class="orange">Beta</tag></Teleport>
+
+ <p class="page-subtitle">
+ {{ t('import.meta.description') }}
+ <NuxtLink to="/dashboard/settings?p=backup">{{ t('import.meta.settingsLink') }}</NuxtLink>
+ </p>
<section class="cards-grid">
<NuxtLink class="import-card" to="/dashboard/import/backup">
diff --git a/frontend/app/pages/dashboard/join-workspace.vue b/frontend/app/pages/dashboard/join-workspace.vue
new file mode 100644
index 00000000..39023336
--- /dev/null
+++ b/frontend/app/pages/dashboard/join-workspace.vue
@@ -0,0 +1,19 @@
+<template>
+ <div></div>
+</template>
+
+<script setup lang="ts">
+import NodeJoin from '~/components/Node/Modals/Join.vue';
+
+const route = useRoute();
+const modals = useModal();
+
+const openJoinModal = async () => {
+ modals.add(new Modal(shallowRef(NodeJoin), { props: { code: route.query.code } }));
+};
+
+onMounted(() => {
+ openJoinModal();
+ navigateTo('/dashboard');
+});
+</script>
diff --git a/frontend/app/pages/dashboard/settings/_views/apparence.vue b/frontend/app/pages/dashboard/settings/_views/apparence.vue
index d2c8eb0b..f2ee48c3 100644
--- a/frontend/app/pages/dashboard/settings/_views/apparence.vue
+++ b/frontend/app/pages/dashboard/settings/_views/apparence.vue
@@ -117,7 +117,7 @@ const options = computed(
type: 'groupCheckbox' as const,
key: 'navbarItems' as const,
items: {
- breadcrumb: t('settings.appearance.navbarItems.breadcrumb'),
+ breadcrumbNav: t('settings.appearance.navbarItems.breadcrumb'),
search: t('settings.appearance.navbarItems.search'),
theme: t('settings.appearance.navbarItems.theme'),
navigation: t('settings.appearance.navbarItems.navigation'),
diff --git a/frontend/app/pages/dashboard/settings/_views/other.vue b/frontend/app/pages/dashboard/settings/_views/other.vue
index 05e46eee..bb0346ac 100644
--- a/frontend/app/pages/dashboard/settings/_views/other.vue
+++ b/frontend/app/pages/dashboard/settings/_views/other.vue
@@ -14,7 +14,7 @@ type InterfaceOption = Option & {
const { t } = useI18nT();
const nodesTree = useNodesTree();
-const categories = nodesTree.treeUpToRole(2).value;
+const categories = nodesTree.getTreeUpToRole(2).value;
const options = computed<Array<{ label: string; options: InterfaceOption[] }>>(() => [
{
diff --git a/frontend/app/pages/dashboard/settings/_views/teams.vue b/frontend/app/pages/dashboard/settings/_views/teams.vue
new file mode 100644
index 00000000..f908c7d4
--- /dev/null
+++ b/frontend/app/pages/dashboard/settings/_views/teams.vue
@@ -0,0 +1,61 @@
+<template>
+ <section>
+ <div>
+ <h2>Create Team</h2>
+ <label for="name">{{ t('common.labels.name') }}</label>
+ <input id="name" v-model="category.name" class="entry" type="text" required :placeholder="t('common.labels.name')" />
+ <div style="min-width: 200px; flex: 1; margin-left: 10px">
+ <label for="color">{{ t('common.labels.color') }}</label>
+ <AppColorPicker id="color" v-model="category.color" class="entry" nullable />
+ </div>
+ <div class="footer">
+ <AppButton type="secondary" @click="emit('close')">{{ t('common.actions.cancel') }}</AppButton>
+ <AppButton type="primary" @click="createTeam">{{ t('common.actions.create') }}</AppButton>
+ </div>
+ </div>
+ <div class="teams-list">
+ <h2>Teams</h2>
+ <ul>
+ <li v-for="team in store.teams" :key="team.id">
+ <span>{{ team.name }}</span>
+ </li>
+ </ul>
+ </div>
+ </section>
+</template>
+
+<script setup lang="ts">
+import type { Node } from '~/stores';
+
+const emit = defineEmits(['close']);
+
+const store = useNodesStore();
+
+const { t } = useI18nT();
+
+const category = ref<Partial<Node>>({
+ accessibility: 1,
+ name: '',
+ role: 0,
+});
+
+const createTeam = () => {
+ store
+ .post(category.value)
+ .then(() => {
+ useNotifications().add({ title: t('nodes.category.notifications.created'), type: 'success' });
+ emit('close');
+ })
+ .catch(e => useNotifications().add({ message: e, title: t('nodes.category.notifications.creationError'), type: 'error' }));
+};
+</script>
+
+<style scoped lang="scss">
+label {
+ margin: 5px 0;
+}
+
+.entry {
+ background: var(--surface-base);
+}
+</style>
diff --git a/frontend/app/pages/dashboard/settings/index.vue b/frontend/app/pages/dashboard/settings/index.vue
index 43972243..b966c522 100644
--- a/frontend/app/pages/dashboard/settings/index.vue
+++ b/frontend/app/pages/dashboard/settings/index.vue
@@ -44,6 +44,7 @@ import AboutView from './_views/about.vue';
import AdvancedView from './_views/advanced.vue';
import OtherView from './_views/other.vue';
import StylesView from './_views/styles.vue';
+import TeamsView from './_views/teams.vue';
type PageKey = keyof typeof pages;
@@ -76,6 +77,7 @@ const pages = {
advanced: AdvancedView,
other: OtherView,
styles: StylesView,
+ teams: TeamsView,
} as const;
defineProps<{ isModal?: boolean }>();
@@ -122,6 +124,7 @@ const navSections = computed<NavSection[]>(() => [
{ key: 'snippets', label: t('settings.pages.snippets'), icon: 'snippets' },
{ key: 'backup', label: t('settings.pages.backup'), icon: 'backup' },
{ key: 'advanced', label: t('settings.pages.advanced'), icon: 'build' },
+ { key: 'teams', label: t('settings.pages.teams'), icon: 'users' },
],
},
{
diff --git a/frontend/app/pages/dashboard/share-target.vue b/frontend/app/pages/dashboard/share-target.vue
index a75cdbfc..bdbcc5ee 100644
--- a/frontend/app/pages/dashboard/share-target.vue
+++ b/frontend/app/pages/dashboard/share-target.vue
@@ -82,7 +82,7 @@ const sharedFiles = ref<File[]>([]);
const parentId = ref<string | undefined>(undefined);
const processing = ref(false);
-const categories = nodesTree.treeUpToRole(2);
+const categories = nodesTree.getTreeUpToRole(2);
onMounted(async () => {
await retrieveSharedData();
diff --git a/frontend/app/pages/dashboard/teams.vue b/frontend/app/pages/dashboard/teams.vue
new file mode 100644
index 00000000..43f4eee3
--- /dev/null
+++ b/frontend/app/pages/dashboard/teams.vue
@@ -0,0 +1,7 @@
+<template>
+ <NuxtPage />
+</template>
+
+<script setup lang="ts">
+definePageMeta({ breadcrumb: { i18n: 'components.sidebar.nav.teams' } });
+</script>
diff --git a/frontend/app/pages/dashboard/teams/[id]/index.vue b/frontend/app/pages/dashboard/teams/[id]/index.vue
new file mode 100644
index 00000000..5e59f6f0
--- /dev/null
+++ b/frontend/app/pages/dashboard/teams/[id]/index.vue
@@ -0,0 +1,189 @@
+<template>
+ <div v-if="team" class="team-page">
+ <Teleport to="#navbar-title">{{ t('teams.overview.title') }}</Teleport>
+ <Teleport to="#navbar-bottom"><NodeTeamNavbar :team-id="teamId" /></Teleport>
+ <section class="team-hero">
+ <div class="team-ident">
+ <div class="team-avatar" :class="getAppAccent(team.color as number, true)">
+ <img v-if="team.thumbnail" :src="team.thumbnail" :alt="team.name" class="team-thumbnail" />
+ <Icon v-else :name="resolveIcon(team)" display="xxl" />
+ </div>
+ <div class="team-copy">
+ <p class="eyebrow">{{ t('teams.overview.team') }}</p>
+ <h1>{{ team.name }}</h1>
+ <p class="description">{{ team.description || t('teams.noDescription') }}</p>
+ <div class="meta-row">
+ <span class="meta-chip">{{ directChildren.length }} {{ t('teams.overview.directItems') }}</span>
+ <span class="meta-chip">{{ allItems.length }} {{ t('teams.overview.totalNodes') }}</span>
+ <span class="meta-chip">Updated {{ shortDate(team.updated_timestamp) }}</span>
+ </div>
+ </div>
+ </div>
+
+ <div class="team-actions">
+ <AppButton type="primary" @click="openCreateWorkspace">{{ t('nodes.container.newWorkspace') }}</AppButton>
+ <AppButton type="secondary" @click="openCreateCategory"> {{ t('nodes.container.newCategory') }}</AppButton>
+ <NuxtLink :to="`/dashboard/docs/new?parent_id=${team.id}`"
+ ><AppButton type="secondary">{{ t('dashboard.actions.newDocument') }}</AppButton></NuxtLink
+ >
+ <AppButton type="danger" @click="openDelete">{{ t('teams.actions.delete') }}</AppButton>
+ </div>
+ </section>
+
+ <section class="content">
+ <AppBtnIcon icon="edit" style="position: absolute; top: 1rem; right: 1rem" @click="router.push(editLink)" />
+ <NodeDocumentContentCompiled v-if="team.content_compiled" :node="team" />
+ <NoContent v-else :title="t('teams.overview.homepageNoContentTitle')" :description="t('teams.overview.homepageNoContent')">
+ <NuxtLink :to="editLink">
+ <AppButton type="link">{{ t('teams.actions.addContent') }}</AppButton>
+ </NuxtLink>
+ </NoContent>
+ </section>
+ </div>
+</template>
+
+<script setup lang="ts">
+import NodeDeleteModal from '~/components/Node/Modals/Delete.vue';
+import CreateCategoryModal from '~/components/Node/Modals/CreateCategory.vue';
+import { resolveIcon } from '~/helpers/node';
+import type { Node } from '~/stores';
+
+definePageMeta({ breadcrumb: { i18n: 'teams.overview.title' } });
+
+const nodesStore = useNodesStore();
+
+const nodesTree = useNodesTree();
+const route = useRoute();
+const modals = useModal();
+const router = useRouter();
+const { shortDate } = useDateFormatters();
+const { getAppAccent } = useAppColors();
+const { t } = useI18nT();
+
+const teamId = route.params.id as string;
+const team = ref<Node | undefined>();
+
+watchEffect(() => {
+ team.value = nodesStore.getById(teamId);
+ if (team.value && team.value.partial) {
+ nodesStore.fetch({ id: teamId }).then(fetched => (team.value = fetched));
+ }
+});
+
+const allItems = computed(() => (team.value ? nodesTree.getChildren(team.value.id).filter(item => item.id !== team.value?.id) : []));
+const editLink = computed(() => (team.value ? `/dashboard/docs/edit/${team.value.id}?redirect=/dashboard/teams/${team.value.id}` : ''));
+const directChildren = computed(() => (team.value ? nodesTree.getChildren(team.value.id) : []));
+
+const openCreateWorkspace = () => modals.add(new Modal(shallowRef(CreateCategoryModal), { props: { role: 1, parentId: teamId } }));
+const openCreateCategory = () => modals.add(new Modal(shallowRef(CreateCategoryModal), { props: { role: 2, parentId: teamId } }));
+const openDelete = () => team.value && modals.add(new Modal(shallowRef(NodeDeleteModal), { props: { node: team.value, redirect: '/dashboard/teams' } }));
+</script>
+
+<style scoped lang="scss">
+.team-page {
+ display: flex;
+ margin: 1rem;
+ flex-direction: column;
+ gap: 1.25rem;
+}
+
+.team-hero {
+ display: flex;
+ padding: 1.5rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-xl);
+ background:
+ radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 20%, transparent), transparent 28%),
+ linear-gradient(135deg, var(--surface-base), var(--surface-raised));
+ box-shadow: var(--shadow-sm);
+ align-items: flex-start;
+ flex-wrap: wrap;
+ gap: 1.5rem;
+ justify-content: space-between;
+}
+
+.team-ident {
+ display: flex;
+ align-items: flex-start;
+ flex: 1;
+ gap: 1rem;
+}
+
+.team-avatar {
+ display: grid;
+ width: 96px;
+ height: 96px;
+ border-radius: 28px;
+ flex: none;
+ overflow: hidden;
+ place-items: center;
+}
+
+.team-thumbnail {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
+.eyebrow {
+ margin: 0 0 0.25rem;
+ font-size: 0.78rem;
+ color: var(--text-secondary);
+ letter-spacing: 0.18em;
+ text-transform: uppercase;
+}
+
+h1 {
+ margin: 0;
+ font-size: clamp(2rem, 4vw, 3.2rem);
+}
+
+.description {
+ max-width: 70ch;
+ margin: 0.5rem 0 0.9rem;
+ color: var(--text-secondary);
+}
+
+.meta-row {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.5rem;
+}
+
+.meta-chip {
+ padding: 0.45rem 0.75rem;
+ border-radius: 999px;
+ font-size: 0.84rem;
+ font-weight: 600;
+ color: var(--text-secondary);
+ background: var(--surface-overlay);
+}
+
+.team-actions {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+ justify-content: flex-end;
+}
+
+.content {
+ position: relative;
+ display: flex;
+ width: 100%;
+ padding: 1.5rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-lg);
+ flex-direction: column;
+ gap: 1.5rem;
+}
+
+@media screen and (width <= 700px) {
+ .team-ident {
+ flex-direction: column;
+ }
+
+ .team-actions {
+ justify-content: flex-start;
+ }
+}
+</style>
diff --git a/frontend/app/pages/dashboard/teams/[id]/insights.vue b/frontend/app/pages/dashboard/teams/[id]/insights.vue
new file mode 100644
index 00000000..a73c1ba9
--- /dev/null
+++ b/frontend/app/pages/dashboard/teams/[id]/insights.vue
@@ -0,0 +1,39 @@
+<template>
+ <div class="page-card">
+ <Teleport to="#navbar-title"><Icon name="insights" display="lg" /> {{ t('teams.insights.title') }}</Teleport>
+ <Teleport to="#navbar-bottom"><NodeTeamNavbar :team-id="teamId" /></Teleport>
+ <h2>{{ t('teams.insights.trending') }}</h2>
+ <Trending :stats="stats" />
+ <h2>{{ t('teams.insights.stats') }}</h2>
+ <NodeStats :parent-id="teamId" />
+ </div>
+</template>
+
+<script setup lang="ts">
+import type { MonthlyCount } from '~/stores';
+
+definePageMeta({ breadcrumb: { i18n: 'teams.insights.title' } });
+
+const route = useRoute();
+const tree = useNodesTree();
+const { t } = useI18nT();
+
+const teamId = route.params.id as string;
+
+const stats = ref<MonthlyCount[]>([]);
+
+watchEffect(() => {
+ const nodes = tree.getSubtreeAsArray(teamId);
+ for (const node of nodes) {
+ const month = new Date(node.data.created_timestamp).toISOString().slice(5, 7);
+ console.log('Month:', month, 'Node ID:', node.data.id);
+ const existing = stats.value.find(item => item.month === month);
+ if (existing) {
+ existing.count++;
+ } else {
+ stats.value.push({ month, count: 1 });
+ }
+ }
+ stats.value.sort((a, b) => a.month.localeCompare(b.month));
+});
+</script>
diff --git a/frontend/app/pages/dashboard/teams/[id]/manage-members.vue b/frontend/app/pages/dashboard/teams/[id]/manage-members.vue
new file mode 100644
index 00000000..ce48d9e5
--- /dev/null
+++ b/frontend/app/pages/dashboard/teams/[id]/manage-members.vue
@@ -0,0 +1,364 @@
+<template>
+ <div v-if="node" class="page-card">
+ <Teleport to="#navbar-title"><Icon name="users" display="lg" /> {{ t('teams.members.title') }}</Teleport>
+ <Teleport to="#navbar-bottom"><NodeTeamNavbar :team-id="teamId" /></Teleport>
+
+ <!-- Search + add -->
+ <section>
+ <h2>{{ t('teams.members.permissionsTitle') }}</h2>
+ <form @submit.prevent>
+ <small>{{ t('teams.members.permissionsDescription') }}</small>
+ <input id="user" v-model="query" :placeholder="t('nodes.modals.permissions.searchPlaceholder')" autocomplete="off" />
+
+ <div v-for="user in users" :key="user.id" class="user-card">
+ <div class="user-info-row">
+ <span class="user-meta">
+ <img :src="avatarURL(user)" alt="avatar" class="avatar" />
+ <span>{{ user.username }}</span>
+ </span>
+ <div class="user-actions">
+ <AppSelect v-model="permToAdd.node_id" :items="contextOptions" :searchable="false" />
+ <AppSelect v-model="permToAdd.permission" :items="NODE_PERMISSIONS" :searchable="false" size="200px" />
+ <AppButton type="primary" small @click="addPermission(user)">{{ t('nodes.modals.permissions.addPermission') }}</AppButton>
+ </div>
+ </div>
+ </div>
+ <Loader v-if="isLoading" />
+ <p v-else-if="searchError" class="info-secondary">{{ searchError }}</p>
+ </form>
+
+ <!-- Current permissions -->
+ <p v-if="!node?.permissions.length" class="info-secondary">{{ t('nodes.modals.permissions.noPermissions') }}</p>
+ <DataTable v-if="rows?.length" :headers="headers" :rows="rows || []">
+ <template #context="{ cell }">
+ <Icon
+ :name="nodesStore.getById((cell?.data as Permission).node_id)?.icon || 'files'"
+ display="xl"
+ :class="['parent-icon', getAppAccent(nodesStore.getById((cell?.data as Permission).node_id)?.color as number, true)]"
+ />
+ {{ nodesStore.getById((cell?.data as Permission).node_id)?.name }}
+ </template>
+ <template #role_action="{ cell }">
+ <div class="actions-row">
+ <AppSelect
+ v-model="(cell?.data as Permission).permission"
+ :items="NODE_PERMISSIONS"
+ :searchable="false"
+ size="250px"
+ @update:model-value="updatePermission(cell?.data as Permission)"
+ />
+ </div>
+ </template>
+ <template #actions="{ cell }">
+ <AppBtnIcon icon="group_off" @click="removePermission(cell?.data as Permission)" />
+ </template>
+ </DataTable>
+
+ <h2>{{ t('nodes.modals.permissions.inviteLabel') }}</h2>
+ <div class="invite-form">
+ <AppSelect v-model="invitationToAdd.permission_level" :items="NODE_PERMISSIONS" :searchable="false" />
+ <AppButton type="primary" small @click="createInvitation">{{ t('nodes.modals.permissions.inviteCreate') }}</AppButton>
+ </div>
+ <p v-if="!invitations.length" class="info-secondary">{{ t('nodes.modals.permissions.inviteEmpty') }}</p>
+ <ul id="invitations" class="permissions-list">
+ <li v-for="invitation in invitations" :key="invitation.id" class="permission-item invitation-item">
+ <div class="user-info-row invitation-row">
+ <span class="invite-meta">
+ <span class="invite-code">{{ invitation.invitation_code }}</span>
+ <span class="invite-details">
+ {{ t('nodes.modals.permissions.invitePermission') }}: {{ resolvePermissionName(invitation.permission_level) }} ·
+ {{ shortDate(invitation.created_timestamp) }}
+ </span>
+ </span>
+
+ <div class="user-actions">
+ <AppButton type="secondary" small @click="copyInvitationLink(invitation.invitation_code)">{{ t('common.actions.copyLink') }}</AppButton>
+ <AppButton type="danger" small @click="deleteInvitation(invitation.id)">{{ t('common.actions.revoke') }}</AppButton>
+ </div>
+ </div>
+ </li>
+ </ul>
+ </section>
+ </div>
+</template>
+
+<script setup lang="ts">
+import { NODE_PERMISSIONS } from '~/helpers/constants';
+import { resolvePermissionName } from '~/helpers/node';
+import type { Node, NodeInvitation, Permission, PublicUser } from '~/stores';
+
+definePageMeta({ breadcrumb: { i18n: 'teams.members.title' } });
+
+const usersStore = useUserStore();
+const nodesStore = useNodesStore();
+
+const { t } = useI18nT();
+const { avatarURL } = useApi();
+const { shortDate, numericDate } = useDateFormatters();
+const { getAppAccent } = useAppColors();
+const notifications = useNotifications();
+const route = useRoute();
+const tree = useNodesTree();
+
+const teamId = route.params.id as string;
+
+const node = ref<Node | undefined>();
+const query = ref('');
+const users = ref<PublicUser[]>([]);
+const permToAdd = ref<Omit<Permission, 'id' | 'created_timestamp'>>({ node_id: teamId, user_id: '', permission: 1 });
+const invitationToAdd = ref<Omit<NodeInvitation, 'id' | 'created_timestamp' | 'invitation_code'>>({ node_id: teamId, permission_level: 1 });
+const selectedInvitationPermission = ref(1);
+const invitations = ref<NodeInvitation[]>([]);
+const searchError = ref<string | null>(null);
+const isLoading = ref(false);
+const permissions = ref<Permission[]>([]);
+
+const invitationLink = (code: string) => `${window.location.origin}/dashboard/join-workspace?code=${encodeURIComponent(code)}`;
+const contextOptions = computed(() => tree.getWorkspaceTree(node.value?.id as string, true));
+nodesStore.fetchPermissions(teamId, true).then(perms => (permissions.value = perms));
+nodesStore.fetchInvitations(teamId).then(invites => (invitations.value = invites));
+
+watchEffect(async () => {
+ const cached = nodesStore.getById(teamId);
+ if (cached && cached.partial) {
+ await nodesStore.fetch({ id: teamId });
+ }
+ node.value = nodesStore.getById(teamId);
+ for (const perm of permissions.value) {
+ usersStore.fetchPublicUser(perm.user_id);
+ }
+});
+
+const headers = computed(() => [
+ { label: t('admin.users.headers.name'), key: 'username' },
+ { label: t('admin.users.headers.role'), key: 'role' },
+ { label: 'Joined At', key: 'created_at' },
+ { label: 'Context', key: 'context' },
+ { label: 'Role', key: 'role_action', align: 'space-around' as const },
+ { label: 'Actions', key: 'actions', align: 'space-around' as const },
+]);
+
+const rows = computed(() => {
+ return permissions.value.map(p => {
+ const u = usersStore.getById(p.user_id);
+ return {
+ username: {
+ content: `<img style="border-radius:50%;width:25px;height:25px;" src="${avatarURL(u)}"/>&nbsp;&nbsp;&nbsp;${u?.username || 'Unknown'}`,
+ type: 'html' as const,
+ },
+ role: {
+ content: p.permission == 1 ? `<tag class="blue">Read</tag>` : p.permission == 2 ? `<tag class="green">Write</tag>` : `<tag class="red">Admin</tag>`,
+ type: 'html' as const,
+ },
+ created_at: { content: numericDate(p.created_timestamp), type: 'text' as const },
+ context: { type: 'slot' as const, data: p },
+ role_action: { type: 'slot' as const, data: p },
+ actions: { type: 'slot' as const, data: p },
+ };
+ });
+});
+
+watch(query, async newQuery => {
+ users.value = [];
+ searchError.value = null;
+ if (!newQuery) return;
+ isLoading.value = true;
+ searchUsers(newQuery);
+});
+
+const searchUsers = debounce((query: unknown) => {
+ usersStore
+ .searchFetch(query as string)
+ .then(fetchedUsers => {
+ users.value = fetchedUsers;
+ searchError.value = null;
+ })
+ .catch(() => {
+ users.value = [];
+ searchError.value = t('nodes.modals.permissions.noResults');
+ })
+ .finally(() => (isLoading.value = false));
+}, 750);
+
+watch(
+ () => (node.value?.accessibility ?? 0) + (node.value?.access ?? 0),
+ debounce(() => nodesStore.update(node.value!), 500),
+ { deep: true },
+);
+
+// Actions
+const addPermission = async (user: PublicUser) => {
+ if (!user) return;
+ const newPermission = await nodesStore.addPermission({
+ ...permToAdd.value,
+ user_id: user.id,
+ });
+ users.value = [];
+ query.value = '';
+ permToAdd.value = { ...permToAdd.value, node_id: teamId, user_id: '', permission: 1 };
+ permissions.value = [newPermission, ...permissions.value];
+};
+
+const updatePermission = async (perm: Permission) => {
+ await nodesStore.updatePermission(perm);
+ permissions.value = permissions.value.map(p => (p.id === perm.id ? perm : p));
+};
+
+const removePermission = async (perm: Permission) => {
+ if (!node.value) return;
+ await nodesStore.removePermission(perm);
+ permissions.value = permissions.value.filter(p => p.id !== perm.id);
+};
+
+const createInvitation = async () => {
+ if (!node.value?.id) return;
+ try {
+ const invitation = await nodesStore.addInvitation(node.value.id, selectedInvitationPermission.value);
+ invitations.value = [invitation, ...invitations.value];
+ selectedInvitationPermission.value = 1;
+ notifications.add({ type: 'success', title: 'Invitation created' });
+ } finally {
+ invitationToAdd.value = { ...invitationToAdd.value, node_id: teamId, permission_level: 1 };
+ }
+};
+
+const deleteInvitation = async (invitationId: string) => {
+ if (!node.value?.id) return;
+ await nodesStore.removeInvitation(node.value.id, invitationId);
+ invitations.value = invitations.value.filter(invitation => invitation.id !== invitationId);
+ notifications.add({ type: 'success', title: 'Invitation revoked' });
+};
+
+const copyInvitationLink = async (code: string) => {
+ await navigator.clipboard.writeText(invitationLink(code));
+ notifications.add({ type: 'success', title: 'Invitation link copied to clipboard' });
+};
+</script>
+
+<style scoped lang="scss">
+h2 {
+ margin: 20px 5px;
+ font-size: 20px;
+ padding-bottom: 8px;
+}
+
+form {
+ display: flex;
+ margin: 15px 0;
+ padding: 0 4px;
+ flex-direction: column;
+ gap: 10px;
+}
+
+.user-card {
+ display: flex;
+ padding: 6px 10px;
+ border-radius: var(--radius-md);
+ background-color: var(--surface-transparent);
+ flex-direction: column;
+ gap: 8px;
+}
+
+.user-info-row {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+.user-meta {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+
+ .avatar {
+ width: 30px;
+ height: 30px;
+ border-radius: 50%;
+ }
+}
+
+.user-actions {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+}
+
+.info-secondary {
+ margin: 0;
+ font-size: 14px;
+ color: var(--text-secondary);
+ text-align: center;
+ margin-top: 10px;
+}
+
+.public-info {
+ padding: 0 5px;
+ border-radius: var(--radius-md);
+ margin-bottom: 10px;
+
+ .info-text {
+ margin: 5px 0;
+ font-size: 14px;
+ color: var(--text-secondary);
+ }
+
+ .public-link {
+ display: flex;
+ color: var(--primary);
+ align-items: flex-end;
+ gap: 2px;
+ text-decoration: underline;
+ word-break: break-all;
+ }
+}
+
+.access {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-top: 10px;
+}
+
+.permissions-list {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+}
+
+.permission-item {
+ padding: 8px;
+
+ &:not(:last-child) {
+ border-bottom: 1px solid var(--border);
+ }
+}
+
+.invite-form {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+}
+
+.invitation-item {
+ .invitation-row {
+ gap: 10px;
+ }
+
+ .invite-meta {
+ display: flex;
+ min-width: 0;
+ flex-direction: column;
+ gap: 2px;
+ }
+
+ .invite-code {
+ font-weight: 700;
+ letter-spacing: 0.12em;
+ }
+
+ .invite-details {
+ font-size: 12px;
+ color: var(--text-secondary);
+ }
+}
+</style>
diff --git a/frontend/app/pages/dashboard/teams/[id]/nodes.vue b/frontend/app/pages/dashboard/teams/[id]/nodes.vue
new file mode 100644
index 00000000..c50acbaa
--- /dev/null
+++ b/frontend/app/pages/dashboard/teams/[id]/nodes.vue
@@ -0,0 +1,31 @@
+<template>
+ <div>
+ <Teleport to="#navbar-bottom"><NodeTeamNavbar :team-id="teamId" /></Teleport>
+ <NodeContainerView :parent="parent" :nodes="nodes" :parent-id="teamId">
+ <template #title>
+ <Icon name="nodes" display="lg" />
+ {{ t('nodes.nodes') }}
+ </template>
+ </NodeContainerView>
+ </div>
+</template>
+
+<script setup lang="ts">
+definePageMeta({ breadcrumb: { i18n: 'nodes.nodes' } });
+
+const nodesStore = useNodesStore();
+
+const route = useRoute();
+const tree = useNodesTree();
+const { t } = useI18nT();
+
+const teamId = route.params.id as string;
+const parent = computed(() => nodesStore.getById(teamId));
+
+const nodes = computed(() =>
+ tree
+ .getSubtreeAsArray(teamId)
+ .filter(node => node.data.role === 3)
+ .map(i => i.data),
+);
+</script>
diff --git a/frontend/app/pages/dashboard/teams/[id]/settings.vue b/frontend/app/pages/dashboard/teams/[id]/settings.vue
new file mode 100644
index 00000000..be91bd2d
--- /dev/null
+++ b/frontend/app/pages/dashboard/teams/[id]/settings.vue
@@ -0,0 +1,92 @@
+<template>
+ <div class="page-card">
+ <Teleport to="#navbar-title"><Icon name="settings" display="lg" />{{ t('components.sidebar.nav.settings') }}</Teleport>
+ <Teleport to="#navbar-bottom"><NodeTeamNavbar :team-id="nodeId" /></Teleport>
+ <form v-if="node" @submit.prevent>
+ <Teleport to="#navbar-actions">
+ <AppBtnIcon nav icon="save" :tooltip="t('common.actions.update')" @click="updateCategory" />
+ </Teleport>
+ <div class="form-row">
+ <label>{{ t('common.labels.name') }}</label>
+ <input id="name" v-model="node.name" type="text" required />
+ </div>
+
+ <div class="form-row">
+ <label>{{ t('common.labels.description') }}</label>
+ <input id="description" v-model="node.description" type="text" />
+ </div>
+
+ <div class="form-row">
+ <label>{{ t('common.labels.tags') }}</label>
+ <AppTagInput id="tags" v-model="node.tags" type="text" style="width: 100%" />
+ </div>
+
+ <div class="form-row">
+ <div class="form-column">
+ <label>{{ t('common.labels.parent') }}</label>
+ <AppSelect
+ v-model="node.parent_id"
+ :items="categoriesItem"
+ :placeholder="t('common.placeholder.parent')"
+ nullable
+ :disabled="i => i.id == node!.id || nodesStore.isDescendant(node!, i.id as string)"
+ />
+ </div>
+ <div class="form-column">
+ <label for="order">{{ t('common.labels.order') }}</label>
+ <input id="order" v-model.number="node.order" type="number" />
+ </div>
+ </div>
+ <label style="display: flex; align-items: center">{{ t('common.labels.icon') }} <AppHint :text="t('nodes.category.iconHint')" /></label>
+ <textarea v-model="node.icon" type="text" rows="5" />
+
+ <label for="color">{{ t('common.labels.color') }}</label>
+ <AppColorPicker v-model="node.color" name="color" nullable />
+ </form>
+ </div>
+</template>
+
+<script lang="ts" setup>
+definePageMeta({ breadcrumb: { i18n: 'common.actions.edit' } });
+
+const nodesStore = useNodesStore();
+
+const { t } = useI18nT();
+const nodesTree = useNodesTree();
+const notifications = useNotifications();
+const route = useRoute();
+const router = useRouter();
+
+const nodeId = route.params.id as string;
+const node = computed(() => nodesStore.getById(nodeId));
+const categoriesItem = nodesTree.getTreeUpToRole(2);
+
+// Actions
+const updateCategory = async () => {
+ if (node.value)
+ nodesStore
+ .update(node.value)
+ .then(() => {
+ notifications.add({ title: t('nodes.category.notifications.updated'), type: 'success' });
+ router.push(`/dashboard/teams/${nodeId}`);
+ })
+ .catch(e => notifications.add({ message: e, title: t('common.status.error'), type: 'error' }));
+};
+</script>
+
+<style scoped lang="scss">
+label {
+ margin-top: 10px;
+}
+
+.form-row {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0 20px;
+}
+
+.form-column {
+ min-width: 200px;
+ flex: 1;
+}
+</style>
diff --git a/frontend/app/pages/dashboard/teams/[id]/uploads.vue b/frontend/app/pages/dashboard/teams/[id]/uploads.vue
new file mode 100644
index 00000000..c21d7874
--- /dev/null
+++ b/frontend/app/pages/dashboard/teams/[id]/uploads.vue
@@ -0,0 +1,13 @@
+<template>
+ <div>
+ <Teleport to="#navbar-bottom"><NodeTeamNavbar :team-id="teamId" /></Teleport>
+ <NodeResourceCDN :parent-id="teamId" />
+ </div>
+</template>
+
+<script setup lang="ts">
+definePageMeta({ breadcrumb: { i18n: 'cdn.meta.title' } });
+
+const route = useRoute();
+const teamId = route.params.id as string;
+</script>
diff --git a/frontend/app/pages/dashboard/teams/index.vue b/frontend/app/pages/dashboard/teams/index.vue
new file mode 100644
index 00000000..0fdde735
--- /dev/null
+++ b/frontend/app/pages/dashboard/teams/index.vue
@@ -0,0 +1,240 @@
+<template>
+ <div class="page-card teams-index">
+ <Teleport to="#navbar-title">{{ t('teams.title') }}</Teleport>
+
+ <header class="hero">
+ <div>
+ <p class="eyebrow">{{ t('teams.eyebrown') }}</p>
+ <p class="subtitle">{{ t('teams.subtitle') }}</p>
+ </div>
+ <div class="hero-actions">
+ <AppButton type="primary" @click="openCreateTeam">{{ t('teams.actions.create') }}</AppButton>
+ <NuxtLink to="/dashboard/join-workspace">
+ <AppButton type="secondary">{{ t('nodes.modals.join.title') }}</AppButton>
+ </NuxtLink>
+ </div>
+ </header>
+
+ <section class="toolbar">
+ <div class="search-box">
+ <Icon name="search" />
+ <input v-model="query" type="text" placeholder="Search teams" />
+ </div>
+ <div class="count-pill">{{ filteredTeams.length }} {{ t('teams.teamsCount') }}</div>
+ </section>
+
+ <section v-if="filteredTeams.length" class="team-grid">
+ <NuxtLink v-for="team in filteredTeams" :key="team.id" :to="resolveNodeLink(team)" class="team-card">
+ <div class="team-card-top">
+ <div class="team-avatar" :class="getAppAccent(team.color as number, true)">
+ <img v-if="team.thumbnail" :src="team.thumbnail" :alt="team.name" class="team-thumbnail" />
+ <Icon v-else :name="resolveIcon(team)" display="xl" />
+ </div>
+ <div class="team-title">
+ <h2>{{ team.name }}</h2>
+ <p>{{ team.description || t('teams.noDescription') }}</p>
+ </div>
+ </div>
+
+ <NodeStats :parent-id="team.id" />
+
+ <div class="team-footer">
+ <span class="team-meta">Updated {{ shortDate(team.updated_timestamp) }}</span>
+ <span class="team-open">Open team</span>
+ </div>
+ </NuxtLink>
+ </section>
+
+ <NoContent v-else title="No teams yet" :description="t('teams.actions.createDescription')">
+ <AppButton type="primary" @click="openCreateTeam">{{ t('teams.actions.create') }}</AppButton>
+ </NoContent>
+ </div>
+</template>
+
+<script setup lang="ts">
+import CreateCategoryModal from '~/components/Node/Modals/CreateCategory.vue';
+import { resolveIcon, resolveNodeLink } from '~/helpers/node';
+
+const nodesStore = useNodesStore();
+const modals = useModal();
+const { shortDate } = useDateFormatters();
+const { getAppAccent } = useAppColors();
+const { t } = useI18nT();
+
+const query = ref('');
+
+const teams = computed(() => nodesStore.teams.toSorted((a, b) => a.name.localeCompare(b.name)));
+const filteredTeams = computed(() => {
+ const search = query.value.trim().toLowerCase();
+ if (!search) return teams.value;
+ return teams.value.filter(team => `${team.name} ${team.description || ''}`.toLowerCase().includes(search));
+});
+
+const openCreateTeam = () => modals.add(new Modal(shallowRef(CreateCategoryModal), { props: { role: 0, parentId: undefined }, size: 'small' }));
+</script>
+
+<style scoped lang="scss">
+.teams-index {
+ display: flex;
+ flex-direction: column;
+ gap: 1.25rem;
+}
+
+.hero {
+ display: flex;
+ padding: 1.5rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-xl);
+ background:
+ radial-gradient(circle at top right, color-mix(in srgb, var(--primary) 18%, transparent), transparent 28%),
+ linear-gradient(135deg, var(--surface-base), var(--surface-raised));
+ align-items: flex-start;
+ flex-wrap: wrap;
+ gap: 1rem;
+ justify-content: space-between;
+}
+
+.eyebrow {
+ margin: 0 0 0.25rem;
+ font-size: 0.78rem;
+ color: var(--text-secondary);
+ letter-spacing: 0.18em;
+ text-transform: uppercase;
+}
+
+h1 {
+ margin: 0;
+ font-size: clamp(2rem, 4vw, 3rem);
+}
+
+.subtitle {
+ max-width: 60ch;
+ margin: 0.5rem 0 0;
+ color: var(--text-secondary);
+}
+
+.hero-actions,
+.toolbar {
+ display: flex;
+ align-items: center;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+ justify-content: space-between;
+}
+
+.search-box {
+ display: flex;
+ min-width: min(520px, 100%);
+ padding: 0.8rem 1rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-lg);
+ background: var(--surface-base);
+ align-items: center;
+ gap: 0.75rem;
+
+ input {
+ width: 100%;
+ border: none;
+ background: transparent;
+ outline: none;
+ }
+}
+
+.count-pill {
+ padding: 0.55rem 0.85rem;
+ border-radius: 999px;
+ font-size: 0.9rem;
+ font-weight: 600;
+ color: var(--text-secondary);
+ background: var(--surface-raised);
+}
+
+.team-grid {
+ display: grid;
+ gap: 1rem;
+ grid-template-columns: repeat(2, 1fr);
+
+ :last-child:nth-child(odd) {
+ grid-column: 1 / -1;
+ }
+}
+
+.team-card {
+ display: flex;
+ min-height: 220px;
+ padding: 1.1rem;
+ border: 1px solid var(--border);
+ border-radius: var(--radius-xl);
+ color: var(--text-body);
+ background: linear-gradient(180deg, var(--surface-base), var(--surface-raised));
+ box-shadow: var(--shadow-sm);
+ transition:
+ transform 0.18s ease,
+ box-shadow 0.18s ease,
+ border-color 0.18s ease;
+ flex-direction: column;
+ gap: 1rem;
+ text-decoration: none;
+
+ &:hover {
+ border-color: var(--border-strong);
+ box-shadow: var(--shadow-lg);
+ transform: translateY(-2px);
+ }
+}
+
+.team-card-top {
+ display: flex;
+ align-items: center;
+ gap: 1rem;
+}
+
+.team-avatar {
+ display: grid;
+ width: 72px;
+ height: 72px;
+ border-radius: 22px;
+ background: var(--surface-overlay);
+ flex: none;
+ overflow: hidden;
+ place-items: center;
+}
+
+.team-thumbnail {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
+.team-title {
+ min-width: 0;
+
+ h2 {
+ margin: 0;
+ font-size: 1.1rem;
+ }
+
+ p {
+ margin: 0.3rem 0 0;
+ color: var(--text-secondary);
+ }
+}
+
+.team-footer {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ justify-content: space-between;
+ margin-top: auto;
+}
+
+.team-meta {
+ font-size: 0.86rem;
+ color: var(--text-secondary);
+}
+
+.team-open {
+ font-weight: 700;
+ color: var(--primary);
+}
+</style>
diff --git a/frontend/app/stores/_utils.ts b/frontend/app/stores/_utils.ts
index 85364850..65fbde4f 100644
--- a/frontend/app/stores/_utils.ts
+++ b/frontend/app/stores/_utils.ts
@@ -110,7 +110,7 @@ async function refreshAccessToken(): Promise<void> {
navigateTo('/login', { replace: true });
}
- throw new Error('Refresh token invalid');
+ throw new Error('Refresh token invalid', { cause: error });
} finally {
// Reset the promise so future refreshes can occur
refreshPromise = null;
diff --git a/frontend/app/stores/db_structures.d.ts b/frontend/app/stores/db_structures.d.ts
index 195808fa..bae2408c 100644
--- a/frontend/app/stores/db_structures.d.ts
+++ b/frontend/app/stores/db_structures.d.ts
@@ -37,6 +37,19 @@ export interface Permission {
created_timestamp: number;
}
+export interface NodeInvitation {
+ id: string;
+ invitation_code: string;
+ permission_level: number;
+ node_id: string;
+ created_timestamp: number;
+}
+
+export interface InvitationJoinResponse {
+ permission: Permission;
+ node: Node;
+}
+
export interface Node extends DB_Node {
partial?: boolean;
shared: boolean;
diff --git a/frontend/app/stores/nodes.store.ts b/frontend/app/stores/nodes.store.ts
index 452cc220..cea352d0 100644
--- a/frontend/app/stores/nodes.store.ts
+++ b/frontend/app/stores/nodes.store.ts
@@ -1,11 +1,13 @@
import type { ResourceImportTask } from '~/helpers/backups/Importer';
import { Collection } from './collection';
-import type { DB_Node, ImportJob, Node, NodeSearchResult, Permission, PublicNodeResponse } from './db_structures';
+import { IndexedCollection } from '~/helpers/IndexedCollection';
+import type { DB_Node, ImportJob, InvitationJoinResponse, Node, NodeInvitation, NodeSearchResult, Permission, PublicNodeResponse } from './db_structures';
+export type TeamRole = 0;
export type CategoryRole = 1 | 2;
export type DocumentRole = 3;
export type ResourceRole = 4;
-export type NodeRole = CategoryRole | DocumentRole | ResourceRole;
+export type NodeRole = TeamRole | CategoryRole | DocumentRole | ResourceRole;
export interface SearchOptions {
query?: string;
@@ -22,7 +24,7 @@ export interface SearchOptions {
export const useNodesStore = defineStore('nodes', {
state: () => ({
- nodes: new Collection<string, Node>(),
+ nodes: new IndexedCollection(),
public_nodes: new Collection<string, Node>(),
allTags: [] as string[],
isFetching: false,
@@ -31,80 +33,51 @@ export const useNodesStore = defineStore('nodes', {
getAll: state => state.nodes,
getAllTags: state => state.allTags,
getById: state => (id: string) => state.nodes.get(id),
- getTotalUsedStorage: state => state.nodes.toArray().reduce((total, node) => total + (node.size || 0), 0),
- getByIdWithParents: state => (id: string) => {
- const node = state.nodes.get(id);
+ getTotalUsedStorage: state => state.nodes.toSortedArray().reduce((total, node) => total + (node.size || 0), 0),
- if (!node) return [];
+ /* Getters for nodes by role */
+ teams: state => state.nodes.getIdsByRole(0).map(id => state.nodes.get(id)!),
+ categories: state => [...state.nodes.getIdsByRole(1), ...state.nodes.getIdsByRole(2)].map(id => state.nodes.get(id)!),
+ workspaces: state => state.nodes.getIdsByRole(1).map(id => state.nodes.get(id)!),
+ documents: state => state.nodes.getIdsByRole(3).map(id => state.nodes.get(id)!),
+ resources: state => state.nodes.getIdsByRole(4).map(id => state.nodes.get(id)!),
- const result = [node];
-
- if (!node.parent_id) return result;
-
- const getParents = (children: Node) => {
- state.nodes.forEach(node => {
- if (node.id === children.parent_id) {
- result.push(node);
- getParents(node);
- }
- });
- };
-
- getParents(node);
+ /**
+ * Recursive getters
+ */
- return result;
- },
- getByCategories: state => (category: string) => state.nodes.filter(d => d.parent_id == category),
- getParents: state => state.nodes.filter(c => !c.parent_id),
- getChilds: state => (id: string) => state.nodes.filter(c => c.parent_id == id),
- categories: state => state.nodes.filter(d => d.role === 1 || d.role === 2),
- documents: state => state.nodes.filter(d => d.role === 3),
- resources: state => state.nodes.filter(d => d.role === 4),
+ // Check if a node (descendantId) is a descendant of another node
isDescendant:
state =>
- (node: Node, descendantId: string): boolean => {
- const checkDescendants = (currentNode: Node): boolean => {
- const children = state.nodes.filter(d => d.parent_id === currentNode.id);
- for (const child of children.values()) {
- if (child.id === descendantId) return true;
- if (checkDescendants(child)) return true;
- }
- return false;
- };
- return checkDescendants(node);
+ (parent: Node, descendantId: string): boolean => {
+ let current = state.nodes.get(descendantId);
+ while (current?.parent_id) {
+ if (current.parent_id === parent.id) return true;
+ current = state.nodes.get(current.parent_id);
+ }
+ return false;
},
- getAllChildrens: state => (id: string) => {
- const parent = state.nodes.get(id);
- if (!parent) return [];
- const childrens: Node[] = [parent];
- const getChildrens = (parent: Node) => {
- state.nodes.forEach(node => {
- if (node.parent_id == parent.id) {
- childrens.push(node);
- getChildrens(node);
- }
- });
- };
- getChildrens(parent);
- return childrens;
- },
- getAllChildrensIds: state => (id: string) => {
- const childrens: string[] = [id];
- const getChildrens = (parent: Node) => {
- state.nodes.forEach(node => {
- if (node.parent_id == parent.id) {
- childrens.push(node.id);
- getChildrens(node);
+ // Get all descendant IDs of a node
+ getDescendantIds:
+ state =>
+ (id: string): string[] => {
+ const result: string[] = [];
+ const queue: string[] = [id];
+
+ while (queue.length > 0) {
+ const currentId = queue.shift()!;
+ const childrenIds = state.nodes.getChildrenIds(currentId);
+ for (const childId of childrenIds) {
+ result.push(childId);
+ queue.push(childId);
}
- });
- };
- const parent = state.nodes.get(id);
- if (parent) getChildrens(parent);
- return childrens;
- },
+ }
+ return result;
+ },
+
search:
state =>
- (options: SearchOptions, nodes = state.nodes.toArray()) => {
+ (options: SearchOptions, nodes = state.nodes.toSortedArray()) => {
const {
query,
fromDate,
@@ -214,20 +187,27 @@ export const useNodesStore = defineStore('nodes', {
this.clear();
await Promise.all([this.fetch(), this.fetchShared()]);
},
+
recomputeTags() {
const tags = new Set<string>();
+
+ this.nodes.startBulk();
+
this.nodes.forEach(node => {
if (node.tags) {
parseTags(node.tags).forEach(tag => tags.add(tag));
}
if (node.parent_id && !this.nodes.get(node.parent_id)) {
- node.parent_id = '';
+ this.nodes.set(node.id, { ...node, parent_id: '' });
}
});
+
+ this.nodes.endBulk();
this.allTags = Array.from(tags).sort();
},
- async fetch<T extends FetchOptions>(opts?: T): Promise<'id' extends keyof T ? Node : Collection<string, Node>> {
- if (opts?.id && !this.nodes.get(opts.id)?.partial) return this.nodes.get(opts.id) as 'id' extends keyof T ? Node : Collection<string, Node>;
+
+ async fetch<T extends FetchOptions>(opts?: T): Promise<'id' extends keyof T ? Node : IndexedCollection> {
+ if (opts?.id && !this.nodes.get(opts.id)?.partial) return this.nodes.get(opts.id) as 'id' extends keyof T ? Node : IndexedCollection;
console.log(`[store/nodes] Fetching nodes with options: ${JSON.stringify(opts)}`);
if (!this.nodes.size) this.isFetching = true;
const request = await makeRequest(`nodes/${opts?.id ? opts.id : 'user/@me'}`, 'GET', {});
@@ -238,22 +218,31 @@ export const useNodesStore = defineStore('nodes', {
const n = this.nodes.get(opts.id);
let shared = false;
if (n) shared = n.shared;
- const updatedNode: Node = { ...(result.node as DB_Node), partial: false, shared: shared, permissions: result.permissions };
+ // Check for orphaned parent_id and detach if necessary
+ let finalParentId = result.node.parent_id;
+ if (finalParentId && !this.nodes.has(finalParentId)) {
+ finalParentId = '';
+ }
+
+ const updatedNode: Node = { ...(result.node as DB_Node), parent_id: finalParentId, partial: false, shared: shared, permissions: result.permissions };
if (!n) this.nodes.set(opts.id, updatedNode);
else this.nodes.set(opts.id, updatedNode);
- return updatedNode as 'id' extends keyof T ? Node : Collection<string, Node>;
+ return updatedNode as 'id' extends keyof T ? Node : IndexedCollection;
} else {
- if (!request.result) return this.nodes as 'id' extends keyof T ? Node : Collection<string, Node>;
+ if (!request.result) return this.nodes as 'id' extends keyof T ? Node : IndexedCollection;
+ this.nodes.startBulk();
for (const node of request.result as DB_Node[]) {
const n = this.nodes.get(node.id);
if (!n) this.nodes.set(node.id, { ...node, partial: true, shared: false, permissions: [] });
else this.nodes.set(node.id, { ...node, partial: true, shared: false, permissions: [] });
}
+ this.nodes.endBulk();
this.recomputeTags();
- return this.nodes as 'id' extends keyof T ? Node : Collection<string, Node>;
+ return this.nodes as 'id' extends keyof T ? Node : IndexedCollection;
}
} else throw request;
},
+
async fetchPublic(id: string): Promise<{ node: Node; children: Node[] } | undefined> {
console.log(`[store/nodes] Fetching public node with id: ${id}`);
const existingDoc = this.public_nodes.get(id);
@@ -275,19 +264,27 @@ export const useNodesStore = defineStore('nodes', {
return { node: fetchedDoc, children };
} else return undefined;
},
- async fetchShared(): Promise<Collection<string, Node>> {
+
+ async fetchShared(): Promise<IndexedCollection> {
console.log(`[store/nodes] Fetching shared nodes`);
const request = await makeRequest(`nodes/shared/@me`, 'GET', {});
if (request.status === 'success') {
- if (!request.result) return this.nodes;
+ if (!request.result) return this.nodes as IndexedCollection;
+ this.nodes.startBulk();
for (const node of request.result as DB_Node[]) {
- if (!this.nodes.has(node.id)) this.nodes.set(node.id, { ...node, partial: true, shared: true, permissions: node.permissions || [] });
+ let finalParentId = node.parent_id;
+ if (finalParentId && !this.nodes.has(finalParentId)) {
+ finalParentId = '';
+ }
+ if (!this.nodes.has(node.id))
+ this.nodes.set(node.id, { ...node, parent_id: finalParentId, partial: true, shared: true, permissions: node.permissions || [] });
else {
const state = this.nodes.get(node.id);
- this.nodes.set(node.id, { ...node, partial: true, shared: state?.shared ?? true, permissions: node.permissions || [] });
+ this.nodes.set(node.id, { ...node, parent_id: finalParentId, partial: true, shared: state?.shared ?? true, permissions: node.permissions || [] });
}
}
- return this.nodes;
+ this.nodes.endBulk();
+ return this.nodes as IndexedCollection;
} else throw request;
},
/**
@@ -311,37 +308,7 @@ export const useNodesStore = defineStore('nodes', {
console.error('[store/nodes] Fulltext search failed:', request.message);
return [];
},
- async addPermission(perm: Omit<Permission, 'id' | 'created_timestamp'>): Promise<Permission> {
- console.log(`[store/nodes/permissions] Adding permission for user ${perm.user_id} on node ${perm.node_id}`);
- const node = this.nodes.get(perm.node_id);
- if (!node) throw 'Node not found in store, cannot add permission';
- const request = await makeRequest(`nodes/${perm.node_id}/permissions`, 'POST', perm);
- if (request.status === 'success') {
- node.permissions.push(request.result as Permission);
- return request.result as Permission;
- } else throw request.message;
- },
- async updatePermission(perm: Permission) {
- console.log(`[store/nodes/permissions] Updating permission for user ${perm.user_id} on node ${perm.node_id}`);
- const node = this.nodes.get(perm.node_id);
- if (!node) throw 'Node not found in store, cannot update permission';
- const request = await makeRequest(`nodes/${perm.node_id}/permissions/${perm.id}`, 'PATCH', { permission: perm.permission });
- if (request.status === 'success') {
- const index = node.permissions.findIndex(p => p.id === perm.id);
- if (index !== -1) node.permissions[index]!.permission = perm.permission;
- } else throw request.message;
- },
- async removePermission(nodeId: string, userId: string) {
- console.log(`[store/nodes/permissions] Removing permission for user ${userId} on node ${nodeId}`);
- const node = this.nodes.get(nodeId);
- if (!node) throw 'Node not found in store, cannot remove permission';
- const perm = node.permissions.find(p => p.user_id === userId);
- if (!perm) throw 'Permission not found in store, cannot remove permission';
- const request = await makeRequest(`nodes/${nodeId}/permissions/${perm.id}`, 'DELETE', {});
- if (request.status === 'success') {
- node.permissions = node.permissions.filter(p => p.id !== perm.id);
- } else throw request.message;
- },
+
async post(node: Partial<Node>): Promise<DB_Node> {
const request = await makeRequest('nodes', 'POST', { ...node, id: undefined });
if (request.status == 'success') {
@@ -349,6 +316,7 @@ export const useNodesStore = defineStore('nodes', {
return request.result as DB_Node;
} else throw request.message;
},
+
async update(node: Node) {
if (node.partial) {
console.log('[store/nodes] Node looks partial, cannot update it directly.');
@@ -359,10 +327,12 @@ export const useNodesStore = defineStore('nodes', {
const request = await makeRequest(`nodes/${node.id}`, 'PUT', node);
if (request.status == 'success') {
node.updated_timestamp = Date.now(); // approximate update time for better UX & backups import
+ if (node.parent_id && !this.nodes.has(node.parent_id)) node.parent_id = ''; // Check for orphaned parent_id and detach if necessary
this.nodes.set(node.id, node);
return this.nodes;
} else throw request.message;
},
+
async duplicate(node: Node): Promise<DB_Node> {
if (!node) throw 'Node not found in store, cannot duplicate';
if (node.partial) {
@@ -389,15 +359,12 @@ export const useNodesStore = defineStore('nodes', {
async delete(id: string) {
const request = await makeRequest(`nodes/${id}`, 'DELETE', {});
if (request.status == 'success') {
- const allChildrens = this.getAllChildrensIds(id);
+ const allChildrens = this.getDescendantIds(id);
this.nodes.delete(id);
allChildrens.forEach(childId => this.nodes.delete(childId));
} else throw request.message;
},
- // Loop through ids and delete them one by one
- // Only update the store after all deletions are successful
- // Return the list of deleted ids and failed ids
async bulkDelete(nodes: Node[]) {
const deletedIds: string[] = [];
const failedIds: { id: string; message: string }[] = [];
@@ -414,18 +381,128 @@ export const useNodesStore = defineStore('nodes', {
}
}
// Update store
+ this.nodes.startBulk();
deletedIds.forEach(id => {
- const allChildrens = this.getAllChildrensIds(id);
+ const allChildrens = this.getDescendantIds(id);
this.nodes.delete(id);
allChildrens.forEach(childId => this.nodes.delete(childId));
});
+ this.nodes.endBulk();
return { deletedIds, failedIds };
},
+ // ********************************** Permissions management **********************************
- /* Backup import helpers */
+ async fetchPermissions(nodeId: string, recursive = false): Promise<Permission[]> {
+ const params = new URLSearchParams({
+ recursive: recursive.toString(),
+ });
+ const request = await makeRequest(`nodes/${nodeId}/permissions?${params.toString()}`, 'GET', {});
+ if (request.status === 'success') {
+ const permissions = request.result as Permission[];
+ if (!permissions || permissions.length === 0) return [];
+ this.nodes.startBulk();
+ for (const perm of permissions) {
+ const node = this.nodes.get(perm.node_id);
+ if (!node) continue;
+ const existingPermIndex = node.permissions.findIndex(p => p.id === perm.id);
+ if (existingPermIndex !== -1) node.permissions[existingPermIndex] = perm;
+ else node.permissions.push(perm);
+ this.nodes.set(node.id, node);
+ }
+ this.nodes.endBulk();
+ return permissions;
+ }
+ console.error('[store/nodes] Fetching permissions failed:', request.message);
+ return [];
+ },
+
+ async addPermission(perm: Omit<Permission, 'id' | 'created_timestamp'>): Promise<Permission> {
+ console.log(`[store/nodes/permissions] Adding permission for user ${perm.user_id} on node ${perm.node_id}`);
+ const node = this.nodes.get(perm.node_id);
+ if (!node) throw 'Node not found in store, cannot add permission';
+ const request = await makeRequest(`nodes/${perm.node_id}/permissions`, 'POST', perm);
+ if (request.status === 'success') {
+ const newPermission = request.result as Permission;
+ this.nodes.set(node.id, {
+ ...node,
+ permissions: [...node.permissions, newPermission],
+ });
+ return newPermission;
+ } else throw request.message;
+ },
+
+ async updatePermission(perm: Permission) {
+ console.log(`[store/nodes/permissions] Updating permission for user ${perm.user_id} on node ${perm.node_id}`);
+ const node = this.nodes.get(perm.node_id);
+ if (!node) throw 'Node not found in store, cannot update permission';
+ const request = await makeRequest(`nodes/${perm.node_id}/permissions/${perm.id}`, 'PATCH', { permission: perm.permission });
+ if (request.status === 'success') {
+ const index = node.permissions.findIndex(p => p.id === perm.id);
+ const newPermissions = [...node.permissions];
+ if (index !== -1 && newPermissions[index]) {
+ newPermissions[index] = { ...newPermissions[index], permission: perm.permission };
+ this.nodes.set(node.id, {
+ ...node,
+ permissions: newPermissions,
+ });
+ }
+ } else throw request.message;
+ },
+
+ async removePermission(perm: Permission) {
+ console.log(`[store/nodes/permissions] Removing permission for user ${perm.user_id} on node ${perm.node_id}`);
+ const node = this.nodes.get(perm.node_id);
+ if (!node) throw 'Node not found in store, cannot remove permission';
+ const request = await makeRequest(`nodes/${perm.node_id}/permissions/${perm.id}`, 'DELETE', {});
+ if (request.status === 'success') {
+ const newPermissions = node.permissions.filter(p => p.id !== perm.id);
+ this.nodes.set(node.id, {
+ ...node,
+ permissions: newPermissions,
+ });
+ } else throw request.message;
+ },
+
+ // ********************************** Invitations management **********************************
+
+ async fetchInvitations(nodeId: string): Promise<NodeInvitation[]> {
+ const request = await makeRequest<NodeInvitation[]>(`nodes/${nodeId}/invitations`, 'GET', {});
+ if (request.status === 'success') {
+ return request.result || [];
+ }
+ throw request.message;
+ },
+
+ async addInvitation(nodeId: string, permission_level: number): Promise<NodeInvitation> {
+ const request = await makeRequest<NodeInvitation>(`nodes/${nodeId}/invitations`, 'POST', { permission_level });
+ if (request.status === 'success') return request.result as NodeInvitation;
+ throw request.message;
+ },
+
+ async removeInvitation(nodeId: string, invitationId: string) {
+ const request = await makeRequest(`nodes/${nodeId}/invitations/${invitationId}`, 'DELETE', {});
+ if (request.status !== 'success') throw request.message;
+ },
+ async joinInvitation(codeOrLink: string): Promise<InvitationJoinResponse> {
+ const request = await makeRequest<InvitationJoinResponse>('nodes/invitations/join', 'POST', { code: codeOrLink });
+ if (request.status === 'success' && request.result) {
+ const { node, permission } = request.result;
+ const existing = this.nodes.get(node.id);
+ this.nodes.set(node.id, {
+ ...(existing || {}),
+ ...node,
+ partial: false,
+ shared: true,
+ permissions: [permission],
+ } as Node);
+ return request.result;
+ }
+ throw request.message;
+ },
+
+ // ********************************** Import management **********************************
// Prepare nodes for import by checking which nodes need to be created or updated
- // Based on node id and updated_timestamp
prepareImport(nodes: DB_Node[]): { toCreate: DB_Node[]; toUpdate: DB_Node[] } {
const toCreate: DB_Node[] = [];
const toUpdate: DB_Node[] = [];
@@ -478,6 +555,7 @@ export const useNodesStore = defineStore('nodes', {
}
}
},
+
async importMultipleNodes(nodes: { toCreate: DB_Node[]; toUpdate: DB_Node[] }, job: Ref<ImportJob>) {
job.value.status = 'in_progress';
try {
diff --git a/frontend/app/stores/preferences/constants.ts b/frontend/app/stores/preferences/constants.ts
index b71f365e..1ebb7954 100644
--- a/frontend/app/stores/preferences/constants.ts
+++ b/frontend/app/stores/preferences/constants.ts
@@ -1,6 +1,6 @@
-import type { TreeNode } from '~/helpers/TreeBuilder';
+import type { TreeItem } from '~/helpers/TreeBuilder';
-export type ANode<ID = string | number> = Omit<TreeNode<unknown, ID>, 'data'>;
+export type ANode<ID = number | string> = Omit<TreeItem<unknown, ID>, 'data' | 'route'>;
export const DEFAULT_PREFERENCES = {
locale: 'en' as 'en' | 'fr',
@@ -33,11 +33,11 @@ export const DEFAULT_PREFERENCES = {
newPage: false as boolean,
} as const,
navbarItems: {
- breadcrumb: true as boolean,
+ breadcrumbNav: false as boolean,
search: true as boolean,
theme: true as boolean,
navigation: true as boolean,
- },
+ } as const,
snippets: [
{ id: '!blue', label: ':::blue\n${0}\n:::' },
{ id: '!green', label: ':::green\n${0}\n:::' },
diff --git a/frontend/app/styles/components/common.scss b/frontend/app/styles/components/common.scss
index 99ca6a75..f9b6c076 100644
--- a/frontend/app/styles/components/common.scss
+++ b/frontend/app/styles/components/common.scss
@@ -19,13 +19,18 @@
// ===========================
// BUTTONS
// ===========================
-.btn-icon {
- padding: 4px;
- border-radius: var(--radius-sm);
- transition: background $transition-fast;
- cursor: pointer;
- &:hover {
- background: var(--surface-transparent);
- }
+
+.header-title {
+ display: flex;
+ font-size: 18px;
+ font-weight: 600;
+ align-items: center;
+ gap: 12px;
+}
+
+.parent-icon {
+ padding: 6px;
+ border-radius: var(--radius-sm);
+ margin-right: 10px;
}
\ No newline at end of file
diff --git a/frontend/app/styles/components/page-components.scss b/frontend/app/styles/components/page-components.scss
index 1fd9ef78..6eb48fb3 100644
--- a/frontend/app/styles/components/page-components.scss
+++ b/frontend/app/styles/components/page-components.scss
@@ -39,7 +39,6 @@
}
.page-subtitle {
- margin: 0 0 1rem;
font-size: 1rem;
color: var(--text-muted);
}
\ No newline at end of file
diff --git a/frontend/bun.lock b/frontend/bun.lock
index 93a1cdca..aa439266 100644
--- a/frontend/bun.lock
+++ b/frontend/bun.lock
@@ -6,11 +6,11 @@
"name": "alexandrie",
"dependencies": {
"@codemirror/autocomplete": "^6.20.3",
- "@codemirror/commands": "^6.10.3",
+ "@codemirror/commands": "^6.10.4",
"@codemirror/lang-markdown": "^6.5.0",
"@codemirror/search": "6.7.0",
- "@codemirror/state": "^6.6.0",
- "@codemirror/view": "^6.43.1",
+ "@codemirror/state": "^6.7.0",
+ "@codemirror/view": "^6.43.3",
"@lezer/highlight": "^1.2.3",
"@nuxt/devtools": "latest",
"@nuxt/eslint": "1.16.0",
@@ -50,9 +50,12 @@
"stylelint-order": "^8.1.1",
"svg-baker": "^1.7.0",
"svgo": "^4.0.1",
- "vue": "^3.5.38",
+ "vue": "^3.5.39",
"vue-router": "^5.1.0",
},
+ "devDependencies": {
+ "vue-tsc": "^3.3.5",
+ },
},
},
"packages": {
@@ -904,6 +907,12 @@
"@vitejs/plugin-vue-jsx": ["@vitejs/[email protected]", "", { "dependencies": { "@babel/core": "^7.29.0", "@babel/plugin-syntax-typescript": "^7.29.7", "@babel/plugin-transform-typescript": "^7.29.7", "@rolldown/pluginutils": "^1.0.1", "@vue/babel-plugin-jsx": "^2.0.1" }, "peerDependencies": { "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0", "vue": "^3.0.0" } }, "sha512-YXvi4as2clxt6DFw5+a0tTA97ntiQXm/raR8ofNj3aNwwdlVGTiG2gp7EvfZW17P50acL/9bP0ccF4XnqNmlgA=="],
+ "@volar/language-core": ["@volar/[email protected]", "", { "dependencies": { "@volar/source-map": "2.4.28" } }, "sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ=="],
+
+ "@volar/source-map": ["@volar/[email protected]", "", {}, "sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ=="],
+
+ "@volar/typescript": ["@volar/[email protected]", "", { "dependencies": { "@volar/language-core": "2.4.28", "path-browserify": "^1.0.1", "vscode-uri": "^3.0.8" } }, "sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw=="],
+
"@vue-macros/common": ["@vue-macros/[email protected]", "", { "dependencies": { "@vue/compiler-sfc": "^3.5.22", "ast-kit": "^2.1.2", "local-pkg": "^1.1.2", "magic-string-ast": "^1.0.2", "unplugin-utils": "^0.3.0" }, "peerDependencies": { "vue": "^2.7.0 || ^3.2.25" }, "optionalPeers": ["vue"] }, "sha512-h9t4ArDdniO9ekYHAD95t9AZcAbb19lEGK+26iAjUODOIJKmObDNBSe4+6ELQAA3vtYiFPPBtHh7+cQCKi3Dng=="],
"@vue/babel-helper-vue-transform-on": ["@vue/[email protected]", "", {}, "sha512-uZ66EaFbnnZSYqYEyplWvn46GhZ1KuYSThdT68p+am7MgBNbQ3hphTL9L+xSIsWkdktwhPYLwPgVWqo96jDdRA=="],
@@ -928,6 +937,8 @@
"@vue/devtools-shared": ["@vue/[email protected]", "", {}, "sha512-Earc/zrg0w0Md4KdrvgRR1vC5F17Zn+VzqTNI7PXYXz0fPJDVWENe7fv6NHi6Ja9Sq6Ce6SYUdc2FlXU0OMkjQ=="],
+ "@vue/language-core": ["@vue/[email protected]", "", { "dependencies": { "@volar/language-core": "2.4.28", "@vue/compiler-dom": "^3.5.0", "@vue/shared": "^3.5.0", "alien-signals": "^3.2.0", "muggle-string": "^0.4.1", "path-browserify": "^1.0.1", "picomatch": "^4.0.4" } }, "sha512-UkKu5nhX89fg4VhlG/FOeI10G3cj/7radKT/cy9BT4Q9qJmJlSTAc/dP63Xqs29aypN4f39xUV6PsLNk/dcD6g=="],
+
"@vue/reactivity": ["@vue/[email protected]", "", { "dependencies": { "@vue/shared": "3.5.39" } }, "sha512-TpsuBJ9gGlZa5d23XcM2y8EXanz9dZeVDQBXRwzy46ItgvM+rWpzs+UVM0wcRLxGvcav0HE5jz2gNL53xlRAog=="],
"@vue/runtime-core": ["@vue/[email protected]", "", { "dependencies": { "@vue/reactivity": "3.5.39", "@vue/shared": "3.5.39" } }, "sha512-9GLtNyRvPAUMbX+7ono0RC2j0guo2LXVi8LvcmAooImACUKm0oFf0jjwbX8/H0AE/t1nxhAkn8RSl9PMCzzxZw=="],
@@ -954,6 +965,8 @@
"ajv": ["[email protected]", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw=="],
+ "alien-signals": ["[email protected]", "", {}, "sha512-I8FjmltrfnDFoZedi5CG8DghVYNhzb/Ijluz7tCSJH0xpd0484Kowhbb1XDYOxfJpU1p5wnM2X54dA+IfGyD1g=="],
+
"ansi-regex": ["[email protected]", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="],
"ansi-styles": ["[email protected]", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],
@@ -1914,6 +1927,8 @@
"pascalcase": ["[email protected]", "", {}, "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw=="],
+ "path-browserify": ["[email protected]", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="],
+
"path-exists": ["[email protected]", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="],
"path-key": ["[email protected]", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],
@@ -2450,6 +2465,8 @@
"vite-plugin-vue-tracer": ["[email protected]", "", { "dependencies": { "estree-walker": "^3.0.3", "exsolve": "^1.0.8", "magic-string": "^0.30.21", "pathe": "^2.0.3", "source-map-js": "^1.2.1" }, "peerDependencies": { "vite": "^6.0.0 || ^7.0.0 || ^8.0.0-0", "vue": "^3.5.0" } }, "sha512-0tQCjCqZWVSK6UeRW9S4ABbf47lKQ68zvrT2FNvZmiL+alDydCVyH/T3Jlfbdc3T3C2Iuyyl5aVsMbF8IQIoxA=="],
+ "vscode-uri": ["[email protected]", "", {}, "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ=="],
+
"vue": ["[email protected]", "", { "dependencies": { "@vue/compiler-dom": "3.5.39", "@vue/compiler-sfc": "3.5.39", "@vue/runtime-dom": "3.5.39", "@vue/server-renderer": "3.5.39", "@vue/shared": "3.5.39" }, "peerDependencies": { "typescript": "*" }, "optionalPeers": ["typescript"] }, "sha512-xmZCYabFGcirU8r0fTuvl/LICc1OU620rnqepaJDL/a141ZigkG7AyaxQLdqJ02ZRYzWe6YPaDHeQx7MfknQfA=="],
"vue-bundle-renderer": ["[email protected]", "", { "dependencies": { "ufo": "^1.6.4" } }, "sha512-7F4LNMopUw5RgYWo4zCmVUHCc6aQRC6dCKHUYkM/n+fux4AUGdL1x6m5A515WWyFysRRN7cx3hBzVqoisfRfzw=="],
@@ -2462,6 +2479,8 @@
"vue-router": ["[email protected]", "", { "dependencies": { "@babel/generator": "^8.0.0-rc.4", "@vue-macros/common": "^3.1.1", "@vue/devtools-api": "^8.1.2", "ast-walker-scope": "^0.9.0", "chokidar": "^5.0.0", "json5": "^2.2.3", "local-pkg": "^1.1.2", "magic-string": "^0.30.21", "mlly": "^1.8.2", "muggle-string": "^0.4.1", "pathe": "^2.0.3", "picomatch": "^4.0.3", "scule": "^1.3.0", "tinyglobby": "^0.2.16", "unplugin": "^3.0.0", "unplugin-utils": "^0.3.1", "yaml": "^2.9.0" }, "peerDependencies": { "@pinia/colada": ">=0.21.2", "@vue/compiler-sfc": "^3.5.34", "pinia": "^3.0.4", "vite": "^7.0.0 || ^8.0.0", "vue": "^3.5.34" }, "optionalPeers": ["@pinia/colada", "@vue/compiler-sfc", "pinia", "vite"] }, "sha512-HAbiLzLEHQwxPgvsbOJDAwtavszEgLwri6XfyrsPECIFez8+59xc9LofWVdc/HEaSRT822lJ8H9Ns38VVond5g=="],
+ "vue-tsc": ["[email protected]", "", { "dependencies": { "@volar/typescript": "2.4.28", "@vue/language-core": "3.3.5" }, "peerDependencies": { "typescript": ">=5.0.0" }, "bin": { "vue-tsc": "bin/vue-tsc.js" } }, "sha512-Rzh/G2MmNlMSAMTiQEjDrsb4dgB/jbtEM47rVN2NtidF1dfb/q4w4QvpQBtW5+y3y5H27Hjh7deVwk+YB02fNg=="],
+
"vue-virtual-scroller": ["[email protected]", "", { "peerDependencies": { "vue": "^3.3.0" } }, "sha512-3qh3c9VUVysuXynaa4fVZ3ncx3VgD7EPRiQcj+jUVZl5u/TTkD3c27XvSEu3JGJfsJt/vVTVziZ3djiiHtW4cQ=="],
"w3c-keyname": ["[email protected]", "", {}, "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ=="],
diff --git a/frontend/i18n/locales/de/cdn.ts b/frontend/i18n/locales/de/cdn.ts
index dd0eac2e..84e03d1a 100644
--- a/frontend/i18n/locales/de/cdn.ts
+++ b/frontend/i18n/locales/de/cdn.ts
@@ -16,7 +16,7 @@ export default {
promptPlural: 'Ziehe deine Dateien hierher oder klicke auf {link}, um sie auszuwählen',
removeFile: 'Datei entfernen',
},
-
+ diagram: 'Diagrammeditor',
edit: {
description: 'Verwalte Ressourcen und Dateien auf dem Server. Du kannst Metadaten bearbeiten und Dateien löschen.',
title: 'Datei aktualisieren',
diff --git a/frontend/i18n/locales/de/common.ts b/frontend/i18n/locales/de/common.ts
index f14ad050..21c98131 100644
--- a/frontend/i18n/locales/de/common.ts
+++ b/frontend/i18n/locales/de/common.ts
@@ -19,9 +19,11 @@ export default {
preview: 'Vorschau',
print: 'Drucken',
reset: 'Zurücksetzen',
+ revoke: 'Widerrufen',
save: 'Speichern',
search: 'Suchen',
share: 'Teilen',
+ toggleFullscreen: 'Vollbild umschalten',
unpin: 'Anheftung aufheben',
update: 'Aktualisieren',
upload: 'Hochladen',
diff --git a/frontend/i18n/locales/de/components.ts b/frontend/i18n/locales/de/components.ts
index 91f1ebdc..d57dd64c 100644
--- a/frontend/i18n/locales/de/components.ts
+++ b/frontend/i18n/locales/de/components.ts
@@ -38,6 +38,7 @@ export default {
},
editor: {
+ title: 'Markdown-Editor',
placeholder: {
title: 'Dokumenttitel',
description: 'Dokumentbeschreibung',
@@ -99,6 +100,7 @@ export default {
},
sidebar: {
+ joinWorkspace: 'Arbeitsbereich beitreten',
allWorkspaces: 'Alle Arbeitsbereiche',
closeAll: 'Alle schließen',
editWorkspace: 'Arbeitsbereich bearbeiten',
@@ -108,6 +110,7 @@ export default {
home: 'Startseite',
imports: 'Importe',
manageCategories: 'Kategorien verwalten',
+ teams: 'Teams',
newPage: 'Neue Seite',
settings: 'Einstellungen',
},
diff --git a/frontend/i18n/locales/de/dashboard.ts b/frontend/i18n/locales/de/dashboard.ts
index 5d7bfac6..1cfdc0fb 100644
--- a/frontend/i18n/locales/de/dashboard.ts
+++ b/frontend/i18n/locales/de/dashboard.ts
@@ -1,17 +1,14 @@
export default {
actions: {
import: 'Importieren',
+ joinWorkspace: 'Arbeitsbereich beitreten',
newDocument: '+ Neues Dokument',
newWorkspace: 'Neuer Arbeitsbereich',
},
+ dashboard: 'Dashboard',
greeting: '👋 Hey, {userName}',
- links: {
- manage: 'Verwalten',
- seeAll: 'Alle anzeigen',
- },
-
pages: {
home: 'Start',
},
diff --git a/frontend/i18n/locales/de/index.ts b/frontend/i18n/locales/de/index.ts
index 95b0968d..4dc62439 100644
--- a/frontend/i18n/locales/de/index.ts
+++ b/frontend/i18n/locales/de/index.ts
@@ -1,3 +1,5 @@
+import type { MessageSchema } from '../../i18n.config';
+
import admin from './admin';
import application from './application';
import cdn from './cdn';
@@ -10,6 +12,7 @@ import nodes from './nodes';
import settings from './settings';
import time from './time';
import user from './user';
+import teams from './teams';
export default {
admin,
@@ -24,4 +27,5 @@ export default {
settings,
time,
user,
-};
+ teams,
+} satisfies MessageSchema;
diff --git a/frontend/i18n/locales/de/nodes.ts b/frontend/i18n/locales/de/nodes.ts
index 973c7843..2328a477 100644
--- a/frontend/i18n/locales/de/nodes.ts
+++ b/frontend/i18n/locales/de/nodes.ts
@@ -1,4 +1,5 @@
export default {
+ nodes: 'Nodes',
actions: {
editMeta: 'Metadaten bearbeiten',
exportAsMarkdown: 'Als Markdown exportieren',
@@ -60,6 +61,16 @@ export default {
title: 'Lösche {type}',
titleBulk: 'Nodes löschen',
},
+ join: {
+ access: 'Zugriff auf Node',
+ title: 'Tritt einem Team oder Arbeitsbereich bei',
+ subtitle:
+ 'Füge einen Einladungscode oder einen vollständigen Einladungslink ein. Wenn du diesem Arbeitsbereich bereits mit einer anderen Berechtigungsstufe beigetreten bist, wird nur die höchste beibehalten.',
+ label: 'Einladungscode oder Link',
+ join: 'Beitreten',
+ joining: 'Beitreten...',
+ inputPlaceholder: 'ABC123 or https://.../join-workspace?code=ABC123',
+ },
metadata: {
emojiOrIcon: 'Emoji oder Symbol',
emojiOrIconHint: 'SVG oder Emojis werden unterstützt',
@@ -71,6 +82,11 @@ export default {
addPermission: 'Hinzufügen',
defaultPermission: 'Standardberechtigung für neue Benutzer',
generalAccess: 'Allgemeiner Zugang',
+ inviteLabel: 'Node-Einladungen',
+ inviteCreate: 'Einladung erstellen',
+ inviteCreateProgress: 'Einladung wird erstellt...',
+ inviteEmpty: 'Noch keine Einladungen',
+ invitePermission: 'Berechtigung',
managePermissions: 'Berechtigungen verwalten',
noPermissions: 'Keine Berechtigungen festgelegt',
noResults: 'Es wurden keine Ergebnisse gefunden',
@@ -96,7 +112,8 @@ export default {
actionCreateDocument: 'Neues Dokument erstellen',
actionCreateDocumentDesc: 'Erstelle ein neues Markdown-Dokument mit den freigegebenen Inhalten',
actionUploadResource: 'Als Ressource hochladen',
- actionUploadResourceDesc: 'Lade die freigegebenen Inhalte als Ressource (Bild, PDF, usw.) hoch und erhalte einen Link, den du in deine Dokumente einfügen kannst',
+ actionUploadResourceDesc:
+ 'Lade die freigegebenen Inhalte als Ressource (Bild, PDF, usw.) hoch und erhalte einen Link, den du in deine Dokumente einfügen kannst',
chooseDestination: 'Wähle aus, wo du diesen Inhalt speichern möchten.',
description: 'Von einer anderen App empfangene Inhalte.',
sharedContent: 'Geteilte Inhalte',
diff --git a/frontend/i18n/locales/de/settings.ts b/frontend/i18n/locales/de/settings.ts
index 7487bc27..9d3b3d3c 100644
--- a/frontend/i18n/locales/de/settings.ts
+++ b/frontend/i18n/locales/de/settings.ts
@@ -17,7 +17,8 @@ export default {
advanced: {
resetLocalStorage: 'Lokalen Speicher zurücksetzen',
resetLocalStorageBtn: 'Lokalen Speicher löschen',
- resetLocalStorageDesc: 'Dies setzt alle deine lokalen Speicherdaten zurück. Diese Aktion kann nicht rückgängig gemacht werden. Einstellungen werden ebenfalls zurückgesetzt.',
+ resetLocalStorageDesc:
+ 'Dies setzt alle deine lokalen Speicherdaten zurück. Diese Aktion kann nicht rückgängig gemacht werden. Einstellungen werden ebenfalls zurückgesetzt.',
resetPreferences: 'Alle Einstellungen zurücksetzen',
resetPreferencesBtn: 'Einstellungen zurücksetzen',
resetPreferencesDesc: 'Dies stellt alle Einstellungen auf ihre Standardwerte zurück. Diese Aktion kann nicht rückgängig gemacht werden.',
@@ -193,6 +194,7 @@ export default {
shortcuts: 'Tastenkombinationen',
snippets: 'Textblöcke',
styles: 'Stilinjektion',
+ teams: 'Teams',
},
profile: {
@@ -254,7 +256,8 @@ export default {
title: 'Sicherheit',
unlink: 'Trennen',
unrecognizedSession: 'Nicht erkannte Sitzung?',
- unrecognizedSessionDesc: 'Wenn du eine Sitzung siehst, die du nicht erkennst, ändere dein Passwort sofort und klicke unten auf „Von allen Geräten abmelden".',
+ unrecognizedSessionDesc:
+ 'Wenn du eine Sitzung siehst, die du nicht erkennst, ändere dein Passwort sofort und klicke unten auf „Von allen Geräten abmelden".',
},
shortcuts: {
diff --git a/frontend/i18n/locales/de/teams.ts b/frontend/i18n/locales/de/teams.ts
new file mode 100644
index 00000000..4684f541
--- /dev/null
+++ b/frontend/i18n/locales/de/teams.ts
@@ -0,0 +1,37 @@
+export default {
+ title: 'Teams',
+ eyebrown: 'Organisationsansicht',
+ subtitle: 'Teams bündeln Arbeitsbereiche, Kategorien, Dokumente und Ressourcen in einer gemeinsamen Organisationsstruktur.',
+
+ actions: {
+ create: 'Team erstellen',
+ createDescription: 'Erstellen Sie das erste Team, um Arbeitsbereiche und Dokumente zu gruppieren',
+ delete: 'Team löschen',
+ addContent: 'Inhalte hinzufügen',
+ },
+ teamsCount: 'Teams',
+ noDescription: 'Noch keine Beschreibung',
+
+ overview: {
+ title: 'Teamübersicht',
+ team: 'Team',
+
+ directItems: 'direkte Elemente',
+ totalNodes: 'Knoten insgesamt',
+
+ homepageNoContentTitle: 'Keine Team-Startseite',
+ homepageNoContent: 'Diese Team-Startseite enthält noch keine Inhalte.',
+ },
+
+ insights: {
+ title: 'Einblicke',
+ trending: 'Im Trend',
+ stats: 'Statistiken',
+ },
+
+ members: {
+ title: 'Teammitglieder verwalten',
+ permissionsTitle: 'Berechtigungen für das gesamte Team verwalten',
+ permissionsDescription: 'Fügen Sie einen neuen Benutzer hinzu und ändern Sie dessen Berechtigungen in der Tabelle.',
+ },
+};
diff --git a/frontend/i18n/locales/en/cdn.ts b/frontend/i18n/locales/en/cdn.ts
index bdd7a302..a9e9a2f1 100644
--- a/frontend/i18n/locales/en/cdn.ts
+++ b/frontend/i18n/locales/en/cdn.ts
@@ -16,7 +16,7 @@ export default {
promptPlural: 'Drag and drop your files here or {link} to select',
removeFile: 'Remove file',
},
-
+ diagram: 'Diagram editor',
edit: {
description: 'Manage resources and files on the server. You can edit metadata and delete files.',
title: 'Update file',
@@ -42,7 +42,7 @@ export default {
empty: 'No files uploaded yet.',
},
- preview: {
+ preview: {
title: 'Preview',
unavailable: 'Preview not available for this file type',
},
diff --git a/frontend/i18n/locales/en/common.ts b/frontend/i18n/locales/en/common.ts
index d5bd41af..a24c9967 100644
--- a/frontend/i18n/locales/en/common.ts
+++ b/frontend/i18n/locales/en/common.ts
@@ -19,9 +19,11 @@ export default {
preview: 'Preview',
print: 'Print',
reset: 'Reset',
+ revoke: 'Revoke',
save: 'Save',
search: 'Search',
share: 'Share',
+ toggleFullscreen: 'Toggle fullscreen',
unpin: 'Unpin from top',
update: 'Update',
upload: 'Upload',
diff --git a/frontend/i18n/locales/en/components.ts b/frontend/i18n/locales/en/components.ts
index d9e2e36e..88de1638 100644
--- a/frontend/i18n/locales/en/components.ts
+++ b/frontend/i18n/locales/en/components.ts
@@ -38,6 +38,7 @@ export default {
},
editor: {
+ title: 'Markdown editor',
placeholder: {
title: 'Document title',
description: 'Document description',
@@ -102,12 +103,14 @@ export default {
allWorkspaces: 'All workspaces',
closeAll: 'Close all',
editWorkspace: 'Edit workspace',
+ joinWorkspace: 'Join workspace',
nav: {
cdn: 'CDN',
documents: 'Documents',
home: 'Home',
imports: 'Imports',
manageCategories: 'Manage categories',
+ teams: 'Teams',
newPage: 'New page',
settings: 'Settings',
},
diff --git a/frontend/i18n/locales/en/dashboard.ts b/frontend/i18n/locales/en/dashboard.ts
index 1aba3821..999c6a40 100644
--- a/frontend/i18n/locales/en/dashboard.ts
+++ b/frontend/i18n/locales/en/dashboard.ts
@@ -1,17 +1,14 @@
export default {
actions: {
import: 'Import',
+ joinWorkspace: 'Join workspace',
newDocument: '+ New document',
newWorkspace: 'New workspace',
},
+ dashboard: 'Dashboard',
greeting: '👋 Hey, {userName}',
- links: {
- manage: 'Manage',
- seeAll: 'See all',
- },
-
pages: {
home: 'Home',
},
diff --git a/frontend/i18n/locales/en/index.ts b/frontend/i18n/locales/en/index.ts
index 95b0968d..ba2191b6 100644
--- a/frontend/i18n/locales/en/index.ts
+++ b/frontend/i18n/locales/en/index.ts
@@ -10,6 +10,7 @@ import nodes from './nodes';
import settings from './settings';
import time from './time';
import user from './user';
+import teams from './teams';
export default {
admin,
@@ -24,4 +25,5 @@ export default {
settings,
time,
user,
+ teams,
};
diff --git a/frontend/i18n/locales/en/nodes.ts b/frontend/i18n/locales/en/nodes.ts
index 2b7b6c9d..030950c6 100644
--- a/frontend/i18n/locales/en/nodes.ts
+++ b/frontend/i18n/locales/en/nodes.ts
@@ -1,4 +1,5 @@
export default {
+ nodes: 'Nodes',
actions: {
editMeta: 'Edit metadata',
exportAsMarkdown: 'Export as Markdown',
@@ -60,6 +61,16 @@ export default {
title: 'Delete {type}',
titleBulk: 'Delete nodes',
},
+ join: {
+ access: 'Node access',
+ title: 'Join a team or workspace',
+ subtitle:
+ 'Paste an invitation code or a full invite link. If you have already joined this workspace with a different permission level, only the highest one will be retained.',
+ label: 'Invitation code or link',
+ join: 'Join',
+ joining: 'Joining...',
+ inputPlaceholder: 'ABC123 or https://.../join-workspace?code=ABC123',
+ },
metadata: {
emojiOrIcon: 'Emoji or icon',
emojiOrIconHint: 'SVG or emojis supported',
@@ -71,6 +82,11 @@ export default {
addPermission: 'Add',
defaultPermission: 'Default permission for new users',
generalAccess: 'General access',
+ inviteLabel: 'Node invitations',
+ inviteCreate: 'Create invitation',
+ inviteCreateProgress: 'Creating invitation...',
+ inviteEmpty: 'No invitations yet',
+ invitePermission: 'Permission',
managePermissions: 'Manage permissions',
noPermissions: 'No permission set',
noResults: 'No results found',
diff --git a/frontend/i18n/locales/en/settings.ts b/frontend/i18n/locales/en/settings.ts
index 90223e70..4b70265f 100644
--- a/frontend/i18n/locales/en/settings.ts
+++ b/frontend/i18n/locales/en/settings.ts
@@ -193,6 +193,7 @@ export default {
shortcuts: 'Shortcuts',
snippets: 'Snippets',
styles: 'Style injection',
+ teams: 'Teams',
},
profile: {
diff --git a/frontend/i18n/locales/en/teams.ts b/frontend/i18n/locales/en/teams.ts
new file mode 100644
index 00000000..01839bfb
--- /dev/null
+++ b/frontend/i18n/locales/en/teams.ts
@@ -0,0 +1,37 @@
+export default {
+ title: 'Teams',
+ eyebrown: 'Organization view',
+ subtitle: 'Teams group workspaces, categories, documents, and resources in one shared organization shell.',
+
+ actions: {
+ create: 'Create team',
+ createDescription: 'Create the first team to start grouping workspaces and documents',
+ delete: 'Delete team',
+ addContent: 'Add content',
+ },
+ teamsCount: 'teams',
+ noDescription: 'No description yet',
+
+ overview: {
+ title: 'Team overview',
+ team: 'Team',
+
+ directItems: 'direct items',
+ totalNodes: 'total nodes',
+
+ homepageNoContentTitle: 'No team homepage',
+ homepageNoContent: 'There is no content in this team homepage yet.',
+ },
+
+ insights: {
+ title: 'Insights',
+ trending: 'Trending',
+ stats: 'Stats',
+ },
+
+ members: {
+ title: 'Manage team members',
+ permissionsTitle: 'Manage permissions in entire team',
+ permissionsDescription: "Add a new user and change it's permissions in the table.",
+ },
+};
diff --git a/frontend/i18n/locales/fr/cdn.ts b/frontend/i18n/locales/fr/cdn.ts
index 1c54e29c..6a630c42 100644
--- a/frontend/i18n/locales/fr/cdn.ts
+++ b/frontend/i18n/locales/fr/cdn.ts
@@ -16,7 +16,7 @@ export default {
promptPlural: 'Glissez-déposez vos fichiers ici ou {link} pour sélectionner',
removeFile: 'Supprimer le fichier',
},
-
+ diagram: 'Éditeur de diagramme',
edit: {
description: 'Gérer les ressources et fichiers sur le serveur. Vous pouvez modifier les métadonnées et supprimer des fichiers du serveur.',
title: 'Mettre à jour le fichier',
@@ -48,4 +48,4 @@ export default {
},
storageUsed: 'Espace utilisé',
-};
\ No newline at end of file
+};
diff --git a/frontend/i18n/locales/fr/common.ts b/frontend/i18n/locales/fr/common.ts
index dba263e7..e13de263 100644
--- a/frontend/i18n/locales/fr/common.ts
+++ b/frontend/i18n/locales/fr/common.ts
@@ -19,9 +19,11 @@ export default {
preview: 'Aperçu',
print: 'Imprimer',
reset: 'Réinitialiser',
+ revoke: 'Révoquer',
save: 'Enregistrer',
search: 'Rechercher',
share: 'Partager',
+ toggleFullscreen: 'Basculer en plein écran',
unpin: 'Détacher du haut',
update: 'Mettre à jour',
upload: 'Téléverser',
diff --git a/frontend/i18n/locales/fr/components.ts b/frontend/i18n/locales/fr/components.ts
index 2715a940..87fd6236 100644
--- a/frontend/i18n/locales/fr/components.ts
+++ b/frontend/i18n/locales/fr/components.ts
@@ -38,6 +38,7 @@ export default {
},
editor: {
+ title: 'Éditeur Markdown',
placeholder: {
title: 'Document title',
description: 'Document description',
@@ -99,6 +100,7 @@ export default {
},
sidebar: {
+ joinWorkspace: "Rejoindre l'espace de travail",
allWorkspaces: 'Tous les espaces de travail',
closeAll: 'Tout fermer',
editWorkspace: "Modifier l'espace de travail",
@@ -108,6 +110,7 @@ export default {
home: 'Accueil',
imports: 'Importations',
manageCategories: 'Gérer les catégories',
+ teams: 'Teams',
newPage: 'Nouvelle page',
settings: 'Paramètres',
},
diff --git a/frontend/i18n/locales/fr/dashboard.ts b/frontend/i18n/locales/fr/dashboard.ts
index 5cbab4ee..3a0831a2 100644
--- a/frontend/i18n/locales/fr/dashboard.ts
+++ b/frontend/i18n/locales/fr/dashboard.ts
@@ -1,17 +1,14 @@
export default {
actions: {
import: 'Importer',
+ joinWorkspace: 'Rejoindre un espace de travail',
newDocument: '+ Nouveau document',
newWorkspace: 'Nouvel espace de travail',
},
+ dashboard: 'Tableau de bord',
greeting: '👋 Hey, {userName}',
- links: {
- manage: 'Gérer',
- seeAll: 'Voir tout',
- },
-
pages: {
home: 'Accueil',
},
diff --git a/frontend/i18n/locales/fr/index.ts b/frontend/i18n/locales/fr/index.ts
index 8db06015..4dc62439 100644
--- a/frontend/i18n/locales/fr/index.ts
+++ b/frontend/i18n/locales/fr/index.ts
@@ -12,18 +12,20 @@ import nodes from './nodes';
import settings from './settings';
import time from './time';
import user from './user';
+import teams from './teams';
export default {
- admin,
- application,
- cdn,
- common,
- components,
- dashboard,
- import: importPage,
- markdown,
- nodes,
- settings,
- time,
- user,
-} as MessageSchema;
+ admin,
+ application,
+ cdn,
+ common,
+ components,
+ dashboard,
+ import: importPage,
+ markdown,
+ nodes,
+ settings,
+ time,
+ user,
+ teams,
+} satisfies MessageSchema;
diff --git a/frontend/i18n/locales/fr/nodes.ts b/frontend/i18n/locales/fr/nodes.ts
index 85d9723a..174c67d7 100644
--- a/frontend/i18n/locales/fr/nodes.ts
+++ b/frontend/i18n/locales/fr/nodes.ts
@@ -1,4 +1,5 @@
export default {
+ nodes: 'Nœuds',
actions: {
editMeta: 'Modifier les métadonnées',
exportAsMarkdown: 'Exporter en Markdown',
@@ -60,6 +61,16 @@ export default {
title: 'Supprimer {type}',
titleBulk: 'Supprimer les nœuds',
},
+ join: {
+ access: 'Accès au nœud',
+ title: 'Rejoindre une équipe ou un espace de travail',
+ subtitle:
+ "Coller un code d'invitation ou un lien d'invitation complet. Si vous avez déjà rejoint cet espace de travail avec un niveau de permission différent, seul le plus élevé sera conservé.",
+ label: "Code d'invitation ou lien",
+ join: 'Rejoindre',
+ joining: 'Rejoindre...',
+ inputPlaceholder: 'ABC123 ou https://.../join-workspace?code=ABC123',
+ },
metadata: {
emojiOrIcon: 'Emoji ou icône',
emojiOrIconHint: 'SVG ou emojis supportés',
@@ -71,6 +82,11 @@ export default {
addPermission: 'Ajouter',
defaultPermission: 'Permission par défaut pour les nouveaux utilisateurs',
generalAccess: 'Accès général',
+ inviteLabel: 'Invitations au nœud',
+ inviteCreate: 'Créer une invitation',
+ inviteCreateProgress: "Création de l'invitation...",
+ inviteEmpty: 'Aucune invitation pour le moment',
+ invitePermission: 'Permission',
managePermissions: 'Gérer les permissions',
noPermissions: 'Aucune permission définie',
noResults: 'Aucun résultat trouvé',
diff --git a/frontend/i18n/locales/fr/settings.ts b/frontend/i18n/locales/fr/settings.ts
index 83ad9977..b3d97892 100644
--- a/frontend/i18n/locales/fr/settings.ts
+++ b/frontend/i18n/locales/fr/settings.ts
@@ -194,6 +194,7 @@ export default {
shortcuts: 'Raccourcis',
snippets: 'Snippets',
styles: 'Injection de styles',
+ teams: 'Équipes',
},
profile: {
diff --git a/frontend/i18n/locales/fr/teams.ts b/frontend/i18n/locales/fr/teams.ts
new file mode 100644
index 00000000..d82a5612
--- /dev/null
+++ b/frontend/i18n/locales/fr/teams.ts
@@ -0,0 +1,37 @@
+export default {
+ title: 'Équipes',
+ eyebrown: "Vue de l'organisation",
+ subtitle: 'Les équipes regroupent les espaces de travail, catégories, documents et ressources dans une structure organisationnelle partagée.',
+
+ actions: {
+ create: 'Créer une équipe',
+ createDescription: 'Créez la première équipe pour commencer à regrouper les espaces de travail et les documents',
+ delete: "Supprimer l'équipe",
+ addContent: 'Ajouter du contenu',
+ },
+ teamsCount: 'équipes',
+ noDescription: 'Aucune description pour le moment',
+
+ overview: {
+ title: "Vue d'ensemble de l'équipe",
+ team: 'Équipe',
+
+ directItems: 'éléments directs',
+ totalNodes: 'nœuds au total',
+
+ homepageNoContentTitle: "Aucune page d'accueil d'équipe",
+ homepageNoContent: "Cette page d'accueil d'équipe ne contient encore aucun contenu.",
+ },
+
+ insights: {
+ title: 'Analyses',
+ trending: 'Tendances',
+ stats: 'Statistiques',
+ },
+
+ members: {
+ title: "Gérer les membres de l'équipe",
+ permissionsTitle: "Gérer les autorisations de toute l'équipe",
+ permissionsDescription: 'Ajoutez un nouvel utilisateur et modifiez ses autorisations dans le tableau.',
+ },
+};
diff --git a/frontend/i18n/locales/uk/admin.ts b/frontend/i18n/locales/uk/admin.ts
index 92ba9d61..7f89d458 100644
--- a/frontend/i18n/locales/uk/admin.ts
+++ b/frontend/i18n/locales/uk/admin.ts
@@ -2,7 +2,7 @@ export default {
dashboard: {
cards: {
totalNodes: 'Загальна кількість файлів',
- totalStorage: 'Загальний обсяг пам\'яті',
+ totalStorage: "Загальний обсяг пам'яті",
totalUsers: 'Загальна кількість користувачів',
},
charts: {
@@ -17,7 +17,7 @@ export default {
byNodes: 'Найактивніші користувачі за кількістю файлів',
byStorage: 'Користувачі з найбільшим обсягом використаного місця',
nodes: 'Файли',
- storage: 'Пам\`ять',
+ storage: 'Пам`ять',
user: 'Користувач',
},
title: 'Панель адміністратора',
@@ -28,9 +28,9 @@ export default {
action: 'Дія',
createdAt: 'Створено',
email: 'Електронна пошта',
- firstname: 'Ім\'я',
+ firstname: "Ім'я",
lastname: 'Прізвище',
- name: 'Ім\'я',
+ name: "Ім'я",
role: 'Роль',
},
noUsers: 'Користувачів не знайдено.',
diff --git a/frontend/i18n/locales/uk/cdn.ts b/frontend/i18n/locales/uk/cdn.ts
index e7ebaaa1..80e0cd7c 100644
--- a/frontend/i18n/locales/uk/cdn.ts
+++ b/frontend/i18n/locales/uk/cdn.ts
@@ -16,7 +16,7 @@ export default {
promptPlural: 'Перетягніть файли сюди або {link}, щоб вибрати',
removeFile: 'Видалити файл',
},
-
+ diagram: 'Редактор діаграм',
edit: {
description: 'Керуйте ресурсами та файлами на сервері. Ви можете редагувати метадані та видаляти файли.',
title: 'Оновити файл',
diff --git a/frontend/i18n/locales/uk/common.ts b/frontend/i18n/locales/uk/common.ts
index b08be8e1..8083cd53 100644
--- a/frontend/i18n/locales/uk/common.ts
+++ b/frontend/i18n/locales/uk/common.ts
@@ -19,9 +19,11 @@ export default {
preview: 'Попередній перегляд',
print: 'Друк',
reset: 'Скинути',
+ revoke: 'Відкликати',
save: 'Зберегти',
search: 'Пошук',
share: 'Поділитися',
+ toggleFullscreen: 'Перемкнути повноекранний режим',
unpin: 'Відкріпити',
update: 'Оновити',
upload: 'Завантажити',
diff --git a/frontend/i18n/locales/uk/components.ts b/frontend/i18n/locales/uk/components.ts
index 46cdd18c..9fb070b0 100644
--- a/frontend/i18n/locales/uk/components.ts
+++ b/frontend/i18n/locales/uk/components.ts
@@ -38,6 +38,7 @@ export default {
},
editor: {
+ title: 'Редактор Markdown',
placeholder: {
title: 'Назва документа',
description: 'Опис документа',
@@ -99,6 +100,7 @@ export default {
},
sidebar: {
+ joinWorkspace: 'Приєднатися до простору',
allWorkspaces: 'Усі простори',
closeAll: 'Закрити все',
editWorkspace: 'Редагувати простір',
@@ -108,6 +110,7 @@ export default {
home: 'Головна',
imports: 'Імпортування',
manageCategories: 'Категорії',
+ teams: 'Команди',
newPage: 'Нова сторінка',
settings: 'Налаштування',
},
diff --git a/frontend/i18n/locales/uk/dashboard.ts b/frontend/i18n/locales/uk/dashboard.ts
index 04b17fa9..c3fcae78 100644
--- a/frontend/i18n/locales/uk/dashboard.ts
+++ b/frontend/i18n/locales/uk/dashboard.ts
@@ -1,17 +1,14 @@
export default {
actions: {
import: 'Імпорт',
+ joinWorkspace: 'Приєднатися до робочого простору',
newDocument: '+ Новий документ',
newWorkspace: 'Новий простір',
},
+ dashboard: 'Панель керування',
greeting: '👋 Привіт, {userName}',
- links: {
- manage: 'Керувати',
- seeAll: 'Переглянути все',
- },
-
pages: {
home: 'Головна',
},
diff --git a/frontend/i18n/locales/uk/index.ts b/frontend/i18n/locales/uk/index.ts
index 95b0968d..4dc62439 100644
--- a/frontend/i18n/locales/uk/index.ts
+++ b/frontend/i18n/locales/uk/index.ts
@@ -1,3 +1,5 @@
+import type { MessageSchema } from '../../i18n.config';
+
import admin from './admin';
import application from './application';
import cdn from './cdn';
@@ -10,6 +12,7 @@ import nodes from './nodes';
import settings from './settings';
import time from './time';
import user from './user';
+import teams from './teams';
export default {
admin,
@@ -24,4 +27,5 @@ export default {
settings,
time,
user,
-};
+ teams,
+} satisfies MessageSchema;
diff --git a/frontend/i18n/locales/uk/nodes.ts b/frontend/i18n/locales/uk/nodes.ts
index a42772ee..eb2479ba 100644
--- a/frontend/i18n/locales/uk/nodes.ts
+++ b/frontend/i18n/locales/uk/nodes.ts
@@ -1,4 +1,5 @@
export default {
+ nodes: 'Вузли',
actions: {
editMeta: 'Редагувати метадані',
exportAsMarkdown: 'Експортувати як Markdown',
@@ -60,6 +61,16 @@ export default {
title: 'Видалити {type}',
titleBulk: 'Видалити вузли',
},
+ join: {
+ access: 'Доступ до вузла',
+ title: 'Приєднатися до команди або простору',
+ subtitle:
+ 'Вставте код запрошення або повне посилання на запрошення. Якщо ви вже приєдналися до цього простору з іншим рівнем дозволу, буде збережено лише найвищий.',
+ label: 'Код запрошення або посилання',
+ join: 'Приєднатися',
+ joining: 'Приєднання...',
+ inputPlaceholder: 'ABC123 or https://.../join-workspace?code=ABC123',
+ },
metadata: {
emojiOrIcon: 'Емоджі або іконка',
emojiOrIconHint: 'Підтримуються SVG та емоджі',
@@ -71,12 +82,17 @@ export default {
addPermission: 'Додати',
defaultPermission: 'Права доступу за замовчуванням для нових користувачів',
generalAccess: 'Загальний доступ',
+ inviteLabel: 'Запрошення до вузла',
+ inviteCreate: 'Створити запрошення',
+ inviteCreateProgress: 'Створення запрошення...',
+ inviteEmpty: 'Поки немає запрошень',
+ invitePermission: 'Права доступу',
managePermissions: 'Керувати правами доступу',
noPermissions: 'Права доступу не встановлено',
noResults: 'Результатів не знайдено',
publicInfo: 'Цей документ буде загальнодоступний за унікальним посиланням.',
removePermission: 'Видалити права доступу',
- searchPlaceholder: 'Ім\'я користувача або email',
+ searchPlaceholder: "Ім'я користувача або email",
searchUser: 'Знайти користувача',
shareLink: 'Поділіться цим посиланням, щоб будь-хто міг переглянути документ без облікового запису:',
title: 'Керувати правами доступу',
diff --git a/frontend/i18n/locales/uk/settings.ts b/frontend/i18n/locales/uk/settings.ts
index fb3548da..1312ec41 100644
--- a/frontend/i18n/locales/uk/settings.ts
+++ b/frontend/i18n/locales/uk/settings.ts
@@ -2,7 +2,7 @@ export default {
about: {
changelog: 'Зміни',
client: 'Клієнт',
- contact: 'Якщо у вас є запитання, пропозиції або ви знайшли помилку, зв\'яжіться з нами! Ви можете створити issue в',
+ contact: "Якщо у вас є запитання, пропозиції або ви знайшли помилку, зв'яжіться з нами! Ви можете створити issue в",
description: 'Alexandrie — це інструмент для управління особистими знаннями, створений для ефективної організації та пошуку нотаток.',
features: 'Він надає такі функції, як організація документів, тегування та розширений пошук.',
githubRepo: 'GitHub-репозиторій',
@@ -114,7 +114,8 @@ export default {
documentDefaultThumbnail: 'Мініатюра за замовчуванням',
documentDefaultThumbnailDesc: 'Показувати мініатюру за замовчуванням для документів без мініатюри, використовуючи стандартну іконку документа.',
documentUseParentThumbnail: 'Використовувати мініатюру батьківського елемента',
- documentUseParentThumbnailDesc: "Для документів, які не мають власних мініатюр, відображати мініатюру батьківського документа. Якщо батьківський документ також не має мініатюру, відображати мініатюру за замовчуванням.",
+ documentUseParentThumbnailDesc:
+ 'Для документів, які не мають власних мініатюр, відображати мініатюру батьківського документа. Якщо батьківський документ також не має мініатюру, відображати мініатюру за замовчуванням.',
enablePrintMode: 'Увімкнути режим друку',
enablePrintModeDesc: 'Спростити заголовок документа при друку (прибрати мініатюру, теги та опис)',
hideTOC: 'Сховати зміст',
@@ -192,13 +193,14 @@ export default {
shortcuts: 'Гарячі клавіші',
snippets: 'Фрагменти',
styles: 'Впровадження стилів',
+ teams: 'Команди',
},
profile: {
accountCreation: 'Акаунт створено',
avatar: 'Аватар',
email: 'Електронна пошта',
- firstname: 'Ім\'я',
+ firstname: "Ім'я",
lastname: 'Прізвище',
lastUpdate: 'Остання зміна',
notifications: {
@@ -207,7 +209,7 @@ export default {
},
subtitle: 'Керуйте налаштуваннями та параметрами свого профілю.',
title: 'Мій профіль',
- username: 'Ім\'я користувача',
+ username: "Ім'я користувача",
},
security: {
@@ -217,12 +219,12 @@ export default {
changePassword: 'Змінити пароль',
confirmPassword: 'Підтвердити пароль',
connected: 'Підключено',
- connectedAccounts: 'Пов\'язані акаунти',
- connectedAccountsDesc: 'Прив\'яжіть зовнішні акаунти для зручнішого входу.',
+ connectedAccounts: "Пов'язані акаунти",
+ connectedAccountsDesc: "Прив'яжіть зовнішні акаунти для зручнішого входу.",
dangerZone: 'Небезпечна зона',
dangerZoneDesc: 'Незворотні дії. Будьте обережні.',
deleteAccount: 'Видалити обліковий запис',
- deleteAccountDesc: 'Назавжди видалити ваш обліковий запис та всі пов\'язані дані. Цю дію не можна скасувати.',
+ deleteAccountDesc: "Назавжди видалити ваш обліковий запис та всі пов'язані дані. Цю дію не можна скасувати.",
deleteAccountDetails: 'Що буде видалено?',
deleteAccountList: {
data: 'Усі дані вашого облікового запису (налаштування, профіль...)',
@@ -231,7 +233,7 @@ export default {
uploads: 'Усі ваші завантаження',
},
link: 'Посилання',
- loadingAccounts: 'Завантаження пов\'язаних акаунтів...',
+ loadingAccounts: "Завантаження пов'язаних акаунтів...",
logout: 'Вийти',
logoutAll: 'Вийти з усіх пристроїв',
logoutAllDesc: 'Завершити всі активні сесії на всіх пристроях. Вас буде перенаправлено на сторінку входу. Переконайтеся, що зберегли свою роботу.',
@@ -241,17 +243,17 @@ export default {
noSessions: 'Активних сесій не знайдено.',
notConnected: 'Не підключено',
notifications: {
- accountUnlinked: 'Акаунт {provider} від\'єднано',
- linkError: 'Не вдалося ініціювати прив\'язку акаунту',
+ accountUnlinked: "Акаунт {provider} від'єднано",
+ linkError: "Не вдалося ініціювати прив'язку акаунту",
passwordChanged: 'Пароль успішно змінено',
passwordError: 'Помилка збереження пароля',
- unlinkError: 'Не вдалося від\'єднати акаунт',
+ unlinkError: "Не вдалося від'єднати акаунт",
},
password: 'Пароль',
passwordNotMatch: 'Паролі не збігаються!',
subtitle: 'Керуйте налаштуваннями безпеки та відстежуйте активність облікового запису.',
title: 'Безпека',
- unlink: 'Від\'єднати',
+ unlink: "Від'єднати",
unrecognizedSession: 'Сесія не розпізнана?',
unrecognizedSessionDesc: 'Якщо ви бачите сесію, яку не впізнаєте, негайно змініть пароль і натисніть «Вийти з усіх пристроїв» нижче.',
},
@@ -300,7 +302,7 @@ export default {
alreadyExists: 'Такий ярлик вже існує',
content: 'Вміст фрагмента',
contentPlaceholder: 'Вміст фрагмента...\nВикористовуйте ${0}, ${1} для табуляції',
- required: 'Ярлик та вміст є обов\'язковими',
+ required: "Ярлик та вміст є обов'язковими",
restoreDefaults: 'Відновити за замовчуванням',
restoreDefaultsConfirm: 'Ви впевнені, що хочете відновити фрагменти за замовчуванням?',
shortcut: 'Ярлик',
diff --git a/frontend/i18n/locales/uk/teams.ts b/frontend/i18n/locales/uk/teams.ts
new file mode 100644
index 00000000..71d8ef85
--- /dev/null
+++ b/frontend/i18n/locales/uk/teams.ts
@@ -0,0 +1,37 @@
+export default {
+ title: 'Команди',
+ eyebrown: 'Перегляд організації',
+ subtitle: 'Команди об’єднують робочі простори, категорії, документи та ресурси в єдиній організаційній структурі.',
+
+ actions: {
+ create: 'Створити команду',
+ createDescription: 'Створіть першу команду, щоб почати групувати робочі простори та документи',
+ delete: 'Видалити команду',
+ addContent: 'Додати вміст',
+ },
+ teamsCount: 'команди',
+ noDescription: 'Опис ще не додано',
+
+ overview: {
+ title: 'Огляд команди',
+ team: 'Команда',
+
+ directItems: 'безпосередні елементи',
+ totalNodes: 'усього вузлів',
+
+ homepageNoContentTitle: 'Немає головної сторінки команди',
+ homepageNoContent: 'Головна сторінка цієї команди поки не містить вмісту.',
+ },
+
+ insights: {
+ title: 'Аналітика',
+ trending: 'Популярне',
+ stats: 'Статистика',
+ },
+
+ members: {
+ title: 'Керування учасниками команди',
+ permissionsTitle: 'Керування дозволами для всієї команди',
+ permissionsDescription: 'Додайте нового користувача та змініть його дозволи в таблиці.',
+ },
+};
diff --git a/frontend/package.json b/frontend/package.json
index b8b6270d..99ecc491 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -62,5 +62,8 @@
"preview": "nuxt preview",
"postinstall": "nuxt prepare"
},
- "type": "module"
+ "type": "module",
+ "devDependencies": {
+ "vue-tsc": "^3.3.5"
+ }
}
diff --git a/frontend/public/app-icons/burger.svg b/frontend/public/app-icons/burger.svg
new file mode 100644
index 00000000..d33908d6
--- /dev/null
+++ b/frontend/public/app-icons/burger.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M120-240v-80h720v80H120Zm0-200v-80h720v80H120Zm0-200v-80h720v80H120Z" /></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/insights.svg b/frontend/public/app-icons/insights.svg
new file mode 100644
index 00000000..dedae691
--- /dev/null
+++ b/frontend/public/app-icons/insights.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m105-399-65-47 200-320 120 140 160-260 120 180 135-214 65 47-198 314-119-179-152 247-121-141-145 233Zm475 159q42 0 71-29t29-71q0-42-29-71t-71-29q-42 0-71 29t-29 71q0 42 29 71t71 29ZM784-80 676-188q-21 14-45.5 21t-50.5 7q-75 0-127.5-52.5T400-340q0-75 52.5-127.5T580-520q75 0 127.5 52.5T760-340q0 26-7 50.5T732-244l108 108-56 56Z"/></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/join.svg b/frontend/public/app-icons/join.svg
new file mode 100644
index 00000000..f81b73da
--- /dev/null
+++ b/frontend/public/app-icons/join.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M500-482q29-32 44.5-73t15.5-85q0-44-15.5-85T500-798q60 8 100 53t40 105q0 60-40 105t-100 53Zm220 322v-120q0-36-16-68.5T662-406q51 18 94.5 46.5T800-280v120h-80Zm80-280v-80h-80v-80h80v-80h80v80h80v80h-80v80h-80Zm-593-87q-47-47-47-113t47-113q47-47 113-47t113 47q47 47 47 113t-47 113q-47 47-113 47t-113-47ZM0-160v-112q0-34 17.5-62.5T64-378q62-31 126-46.5T320-440q66 0 130 15.5T576-378q29 15 46.5 43.5T640-272v112H0Zm320-400q33 0 56.5-23.5T400-640q0-33-23.5-56.5T320-720q-33 0-56.5 23.5T240-640q0 33 23.5 56.5T320-560ZM80-240h480v-32q0-11-5.5-20T540-306q-54-27-109-40.5T320-360q-56 0-111 13.5T100-306q-9 5-14.5 14T80-272v32Zm240-400Zm0 400Z"/></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/left_arrow.svg b/frontend/public/app-icons/left_arrow.svg
new file mode 100644
index 00000000..0c7ff74f
--- /dev/null
+++ b/frontend/public/app-icons/left_arrow.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z" /></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/nav_arrow.svg b/frontend/public/app-icons/nav_arrow.svg
new file mode 100644
index 00000000..73c6ae19
--- /dev/null
+++ b/frontend/public/app-icons/nav_arrow.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" ><path d="M480-360 280-560h400L480-360Z" /></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/nodes.svg b/frontend/public/app-icons/nodes.svg
new file mode 100644
index 00000000..3ae0c289
--- /dev/null
+++ b/frontend/public/app-icons/nodes.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M155-75q-35-35-35-85t35-85q35-35 85-35 14 0 26 3t23 8l57-71q-28-31-39-70t-5-78l-81-27q-17 25-43 40t-58 15q-50 0-85-35T0-580q0-50 35-85t85-35q50 0 85 35t35 85v8l81 28q20-36 53.5-61t75.5-32v-87q-39-11-64.5-42.5T360-840q0-50 35-85t85-35q50 0 85 35t35 85q0 42-26 73.5T510-724v87q42 7 75.5 32t53.5 61l81-28v-8q0-50 35-85t85-35q50 0 85 35t35 85q0 50-35 85t-85 35q-32 0-58.5-15T739-515l-81 27q6 39-5 77.5T614-340l57 70q11-5 23-7.5t26-2.5q50 0 85 35t35 85q0 50-35 85t-85 35q-50 0-85-35t-35-85q0-20 6.5-38.5T624-232l-57-71q-41 23-87.5 23T392-303l-56 71q11 15 17.5 33.5T360-160q0 50-35 85t-85 35q-50 0-85-35Zm-35-465q17 0 28.5-11.5T160-580q0-17-11.5-28.5T120-620q-17 0-28.5 11.5T80-580q0 17 11.5 28.5T120-540Zm148.5 408.5Q280-143 280-160t-11.5-28.5Q257-200 240-200t-28.5 11.5Q200-177 200-160t11.5 28.5Q223-120 240-120t28.5-11.5Zm240-680Q520-823 520-840t-11.5-28.5Q497-880 480-880t-28.5 11.5Q440-857 440-840t11.5 28.5Q463-800 480-800t28.5-11.5ZM480-360q42 0 71-29t29-71q0-42-29-71t-71-29q-42 0-71 29t-29 71q0 42 29 71t71 29Zm268.5 228.5Q760-143 760-160t-11.5-28.5Q737-200 720-200t-28.5 11.5Q680-177 680-160t11.5 28.5Q703-120 720-120t28.5-11.5Zm120-420Q880-563 880-580t-11.5-28.5Q857-620 840-620t-28.5 11.5Q800-597 800-580t11.5 28.5Q823-540 840-540t28.5-11.5ZM480-840ZM120-580Zm360 120Zm360-120ZM240-160Zm480 0Z"/></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/organization.svg b/frontend/public/app-icons/organization.svg
new file mode 100644
index 00000000..fc36d436
--- /dev/null
+++ b/frontend/public/app-icons/organization.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M80-120v-720h400v160h400v560H80Zm80-80h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm160 480h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm0-160h80v-80h-80v80Zm160 480h320v-400H480v80h80v80h-80v80h80v80h-80v80Zm160-240v-80h80v80h-80Zm0 160v-80h80v80h-80Z"/></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/owner.svg b/frontend/public/app-icons/owner.svg
new file mode 100644
index 00000000..78e5fb98
--- /dev/null
+++ b/frontend/public/app-icons/owner.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M200-160v-80h560v80H200Zm0-140-51-321q-2 0-4.5.5t-4.5.5q-25 0-42.5-17.5T80-680q0-25 17.5-42.5T140-740q25 0 42.5 17.5T200-680q0 7-1.5 13t-3.5 11l125 56 125-171q-11-8-18-21t-7-28q0-25 17.5-42.5T480-880q25 0 42.5 17.5T540-820q0 15-7 28t-18 21l125 171 125-56q-2-5-3.5-11t-1.5-13q0-25 17.5-42.5T820-740q25 0 42.5 17.5T880-680q0 25-17.5 42.5T820-620q-2 0-4.5-.5t-4.5-.5l-51 321H200Zm68-80h424l26-167-105 46-133-183-133 183-105-46 26 167Zm212 0Z"/></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/right_arrow.svg b/frontend/public/app-icons/right_arrow.svg
new file mode 100644
index 00000000..918d1f2a
--- /dev/null
+++ b/frontend/public/app-icons/right_arrow.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z" /></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/theme_dark.svg b/frontend/public/app-icons/theme_dark.svg
new file mode 100644
index 00000000..3a9c1a14
--- /dev/null
+++ b/frontend/public/app-icons/theme_dark.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" stroke="#fff"><g stroke-width="0" /><g stroke-linecap="round" stroke-linejoin="round" /><g> <path d="M3.32031 11.6835C3.32031 16.6541 7.34975 20.6835 12.3203 20.6835C16.1075 20.6835 19.3483 18.3443 20.6768 15.032C19.6402 15.4486 18.5059 15.6834 17.3203 15.6834C12.3497 15.6834 8.32031 11.654 8.32031 6.68342C8.32031 5.50338 8.55165 4.36259 8.96453 3.32996C5.65605 4.66028 3.32031 7.89912 3.32031 11.6835Z" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></g></svg>
\ No newline at end of file
diff --git a/frontend/public/app-icons/theme_light.svg b/frontend/public/app-icons/theme_light.svg
new file mode 100644
index 00000000..d3b96d37
--- /dev/null
+++ b/frontend/public/app-icons/theme_light.svg
@@ -0,0 +1 @@
+ <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-width="0" /><g stroke-linecap="round" stroke-linejoin="round" /><g> <path d="M12 3V4M12 20V21M4 12H3M6.31412 6.31412L5.5 5.5M17.6859 6.31412L18.5 5.5M6.31412 17.69L5.5 18.5001M17.6859 17.69L18.5 18.5001M21 12H20M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /></g></svg>
\ No newline at end of file