@asd20/ui 3.2.849 → 3.2.850

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.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.849",
8
+ "version": "3.2.850",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -3,6 +3,7 @@
3
3
  <div class="photostrip"></div>
4
4
 
5
5
  <section class="asd20-primary-header" aria-label="Primary message">
6
+ <p v-if="userGivenName" class="greeting">Hi, {{ userGivenName }}.</p>
6
7
  <asd20-messaging id="main" v-bind="firstMessage"></asd20-messaging>
7
8
  <div class="image-container">
8
9
  <img
@@ -38,6 +39,8 @@ export default {
38
39
  fullscreen: { type: Boolean, default: false },
39
40
  detailLink: { type: String, default: '' },
40
41
  detailLinkLabel: { type: String, default: '' },
42
+ userGivenName: { type: String, default: '' },
43
+ userGroupsList: { type: String, default: '' },
41
44
  },
42
45
  computed: {
43
46
  mq() {
@@ -102,10 +105,17 @@ export default {
102
105
  color: var(--color__primary);
103
106
  padding: space(3) space(1) space(3) space(1);
104
107
  // margin-top: space(1);
105
-
108
+ .greeting {
109
+ align-self: start;
110
+ font-family: var(--website-typography__font-family-headlines);
111
+ @include fluid-type($base-font-size * 1.2, $base-font-size * 1.4);
112
+ color: var(--website-homepage-header__foreground-color);
113
+ animation: small_slide_left 1.25s ease-in-out 0.5s both;
114
+ margin: 0;
115
+ }
106
116
  .asd20-messaging {
107
117
  margin-right: 0;
108
- padding-top: space(2);
118
+ padding-top: space(1);
109
119
  color: white !important;
110
120
  }
111
121
  &::v-deep .asd20-messaging__heading {
@@ -192,12 +202,25 @@ export default {
192
202
  }
193
203
  }
194
204
 
205
+ @keyframes small_slide_left {
206
+ from {
207
+ opacity: 0;
208
+ margin-left: 100px;
209
+ margin-right: -100px;
210
+ }
211
+ to {
212
+ opacity: 1;
213
+ margin-left: 0;
214
+ margin-right: 0;
215
+ }
216
+ }
217
+
195
218
  @media (min-width: 1024px) {
196
219
  .photostrip {
197
220
  height: 40vh;
198
221
  }
199
222
  .asd20-primary-header {
200
- flex-direction: row;
223
+ // flex-direction: row;
201
224
  justify-content: space-between;
202
225
  // background-size: auto 50%;
203
226
  padding: space(3) space(2) space(3) space(2);
@@ -2,6 +2,8 @@ import { storiesOf } from '@storybook/vue'
2
2
  import { withKnobs, boolean } from '@storybook/addon-knobs'
3
3
 
4
4
  import mockPageMixin from '../../../mixins/mockPageMixin'
5
+ import userProfileMixin from '../../../mixins/userProfileMixin'
6
+
5
7
 
6
8
  import Asd20DistrictHomeTemplate from '.'
7
9
  import pageQueryResult from '../../../data/page-queries/home-page-query-result.json'
@@ -12,12 +14,33 @@ const info = {
12
14
  }
13
15
 
14
16
  const wrapper = {
15
- mixins: [mockPageMixin],
17
+ mixins: [mockPageMixin, userProfileMixin],
16
18
  components: {
17
19
  Asd20DistrictHomeTemplate,
18
20
  },
21
+ props: {
22
+ // Mock props for userProfile and userGroups
23
+ userProfile: {
24
+ type: Object,
25
+ default: () => ({
26
+ displayName: 'John Doe',
27
+ givenName: 'John',
28
+ jobTitle: 'Software Developer',
29
+ officeLocation: 'HQ',
30
+ }),
31
+ },
32
+ userGroups: {
33
+ type: Array,
34
+ default: () => [
35
+ { displayName: 'Admin Group' },
36
+ { displayName: 'Developers Group' },
37
+ ],
38
+ },
39
+ },
19
40
 
20
- data: () => ({ pageQueryResult }),
41
+ data: () => ({
42
+ pageQueryResult
43
+ }),
21
44
 
22
45
  computed: {
23
46
  activeNotificationsByType() {
@@ -46,6 +69,8 @@ stories.add(
46
69
  v-bind="templateProps"
47
70
  :menu-open.sync="menuOpen"
48
71
  :search-open.sync="searchOpen"
72
+ :userProfile="userProfile"
73
+ :userGroups="userGroups"
49
74
 
50
75
  @announcements-in-view="loadAnnouncements"
51
76
  @stories-in-view="loadStories"
@@ -87,7 +87,12 @@
87
87
  </template>
88
88
  </section>
89
89
 
90
- <asd20-primary-header v-if="messages.length > 0" :messages="messages" />
90
+ <asd20-primary-header
91
+ v-if="messages.length > 0"
92
+ :messages="messages"
93
+ :userGivenName="userGivenName"
94
+ :userGroupsList="userGroupsList"
95
+ />
91
96
  <asd20-secondary-header v-if="messages.length > 1" :messages="messages" />
92
97
  <asd20-tertiary-header v-if="messages.length > 2" :messages="messages" />
93
98
 
@@ -151,18 +156,12 @@ import Asd20PrimaryHeader from '../../../components/organisms/Asd20PrimaryHeader
151
156
  import Asd20SecondaryHeader from '../../../components/organisms/Asd20SecondaryHeader'
152
157
  import Asd20TertiaryHeader from '../../../components/organisms/Asd20TertiaryHeader'
153
158
  import Asd20LanguageTranslation from '../../molecules/Asd20LanguageTranslation'
154
- // import globalPropMixinFactory from '../../../mixins/globalPropMixinFactory.js'
159
+ import userProfileMixin from '../../../mixins/userProfileMixin'
155
160
 
156
161
  export default {
157
162
  name: 'Asd20DistrictHomeTemplate',
158
163
 
159
- mixins: [
160
- pageTemplateMixin,
161
- // globalPropMixinFactory('isAuthenticated', {
162
- // type: Boolean,
163
- // default: true,
164
- // }),
165
- ],
164
+ mixins: [pageTemplateMixin, userProfileMixin],
166
165
 
167
166
  directives: { scrollTrack },
168
167
 
@@ -1,29 +1,41 @@
1
- import globalpropmixinfactory from '.'
1
+ import globalPropMixinFactory from './globalPropMixinFactory'
2
2
 
3
- // Create a mixin to access user profile
4
- const userProfileMixin = globalpropmixinfactory('userProfile', {
3
+ // Create a mixin to access user profile with default values
4
+ const userProfileMixin = globalPropMixinFactory('userProfile', {
5
5
  type: Object,
6
- default: () => ({}),
6
+ default: () => ({
7
+ displayName: '',
8
+ givenName: '',
9
+ jobTitle: '',
10
+ officeLocation: '',
11
+ }),
12
+ })
13
+
14
+ // Create a mixin to access user groups with default values
15
+ const userGroupsMixin = globalPropMixinFactory('userGroups', {
16
+ type: Array,
17
+ default: () => [],
7
18
  })
8
19
 
9
- // In your component
10
20
  export default {
11
- mixins: [userProfileMixin],
21
+ mixins: [userProfileMixin, userGroupsMixin],
12
22
  computed: {
13
23
  userDisplayName() {
14
- return this._userProfile.displayName || ''
24
+ return this._userProfile.displayName || 'Guest'
15
25
  },
16
26
  userGivenName() {
17
- return this._userProfile.givenName || ''
27
+ return this._userProfile.givenName || 'User'
18
28
  },
19
29
  userJobTitle() {
20
- return this._userProfile.jobTitle || ''
30
+ return this._userProfile.jobTitle || 'N/A'
21
31
  },
22
32
  userOfficeLocation() {
23
- return this._userProfile.officeLocation || ''
33
+ return this._userProfile.officeLocation || 'Unknown'
34
+ },
35
+ userGroupsList() {
36
+ return this._userGroups.length > 0
37
+ ? this._userGroups.map(group => group.displayName).join(', ')
38
+ : 'No groups assigned'
24
39
  },
25
40
  },
26
- // mounted() {
27
- // console.log('User Profile:', this._userProfile)
28
- // },
29
41
  }