mgtypes 1.0.50 → 1.0.52

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,6 +1,6 @@
1
1
  {
2
2
  "name": "mgtypes",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "types for mg development",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -228,7 +228,6 @@ export interface mgColorsConfig {
228
228
  darkNeutral: string;
229
229
  dark: string;
230
230
 
231
-
232
231
  success: string;
233
232
  warning: string;
234
233
 
@@ -241,7 +240,6 @@ export interface mgColorsConfig {
241
240
  secondaryContainerGradient: string;
242
241
  tertiaryContainerGradient: string;
243
242
 
244
-
245
243
  // ORIGINALS
246
244
 
247
245
  primary: string;
@@ -472,39 +470,22 @@ export interface mgPermissionsProfile {
472
470
  * @param pins one of this property's internal properties can be 'all', which will filter all pins
473
471
  * @param plans same as above
474
472
  */
473
+
474
+ // TODO: create a data structure that encapsulates
475
+ // how filters might effectively work
475
476
  export interface mgMapFiltersProfile {
476
- pins?: { [key: string]: mgMapFilter };
477
- plans?: { [key: string]: mgMapFilter };
478
- people?: {
479
- friends?: mgMapFilter;
480
- fire?: mgMapFilter;
481
- security?: mgMapFilter;
482
- medical?: mgMapFilter;
483
- 'mental health'?: mgMapFilter;
484
- allResponders?: mgMapFilter;
485
- all?: mgMapFilter;
486
- };
487
- emergencies?: {
488
- fire?: mgMapFilter;
489
- security?: mgMapFilter;
490
- medical?: mgMapFilter;
491
- 'mental health'?: mgMapFilter;
492
- all?: mgMapFilter;
493
- };
494
- routes?: {
495
- runs?: mgMapFilter;
496
- parades?: mgMapFilter;
497
- all?: mgMapFilter;
498
- };
477
+ [filterName: string]: mgMapFilter;
499
478
  }
500
479
 
501
480
  /**
502
481
  * Configs to display a map filter
503
482
  */
504
483
  export interface mgMapFilter {
505
- category: 'route' | 'pin' | 'person' | 'plan' | 'emergency';
506
- value: string;
507
- labelText: string;
484
+ contentToFilter?: {
485
+ contentType: 'pin' | 'plan' | 'route'; // 'pin'
486
+ contentableCategory: string; // 'food'
487
+ contentableType: string; // 'burgers'
488
+ }[];
489
+ contentItemsToFilter?: number[]
508
490
  icon: string;
509
- color: string;
510
491
  }
package/types/Content.ts CHANGED
@@ -4,54 +4,6 @@ import { Vote } from './Vote';
4
4
  import { Emergency } from './Emergency';
5
5
  import { Position } from 'geojson';
6
6
 
7
- /**
8
- * shared posts will have sharedContentDetails, normal
9
- * posts won't have sCD. Posts with threads attached have
10
- * children; thread tracks who added and where a threaded
11
- * post goes. A plan may have UserPlan details that indicate
12
- * if user is attending the plan
13
- * */
14
- export interface AppContent {
15
- feedData: {
16
- mainContent: { order: number[]; content: { [contentId: string]: Post } };
17
- sharedContent: { order: number[]; content: { [contentId: string]: Post } };
18
- friendsContent: { order: number[]; content: { [contentId: string]: Post } };
19
- userContent: { order: number[]; content: { [contentId: string]: Post } };
20
- };
21
- mapData: {
22
- pins: { [contentId: string]: Post };
23
- publicPlans: { [contentId: string]: Post };
24
- userPlans: { [contentId: string]: Post };
25
- pinAds: { [contentId: string]: Post };
26
- planAds: { [contentId: string]: Post };
27
- routes: { [contentId: string]: Post };
28
- };
29
- userData: {
30
- user: User;
31
- votes: Vote[];
32
- friends: { [userId: string]: User };
33
- plans: UserPlan[];
34
- friendRequests: { [friendRequestId: string]: FriendRequest };
35
- roles: UserRole[];
36
- activeRole: string;
37
- emergencies: Emergency[];
38
- };
39
- listsData: {
40
- [listId: string]: {
41
- content: { [contentId: string]: Post };
42
- order: number[];
43
- title: string;
44
- description: string;
45
- icon: string;
46
- };
47
- };
48
- calendarData: {
49
- publicPlans: { [contentId: string]: Post };
50
- };
51
- }
52
- export interface PostWithIndex {
53
- [contentId: string]: Post;
54
- }
55
7
 
56
8
  export interface Post {
57
9
  content: Content;
@@ -65,6 +17,14 @@ export interface Post {
65
17
  userVote?: Vote;
66
18
  indent?: number;
67
19
  parent?: Post;
20
+ pages?: {
21
+ feed:
22
+ | { main?: number; shared?: number; user?: number; friends?: number }
23
+ | false;
24
+ map: boolean;
25
+ calendar: boolean;
26
+ lists: { [listNumber: number]: number };
27
+ };
68
28
  }
69
29
 
70
30
  /**
@@ -106,7 +66,7 @@ export interface Content {
106
66
 
107
67
  /**
108
68
  * Covers all different content types
109
- * (pin, plan, comment, photo) coming in from server
69
+ * (pin, plan, comment, photo, route) coming in from server
110
70
  * */
111
71
  export interface Contentable {
112
72
  id: number;
@@ -144,6 +104,7 @@ export interface Contentable {
144
104
 
145
105
  // Routes
146
106
  routeCategory?: string;
107
+ routeType?:string;
147
108
  distance?: string;
148
109
  color?: string;
149
110
  coordinates?: Position[];
@@ -164,14 +125,6 @@ export interface PinHour {
164
125
 
165
126
  export interface SharedContentDetails {
166
127
  senders: Sender[];
167
- sharedContentStatus: {
168
- id: number;
169
- isArchived: boolean;
170
- createdAt: string;
171
- updatedAt: string;
172
- contentId: number;
173
- userId: number;
174
- };
175
128
  }
176
129
 
177
130
  /**