Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Q: is it possible to represent nested Organizations #111

Open
nickgarber opened this issue Jul 17, 2023 · 3 comments
Open

Q: is it possible to represent nested Organizations #111

nickgarber opened this issue Jul 17, 2023 · 3 comments

Comments

@nickgarber
Copy link

Q: is it possible to represent nested Organizations, such as a Team within a Department within an Enterprise

From a Team Org, I tried to insert a role to a Department Org and received an error message:

cl-no-applicable-method: No Applicable method: ebdb-record-related, nil, #s(ebdb-field-role nil nil nil nil nil nil)

@girzel
Copy link
Owner

girzel commented Jul 19, 2023

In principle there's no real barrier to doing this, one small adjustment to the code makes it possible, with the patch below (it basically just moves the (organizations . ebdb-field-role) element from one definition of ebdb-record-field-slot-query to another). As with many of these setups, the problem isn't the underlying structures so much as it is the UI. I'm not sure how this will shake out in terms of actual usage. Maybe give the below a shot, and let me know how you'd like things to work?

(I think there's one or two other adjustments that need to be made in order to avoid breakage, but this should be a start.)

diff --git a/ebdb.el b/ebdb.el
index c016dfbd88..67054c2f13 100644
--- a/ebdb.el
+++ b/ebdb.el
@@ -3494,7 +3494,8 @@ RECORD's FIELD anniversary, relative to NOW-YEAR."
    (append
     `((mail . ebdb-field-mail)
       (phone . ebdb-field-phone)
-      (address . ebdb-field-address))
+      (address . ebdb-field-address)
+      (organizations . ebdb-field-role))
     alist)))
 
 (cl-defmethod ebdb-record-current-fields ((record ebdb-record-entity)
@@ -3648,8 +3649,7 @@ ARGS are passed to `ebdb-compose-mail', and then to
    (append
     '((aka . ebdb-field-name-complex)
       (aka . ebdb-field-name-simple)
-      (relations . ebdb-field-relation)
-      (organizations . ebdb-field-role))
+      (relations . ebdb-field-relation))
     alist)))
 
 (cl-defmethod ebdb-record-firstname ((rec ebdb-record-person) &optional full)

@girzel
Copy link
Owner

girzel commented Jul 20, 2023

I've pushed a change to this repo that should allow the creation of nested organizations. If you're comfortable running directly from the master branch you can try it out. I haven't done a release with this change yet, mostly because the UI side still needs some thought: a record's role fields need to be displayed differently depending on whether they are pointing to this record or from this record, and that will take some thought. The basics are there, though.

@nickgarber
Copy link
Author

Awesome, thanks! I'll start poking around with it now.

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

No branches or pull requests

2 participants