wbcore 1.59.11__py2.py3-none-any.whl → 1.59.13__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -36,6 +36,7 @@ from .entries import (
36
36
  EntryRepresentationSerializer,
37
37
  InternalUserProfileRepresentationSerializer,
38
38
  PersonRepresentationSerializer,
39
+ FullDetailPersonRepresentationSerializer,
39
40
  SpecializationModelSerializer,
40
41
  SpecializationRepresentationSerializer,
41
42
  )
@@ -16,6 +16,7 @@ from ..models import (
16
16
  CompanyType,
17
17
  CustomerStatus,
18
18
  EmailContact,
19
+ EmployerEmployeeRelationship,
19
20
  Entry,
20
21
  Person,
21
22
  Specialization,
@@ -63,6 +64,54 @@ class PersonRepresentationSerializer(EntryRepresentationSerializer):
63
64
  )
64
65
 
65
66
 
67
+ class FullDetailPersonRepresentationSerializer(PersonRepresentationSerializer):
68
+ primary_email = wb_serializers.SerializerMethodField(
69
+ read_only=True, required=False, label=_("Primary Email"), allow_null=True
70
+ )
71
+ primary_telephone = wb_serializers.SerializerMethodField(
72
+ read_only=True, required=False, label=_("Primary Telephone"), allow_null=True
73
+ )
74
+ primary_position = wb_serializers.SerializerMethodField(
75
+ read_only=True, required=False, label=_("Primary Position"), allow_null=True
76
+ )
77
+
78
+ def get_primary_email(self, person):
79
+ try:
80
+ return EmailContact.objects.get(entry_id=person.id, primary=True).address
81
+ except EmailContact.DoesNotExist:
82
+ return None
83
+
84
+ def get_primary_telephone(self, person):
85
+ try:
86
+ return TelephoneContact.objects.get(entry_id=person.id, primary=True).number
87
+ except TelephoneContact.DoesNotExist:
88
+ return None
89
+
90
+ def get_primary_position(self, person):
91
+ try:
92
+ rel = EmployerEmployeeRelationship.objects.get(employee_id=person.id, primary=True)
93
+ return rel.position.title if rel.position else rel.position_name
94
+ except EmployerEmployeeRelationship.DoesNotExist:
95
+ return None
96
+
97
+ class Meta:
98
+ model = Person
99
+ fields = (
100
+ "id",
101
+ "computed_str",
102
+ "first_name",
103
+ "last_name",
104
+ "primary_email",
105
+ "primary_telephone",
106
+ "primary_position",
107
+ "profile_image",
108
+ "description",
109
+ "_detail",
110
+ "_detail_preview",
111
+ "_additional_resources",
112
+ )
113
+
114
+
66
115
  class InternalUserProfileRepresentationSerializer(PersonRepresentationSerializer):
67
116
  def get_filter_params(self, request):
68
117
  return {"only_internal_users": True}
@@ -11,16 +11,6 @@ from wbcore.metadata.configs.buttons.view_config import ButtonViewConfig
11
11
  class EntryModelButtonConfig(ButtonViewConfig):
12
12
  CRM_BUTTONS = ()
13
13
 
14
- CONTACT_BUTTONS = (
15
- bt.WidgetButton(key="relationships", label=gettext_lazy("Relationships"), icon=WBIcon.GROUPS.icon),
16
- bt.WidgetButton(key="emails", label=gettext_lazy("Emails"), icon=WBIcon.MAIL.icon),
17
- bt.WidgetButton(key="telephones", label=gettext_lazy("Telephones"), icon=WBIcon.PHONE.icon),
18
- bt.WidgetButton(key="addresses", label=gettext_lazy("Addresses"), icon=WBIcon.LOCATION.icon),
19
- bt.WidgetButton(key="websites", label=gettext_lazy("Websites"), icon=WBIcon.PUBLIC.icon),
20
- bt.WidgetButton(key="bankings", label=gettext_lazy("Bankings"), icon=WBIcon.BANK.icon),
21
- bt.WidgetButton(key="social_media", label=gettext_lazy("Social Media"), icon=WBIcon.NEWSPAPER.icon),
22
- )
23
-
24
14
  def get_custom_list_instance_buttons(self):
25
15
  return {
26
16
  bt.DropDownButton(
@@ -40,9 +30,6 @@ class EntryModelButtonConfig(ButtonViewConfig):
40
30
  return {
41
31
  bt.WidgetButton(key="employees", label=_("Employees"), icon=WBIcon.PEOPLE.icon, weight=2),
42
32
  bt.WidgetButton(key="manager", label=_("Relationship Managers"), icon=WBIcon.SUPERVISE.icon, weight=3),
43
- bt.DropDownButton(
44
- label=_("More Information"), icon=WBIcon.UNFOLD.icon, buttons=self.CONTACT_BUTTONS, weight=4
45
- ),
46
33
  }
47
34
 
48
35
 
@@ -58,9 +45,6 @@ class PersonModelButtonConfig(EntryModelButtonConfig):
58
45
  return {
59
46
  bt.WidgetButton(key="employers", label=_("Employers"), icon=WBIcon.WORK.icon, weight=2),
60
47
  bt.DropDownButton(label=_("Client/Manager"), icon=WBIcon.UNFOLD.icon, buttons=self.CRM_BUTTONS, weight=3),
61
- bt.DropDownButton(
62
- label=_("More Information"), icon=WBIcon.UNFOLD.icon, buttons=self.CONTACT_BUTTONS, weight=4
63
- ),
64
48
  }
65
49
 
66
50
 
@@ -21,6 +21,139 @@ class EntryModelDisplay(DisplayViewConfig):
21
21
  return create_simple_display([["computed_str"]])
22
22
 
23
23
 
24
+ # CONTACT_PAGE = Page(
25
+ # title=_("Contacts"),
26
+ # layouts={
27
+ # default(): Layout(
28
+ # grid_template_areas=[
29
+ # ["addresses_table", "addresses_table"],
30
+ # ["telephones_table", "emails_table"],
31
+ # ["websites_table", "social_media_table"],
32
+ # ["bankings_table", "bankings_table"],
33
+ # ["relationships_table", "relationships_table"],
34
+ # ],
35
+ # grid_auto_rows=Style.AUTO,
36
+ # grid_template_rows=[
37
+ # "200px",
38
+ # "200px",
39
+ # "200px",
40
+ # "200px",
41
+ # "200px",
42
+ # ],
43
+ # inlines=[
44
+ # Inline(
45
+ # key="addresses_table",
46
+ # endpoint="addresses",
47
+ # title="Addresses",
48
+ # ),
49
+ # Inline(
50
+ # key="telephones_table",
51
+ # endpoint="telephones",
52
+ # title="Telephones",
53
+ # ),
54
+ # Inline(
55
+ # key="emails_table",
56
+ # endpoint="emails",
57
+ # title="Emails",
58
+ # ),
59
+ # Inline(
60
+ # key="websites_table",
61
+ # endpoint="websites",
62
+ # title="Websites",
63
+ # ),
64
+ # Inline(
65
+ # key="bankings_table",
66
+ # endpoint="bankings",
67
+ # title="Banking",
68
+ # ),
69
+ # Inline(
70
+ # key="social_media_table",
71
+ # endpoint="social_media",
72
+ # title="Socials",
73
+ # ),
74
+ # Inline(
75
+ # key="relationships_table",
76
+ # endpoint="relationships",
77
+ # title="Relationships",
78
+ # ),
79
+ # ],
80
+ # ),
81
+ # },
82
+ # )
83
+ contact_section = Section(
84
+ key="contact_section",
85
+ collapsible=False,
86
+ title=_("Contacts"),
87
+ display=Display(
88
+ pages=[
89
+ Page(
90
+ title=_("Telephones"),
91
+ layouts={
92
+ default(): Layout(
93
+ grid_template_areas=[["telephone_table"]],
94
+ inlines=[Inline(key="telephone_table", endpoint="telephones")],
95
+ )
96
+ },
97
+ ),
98
+ Page(
99
+ title=_("Emails"),
100
+ layouts={
101
+ default(): Layout(
102
+ grid_template_areas=[["email_table"]],
103
+ inlines=[Inline(key="email_table", endpoint="emails")],
104
+ )
105
+ },
106
+ ),
107
+ Page(
108
+ title=_("Addresses"),
109
+ layouts={
110
+ default(): Layout(
111
+ grid_template_areas=[["addresses_table"]],
112
+ inlines=[Inline(key="addresses_table", endpoint="addresses")],
113
+ )
114
+ },
115
+ ),
116
+ Page(
117
+ title=_("Websites"),
118
+ layouts={
119
+ default(): Layout(
120
+ grid_template_areas=[["website_table"]],
121
+ inlines=[Inline(key="website_table", endpoint="websites")],
122
+ )
123
+ },
124
+ ),
125
+ Page(
126
+ title=_("Bankings"),
127
+ layouts={
128
+ default(): Layout(
129
+ grid_template_areas=[["banking_table"]],
130
+ inlines=[Inline(key="banking_table", endpoint="bankings")],
131
+ )
132
+ },
133
+ ),
134
+ Page(
135
+ title=_("Socials"),
136
+ layouts={
137
+ default(): Layout(
138
+ grid_template_areas=[["socials_table"]],
139
+ inlines=[Inline(key="socials_table", endpoint="social_media")],
140
+ )
141
+ },
142
+ ),
143
+ Page(
144
+ title=_("Relationships"),
145
+ layouts={
146
+ default(): Layout(
147
+ grid_template_areas=[["relationship_table"]],
148
+ inlines=[Inline(key="relationship_table", endpoint="relationships")],
149
+ )
150
+ },
151
+ ),
152
+ ]
153
+ ),
154
+ )
155
+
156
+
24
157
  class PersonModelDisplay(EntryModelDisplay):
25
158
  @classmethod
26
159
  def _get_person_instance_display(cls) -> Display:
@@ -66,7 +199,7 @@ class PersonModelDisplay(EntryModelDisplay):
66
199
  "personality_profile_blue",
67
200
  "activity_table",
68
201
  ],
69
- ["employers_section", "employers_section", "employers_section", "employers_section"],
202
+ ["employers_section", "employers_section", "employers_section", "contact_section"],
70
203
  ],
71
204
  grid_template_columns=[
72
205
  Style.MIN_CONTENT,
@@ -76,7 +209,7 @@ class PersonModelDisplay(EntryModelDisplay):
76
209
  ],
77
210
  grid_template_rows=[Style.rem(6), Style.rem(6), Style.rem(6), Style.rem(6)],
78
211
  grid_auto_rows=Style.MIN_CONTENT,
79
- sections=[employers_section],
212
+ sections=[employers_section, contact_section],
80
213
  inlines=[
81
214
  Inline(
82
215
  key="activity_table",
@@ -362,9 +495,9 @@ class CompanyModelDisplay(EntryModelDisplay):
362
495
  ["profile_image", "primary_telephone", "primary_telephone", "activity_table"],
363
496
  ["profile_image", "type", "tier", "activity_table"],
364
497
  ["profile_image", "activity_heat", "activity_heat", "activity_table"],
365
- ["employees_section", "employees_section", "employees_section", "employees_section"],
498
+ ["employees_section", "employees_section", "employees_section", "contact_section"],
366
499
  ]
367
- sections = [employees_section]
500
+ sections = [employees_section, contact_section]
368
501
  if portfolio_fields:
369
502
  grid_template_areas.insert(
370
503
  4,
@@ -377,7 +510,7 @@ class CompanyModelDisplay(EntryModelDisplay):
377
510
  )
378
511
  sections.append(portfolio_fields)
379
512
  if aum_table:
380
- grid_template_areas[-1][-1] = aum_table.key
513
+ grid_template_areas.append([aum_table.key, aum_table.key, aum_table.key, aum_table.key])
381
514
  sections.append(aum_table)
382
515
 
383
516
  return Display(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wbcore
3
- Version: 1.59.11
3
+ Version: 1.59.13
4
4
  Author-email: Christopher Wittlinger <c.wittlinger@stainly.com>
5
5
  Requires-Dist: celery[redis]==5.*
6
6
  Requires-Dist: croniter==2.*
@@ -328,10 +328,10 @@ wbcore/contrib/directory/models/relationships.py,sha256=7SZFo1tA7NRzS7_gv_fKwMsP
328
328
  wbcore/contrib/directory/release_notes/1_0_0.md,sha256=Twbl9RMLO6dbbm5dVoKorw8BecRqAYsKeobcNmDWHu8,165
329
329
  wbcore/contrib/directory/release_notes/1_0_1.md,sha256=yHolV-HwBmIavaPn9pg0ABRgxQ-eKIuiAs-phKb_ix0,285
330
330
  wbcore/contrib/directory/release_notes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
331
- wbcore/contrib/directory/serializers/__init__.py,sha256=36WcX6aHrBuZXVWR0JSCeCCvJin_jOEaiwuSYBSs5eo,2131
331
+ wbcore/contrib/directory/serializers/__init__.py,sha256=kLr-KkhQ3sd0rSE0vRWP6Za31KWoMrTiebpYKGhkdmY,2177
332
332
  wbcore/contrib/directory/serializers/companies.py,sha256=Bvxex_tq5lyR3k9Ox_Z2AnRQVyhPM0l1bdClJAjeEdo,5747
333
333
  wbcore/contrib/directory/serializers/contacts.py,sha256=Q-3lmivmS4ci9XP-65lO1d06Gm6cQMgPH3YA8FY71ZE,15205
334
- wbcore/contrib/directory/serializers/entries.py,sha256=QV_hlstwFWvhp-uiVPn3xMt0bES_6gKJs4rf_CVHIn0,13584
334
+ wbcore/contrib/directory/serializers/entries.py,sha256=FtHuXwKNrKigyx9w3T-r9RiD2XINmuEi-ru5_5WpHlU,15297
335
335
  wbcore/contrib/directory/serializers/entry_representations.py,sha256=Pj8j4HYDINvXlLZ7onBypF2ZOK_GGzFZevd-yzESqoU,1397
336
336
  wbcore/contrib/directory/serializers/persons.py,sha256=YtUgKKeijvV87JLtgeQtxmyk21COLQjSrb5klBw_EXQ,7641
337
337
  wbcore/contrib/directory/serializers/relationships.py,sha256=jGrjy8M8kaxNRHHJ0HiDMdD_-wZFwioRJabCpCwHZ4U,12390
@@ -376,11 +376,11 @@ wbcore/contrib/directory/viewsets/relationships.py,sha256=jy73aCven25PbLoy3-KTjn
376
376
  wbcore/contrib/directory/viewsets/utils.py,sha256=2i7rIT8qMCD-ajT-uNN7Re4uMRwijrzvblokedJnwOw,3400
377
377
  wbcore/contrib/directory/viewsets/buttons/__init__.py,sha256=dB3nD_NflX6U5muEMwtBcm3aNB0w65h42iYmtbMbFb4,270
378
378
  wbcore/contrib/directory/viewsets/buttons/contacts.py,sha256=BECTH8ADx-Pz8kk11dpLGB2xRrkMI5emoIHcL8wdrJU,599
379
- wbcore/contrib/directory/viewsets/buttons/entries.py,sha256=X7tH209qPojFNlBiE8hU5BrxQHa07WkBddVtvX-aCds,5660
379
+ wbcore/contrib/directory/viewsets/buttons/entries.py,sha256=AH4M9L-XgJzDd2cEwk7xss8ksp6n1UGh03ESj_HWLmU,4613
380
380
  wbcore/contrib/directory/viewsets/buttons/relationships.py,sha256=Q1vLLA9ZGt-s29Of8dj24IlMQzDzW_sMPU7n_F00DuY,2786
381
381
  wbcore/contrib/directory/viewsets/display/__init__.py,sha256=NiC0d1-RjPIYEzkGAQzThNFQeYv5UAW3aKL9j_lFV38,945
382
382
  wbcore/contrib/directory/viewsets/display/contacts.py,sha256=2PBSxVmbq_26LyhSTWrpjNv9cxKz7w086BqoVX7SDs4,13449
383
- wbcore/contrib/directory/viewsets/display/entries.py,sha256=tK2tsiJvKy_SEWHq9TT30Nu1g158bpGv5z4EnFd9psQ,23548
383
+ wbcore/contrib/directory/viewsets/display/entries.py,sha256=puz_PqnHOYHvqeeu7Y-ggHsBcc5V1IdduxETAvMtBho,28068
384
384
  wbcore/contrib/directory/viewsets/display/relationships.py,sha256=-s3ABMIGmbvmAOe8CRJqVv8RpKaMw7xeoy0HSvo0kRQ,11587
385
385
  wbcore/contrib/directory/viewsets/display/utils.py,sha256=5sMFdEXUfanKp60IvTyO4YLqFlEUz9fGMldoqTYTnwU,830
386
386
  wbcore/contrib/directory/viewsets/endpoints/__init__.py,sha256=0z1LYIrLQvIcs2qZEfD2SYB6tqycmSQjlJ4NwZgd0JY,647
@@ -1238,6 +1238,6 @@ wbcore/viewsets/generics.py,sha256=lKDq9UY_Tyc56u1bqaIEvHGgoaXwXxpZ1c3fLVteptI,1
1238
1238
  wbcore/viewsets/mixins.py,sha256=IdHd_uixOv3ExKoHxTgL5Bt8OELIwfYwhBZm0nsvZfc,12054
1239
1239
  wbcore/viewsets/utils.py,sha256=4520Ij3ASM8lOa8QZkCqbBfOexVRiZu688eW-PGqMOA,882
1240
1240
  wbcore/viewsets/viewsets.py,sha256=FPPESunEjlunDr5VFsjTfsquTS3iDSQkw0H6QjMKPqk,6574
1241
- wbcore-1.59.11.dist-info/METADATA,sha256=BDSGN09DBIVVwXIZpQGQB-A7noYzZtdRjPR04DxdhiA,2317
1242
- wbcore-1.59.11.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
1243
- wbcore-1.59.11.dist-info/RECORD,,
1241
+ wbcore-1.59.13.dist-info/METADATA,sha256=tPeQYax72R4oW3yvv_Boqz8bwq3lqjIN2nfN1-quHC0,2317
1242
+ wbcore-1.59.13.dist-info/WHEEL,sha256=aha0VrrYvgDJ3Xxl3db_g_MDIW-ZexDdrc_m-Hk8YY4,105
1243
+ wbcore-1.59.13.dist-info/RECORD,,