@openeventkit/event-site 2.0.109 → 2.0.110

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@openeventkit/event-site",
3
3
  "description": "Event Site",
4
- "version": "2.0.109",
4
+ "version": "2.0.110",
5
5
  "author": "Tipit LLC",
6
6
  "dependencies": {
7
7
  "@mui/base": "^5.0.0-alpha.114",
@@ -122,7 +122,7 @@
122
122
  "stream-browserify": "^3.0.0",
123
123
  "stream-chat": "^2.7.2",
124
124
  "stream-chat-react": "3.1.7",
125
- "summit-registration-lite": "5.0.31",
125
+ "summit-registration-lite": "5.0.34",
126
126
  "superagent": "8.0.9",
127
127
  "sweetalert2": "^9.17.0",
128
128
  "upcoming-events-widget": "3.0.5",
@@ -28,6 +28,32 @@ export const fetchEventById = async (summitId, eventId, accessToken = null) => {
28
28
  });
29
29
  }
30
30
 
31
+ /**
32
+ * @param summitId
33
+ * @param eventTypeId
34
+ * @param accessToken
35
+ * @returns {Promise<Response>}
36
+ */
37
+ export const fetchEventTypeById = async (summitId, eventTypeId, accessToken = null) => {
38
+
39
+ let apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/public/v1/summits/${summitId}/event-types/${eventTypeId}`);
40
+ if(accessToken){
41
+ apiUrl = URI(`${process.env.GATSBY_SUMMIT_API_BASE_URL}/api/v1/summits/${summitId}/event-types/${eventTypeId}`);
42
+ apiUrl.addQuery('access_token', accessToken);
43
+ }
44
+
45
+ apiUrl.addQuery('evict_cache', 1);
46
+ return fetch(apiUrl.toString(), {
47
+ method: 'GET'
48
+ }).then(async (response) => {
49
+ if (response.status === 200) {
50
+ return await response.json();
51
+ }
52
+ return null;
53
+ });
54
+ }
55
+
56
+
31
57
  /**
32
58
  *
33
59
  * @param summitId
@@ -58,11 +58,6 @@ const marketingPage = {
58
58
  name: "date",
59
59
  required: false
60
60
  }),
61
- booleanField({
62
- label: "Date Layout",
63
- name: "dateLayout",
64
- required: false
65
- }),
66
61
  stringField({
67
62
  label: "Time",
68
63
  name: "time",
@@ -55,7 +55,6 @@ module.exports = `
55
55
  subTitle: String
56
56
  date: String
57
57
  time: String
58
- dateLayout: Boolean
59
58
  images: [ImageWithAlt]
60
59
  background: ImageWithAlt
61
60
  buttons: MarketingPageHeroButtons
@@ -78,24 +78,13 @@ const MarketingHeroComponent = ({
78
78
  <div
79
79
  className={styles.date}
80
80
  style={{
81
- backgroundColor: data?.dateLayout
82
- ? "var(--color_secondary)"
83
- : "",
84
- display: data?.dateLayout
85
- ? ""
86
- : "inline",
87
- transform: data?.dateLayout
88
- ? "skew(-25deg)"
89
- : "skew(0deg)",
81
+ display: "inline",
82
+ transform: "skew(0deg)",
90
83
  }}
91
- >
92
- {data?.dateLayout ?
93
- <div style={{transform: "skew(25deg)"}}>{data?.date}</div>
94
- :
84
+ >
95
85
  <div style={{transform: "skew(0deg)"}}>
96
86
  <span>{data?.date}</span>
97
87
  </div>
98
- }
99
88
  </div>
100
89
  <h4>{data?.time}</h4>
101
90
  <div className={styles.heroButtons}>
@@ -348,7 +348,7 @@ const ProfilePopupComponent = ({ userProfile, idpLoading, closePopup, showProfil
348
348
  <input
349
349
  className={`${styles.input} ${styles.isMedium}`}
350
350
  type="text"
351
- placeholder="Twitter"
351
+ placeholder="Twitter/X"
352
352
  onChange={e => setTwitter(e.target.value)}
353
353
  value={twitter} />
354
354
  </div>
@@ -2,7 +2,6 @@
2
2
  "hero": {
3
3
  "title": "",
4
4
  "date": "",
5
- "dateLayout": false,
6
5
  "time": "",
7
6
  "buttons": {
8
7
  "registerButton": {
@@ -12,7 +12,6 @@ export const marketingPageQuery = graphql`
12
12
  hero {
13
13
  title
14
14
  subTitle
15
- dateLayout
16
15
  date
17
16
  time
18
17
  background {
@@ -7,14 +7,14 @@
7
7
 
8
8
  .title {
9
9
  font-size: 102px;
10
- color: var(--color_text_dark);
10
+ color: var(--color_text_light);
11
11
  font-weight: bold;
12
12
  text-align: center;
13
13
  }
14
14
 
15
15
  .subtitle {
16
16
  font-size: 32px;
17
- color: var(--color_text_dark);
17
+ color: var(--color_text_light);
18
18
  text-align: center;
19
19
  max-width: 800px;
20
20
  margin: auto;
@@ -104,7 +104,6 @@
104
104
  margin-left: -3em;
105
105
 
106
106
  div {
107
- transform: skew(25deg);
108
107
  font-size: 3rem;
109
108
  font-weight: bold;
110
109
  color: var(--color_text_light);
@@ -113,7 +112,6 @@
113
112
 
114
113
  span {
115
114
  margin: 0 -1.5em;
116
- transform: skew(-25deg);
117
115
  display: inline;
118
116
  }
119
117
 
@@ -406,7 +406,7 @@ export const FullProfilePageTemplate = ({ user, getIDPProfile, updateProfile, up
406
406
  <input
407
407
  className={`${styles.input} ${styles.isLarge}`}
408
408
  type="text"
409
- placeholder="Twitter"
409
+ placeholder="Twitter/X"
410
410
  onChange={e => setPersonalProfile({ ...personalProfile, twitter: e.target.value })}
411
411
  value={personalProfile.twitter}
412
412
  />
@@ -49,6 +49,10 @@ export const isSummitEventDataUpdate = (entity_type) => {
49
49
  return entity_type === 'Presentation' || entity_type === 'SummitEvent' || entity_type === 'SummitEventWithFile';
50
50
  }
51
51
 
52
+ export const isSummitEventTypeDataUpdate = (entity_type) => {
53
+ return entity_type === 'SummitEventType' || entity_type === 'PresentationType';
54
+ }
55
+
52
56
  /**
53
57
  * @param summitId
54
58
  * @param bucketKey
@@ -0,0 +1,66 @@
1
+ import AbstractSynchStrategy from "./abstract_synch_strategy";
2
+ import {fetchEventTypeById} from "../../actions/fetch-entities-actions";
3
+ import {
4
+ BUCKET_EVENTS_DATA_KEY,
5
+ BUCKET_SUMMIT_DATA_KEY,
6
+ saveFile
7
+ } from "../../utils/dataUpdatesUtils";
8
+
9
+ /**
10
+ * ActivityTypeSynchStrategy
11
+ */
12
+ class ActivityTypeSynchStrategy extends AbstractSynchStrategy{
13
+
14
+ async process(payload){
15
+
16
+ console.log(`ActivityTypeSynchStrategy::process`, payload);
17
+
18
+ const {entity_operator, entity_id} = payload;
19
+
20
+ const entity = await fetchEventTypeById(this.summit.id, entity_id, this.accessToken);
21
+
22
+ if (entity_operator === 'UPDATE') {
23
+ if (!entity) return Promise.reject('ActivityTypeSynchStrategy::process entity not found.');
24
+
25
+ // update summit
26
+ this.summit.event_types = [...this.summit.event_types.filter(et => et.id !== entity_id), entity]
27
+
28
+ // update events
29
+ this.allEvents = this.allEvents.map(ev => {
30
+ if (ev.type.id === entity_id) return ({...ev, type: entity});
31
+ return ev;
32
+ })
33
+
34
+
35
+ // update files on cache
36
+ console.log(`ActivityTypeSynchStrategy::process updating cache files`);
37
+
38
+ try {
39
+ const localNowUtc = Date.now();
40
+
41
+ await saveFile(this.summit.id, BUCKET_EVENTS_DATA_KEY, this.allEvents, localNowUtc);
42
+ await saveFile(this.summit.id, BUCKET_SUMMIT_DATA_KEY, this.summit, localNowUtc);
43
+
44
+ }
45
+ catch (e){
46
+ console.log(e);
47
+ }
48
+
49
+ let res = {
50
+ payload,
51
+ entity,
52
+ summit : this.summit,
53
+ eventsData: this.allEvents,
54
+ allIDXEvents : this.allIDXEvents,
55
+ allSpeakers : this.allSpeakers,
56
+ allIDXSpeakers : this.allIDXSpeakers
57
+ };
58
+
59
+ console.log(`ActivityTypeSynchStrategy::process done`, res);
60
+
61
+ return Promise.resolve(res);
62
+ }
63
+ }
64
+ }
65
+
66
+ export default ActivityTypeSynchStrategy;
@@ -1,8 +1,9 @@
1
- import {isSummitEventDataUpdate} from "../../utils/dataUpdatesUtils";
1
+ import {isSummitEventDataUpdate, isSummitEventTypeDataUpdate} from "../../utils/dataUpdatesUtils";
2
2
  import ActivitySynchStrategy from "../sync_strategies/activity_synch_strategy";
3
3
  import VenueRoomSynchStrategy from "./venue_room_synch_strategy";
4
4
  import SpeakerSynchStrategy from "./speaker_synch_strategy";
5
5
  import SummitSynchStrategy from "./summit_synch_strategy";
6
+ import ActivityTypeSynchStrategy from "./activity_type_synch_strategy";
6
7
 
7
8
  /**
8
9
  * SynchStrategyFactory
@@ -24,6 +25,9 @@ class SynchStrategyFactory {
24
25
  if (isSummitEventDataUpdate(entity_type)) {
25
26
  return new ActivitySynchStrategy(summit, allEvents, allIDXEvents, allSpeakers, allIDXSpeakers, accessToken);
26
27
  }
28
+ if (isSummitEventTypeDataUpdate(entity_type)) {
29
+ return new ActivityTypeSynchStrategy(summit, allEvents, allIDXEvents, allSpeakers, allIDXSpeakers, accessToken);
30
+ }
27
31
  if (entity_type === 'SummitVenueRoom') {
28
32
  return new VenueRoomSynchStrategy(summit, allEvents, allIDXEvents, allSpeakers, allIDXSpeakers, accessToken);
29
33
  }