Skip to content

Commit 8383e29

Browse files
Merge pull request #16 from JohnRamberger/development
Development
2 parents 2be20a3 + cd4e839 commit 8383e29

File tree

19 files changed

+445
-38
lines changed

19 files changed

+445
-38
lines changed

amplify/backend/api/hacklyticsportal2023/cli-inputs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"conflictResolution": {
1111
"defaultResolutionStrategy": {
12-
"type": "OPTIMISTIC_CONCURRENCY"
12+
"type": "AUTOMERGE"
1313
}
1414
},
1515
"additionalAuthTypes": [

amplify/backend/api/hacklyticsportal2023/schema.graphql

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ type Event
3131
name: String!
3232
description: String
3333
status: Boolean
34+
requireRSVP: Boolean
35+
canRSVP: Boolean
3436
start: AWSDateTime
3537
end: AWSDateTime
3638
location: String
@@ -47,7 +49,7 @@ type Checkin
4749
groups: ["Administrator"]
4850
operations: [read, create, update, delete]
4951
}
50-
{ allow: private, operations: [read] }
52+
{ allow: private, operations: [create, read, update, delete] }
5153
]
5254
) {
5355
id: ID!
@@ -87,7 +89,7 @@ type ScavengerHunt
8789
rules: [
8890
{
8991
allow: groups
90-
groups: ["Administrator"]
92+
groups: ["Administrator", "Scavenger"]
9193
operations: [read, create, update, delete]
9294
}
9395
{ allow: private, operations: [read] }
@@ -106,7 +108,7 @@ type ScavengerHuntCheckin
106108
rules: [
107109
{
108110
allow: groups
109-
groups: ["Administrator"]
111+
groups: ["Administrator", "Scavenger"]
110112
operations: [read, create, update, delete]
111113
}
112114
{ allow: private, operations: [read, create] }
@@ -116,3 +118,21 @@ type ScavengerHuntCheckin
116118
checkpointID: String!
117119
userID: String!
118120
}
121+
122+
type EventRSVP
123+
@model
124+
@auth(
125+
rules: [
126+
{
127+
allow: groups
128+
groups: ["Administrator"]
129+
operations: [read, create, update, delete]
130+
}
131+
{ allow: owner, operations: [read, create, update, delete] }
132+
]
133+
) {
134+
id: ID!
135+
userID: String!
136+
userName: String!
137+
eventID: String!
138+
}

amplify/backend/api/hacklyticsportal2023/transform.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"ElasticsearchWarning": true,
44
"ResolverConfig": {
55
"project": {
6-
"ConflictHandler": "OPTIMISTIC_CONCURRENCY",
6+
"ConflictHandler": "AUTOMERGE",
77
"ConflictDetection": "VERSION"
88
}
99
}

amplify/backend/function/hacklyticsportal2023listusers/src/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,22 @@ exports.handler = async (event) => {
3434
});
3535
var users = x.Users;
3636
if (users.length > 0) {
37+
users = users.map((user) => {
38+
return {
39+
username: user.Username,
40+
email: user.Attributes.find((attr) => attr.Name === "email").Value,
41+
name: user.Attributes.find((attr) => attr.Name === "name").Value,
42+
enabled: user.Enabled,
43+
};
44+
});
3745
return JSON.stringify({
3846
statusCode: 200,
3947
// Uncomment below to enable CORS requests
4048
// headers: {
4149
// "Access-Control-Allow-Origin": "*",
4250
// "Access-Control-Allow-Headers": "*"
4351
// },
44-
body: { ok: 1, users: users },
52+
body: { ok: 1, userCount: users.length, users: users },
4553
});
4654
} else {
4755
return JSON.stringify({

amplify/backend/function/hacklyticsportal2023listusers/src/yarn.lock

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
# yarn lockfile v1
33

44

5-
"@types/aws-lambda@^8.10.92":
6-
version "8.10.110"
7-
resolved "https://registry.yarnpkg.com/@types/aws-lambda/-/aws-lambda-8.10.110.tgz#32a1f9d40b855d69830243492bbb6408098f4c88"
8-
integrity sha512-r6egf2Cwv/JaFTTrF9OXFVUB3j/SXTgM9BwrlbBRjWAa2Tu6GWoDoLflppAZ8uSfbUJdXvC7Br3DjuN9pQ2NUQ==
9-
105
available-typed-arrays@^1.0.5:
116
version "1.0.5"
127
resolved "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz"
@@ -102,7 +97,7 @@ has@^1.0.3:
10297
dependencies:
10398
function-bind "^1.1.1"
10499

105-
ieee754@1.1.13, ieee754@^1.1.4:
100+
ieee754@^1.1.4, ieee754@1.1.13:
106101
version "1.1.13"
107102
resolved "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz"
108103
integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==
@@ -163,7 +158,7 @@ querystring@0.2.0:
163158
resolved "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz"
164159
integrity sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==
165160

166-
sax@1.2.1, sax@>=0.6.0:
161+
sax@>=0.6.0, sax@1.2.1:
167162
version "1.2.1"
168163
resolved "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz"
169164
integrity sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA==

amplify/team-provider-info.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
"function": {
2222
"hacklyticsportal20232e32fd51": {
2323
"deploymentBucketName": "amplify-hacklyticsportal2023-prod-221126-deployment",
24-
"s3Key": "amplify-builds/hacklyticsportal20232e32fd51-70577737482b35743137-build.zip"
24+
"s3Key": "amplify-builds/hacklyticsportal20232e32fd51-7769506364764973302b-build.zip"
2525
},
2626
"hacklyticsportal2023listusers": {
2727
"deploymentBucketName": "amplify-hacklyticsportal2023-prod-221126-deployment",
28-
"s3Key": "amplify-builds/hacklyticsportal2023listusers-434a3932506667747356-build.zip"
28+
"s3Key": "amplify-builds/hacklyticsportal2023listusers-646e39457a3579306641-build.zip"
2929
}
3030
},
3131
"api": {
@@ -62,7 +62,7 @@
6262
},
6363
"hacklyticsportal2023listusers": {
6464
"deploymentBucketName": "amplify-amplify0f0acd1e2a0b4-staging-14346-deployment",
65-
"s3Key": "amplify-builds/hacklyticsportal2023listusers-3768654f6b65734e6168-build.zip"
65+
"s3Key": "amplify-builds/hacklyticsportal2023listusers-646e39457a3579306641-build.zip"
6666
}
6767
}
6868
}

lib/App.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// amplify packages
22
import 'package:amplify_auth_cognito/amplify_auth_cognito.dart';
33
import 'package:amplify_authenticator/amplify_authenticator.dart';
4-
// import 'package:amplify_datastore/amplify_datastore.dart';
4+
import 'package:amplify_datastore/amplify_datastore.dart';
55
import 'package:amplify_flutter/amplify_flutter.dart';
66
import 'package:amplify_api/amplify_api.dart';
77
import 'package:hacklytics_checkin_flutter/models/ModelProvider.dart';
@@ -35,10 +35,10 @@ class _MyAppState extends State<MyApp> {
3535
await Amplify.addPlugin(
3636
AmplifyAPI(modelProvider: ModelProvider.instance));
3737

38-
// var dataPlugin = AmplifyDataStore(
39-
// modelProvider: ModelProvider.instance,
40-
// authModeStrategy: AuthModeStrategy.multiAuth);
41-
// await Amplify.addPlugin(dataPlugin);
38+
var dataPlugin = AmplifyDataStore(
39+
modelProvider: ModelProvider.instance,
40+
authModeStrategy: AuthModeStrategy.multiAuth);
41+
await Amplify.addPlugin(dataPlugin);
4242

4343
await Amplify.configure(amplifyconfig);
4444
} on Exception catch (e) {

lib/components/EventCard.component.dart

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ class EventCard extends StatelessWidget {
4444
_buildListTileDate("End", event.end),
4545
// const Divider(),
4646
_buildListTileStatus("Status", event.status),
47+
_buildListTileStatus("Requires RSVP", event.requireRSVP,
48+
greenText: "Yes", redText: "No"),
4749
]);
4850
}
4951

@@ -56,17 +58,23 @@ class EventCard extends StatelessWidget {
5658
);
5759
}
5860

59-
_buildListTileStatus(String title, bool? status) {
61+
_buildListTileStatus(
62+
String title,
63+
bool? status, {
64+
greenText = "Open",
65+
redText = "Closed",
66+
}) {
6067
return ListTile(
6168
title: Text(title),
6269
subtitle: status != null && status == true
63-
? _buildGreenText("Open")
64-
: _buildRedText("Closed"),
70+
? _buildGreenText(greenText)
71+
: _buildRedText(redText),
6572
);
6673
}
6774

6875
_buildListTileDate(String title, TemporalDateTime? date) {
69-
final DateFormat formatter = DateFormat('MMM d, yyyy h:mm a');
76+
final DateFormat formatter = DateFormat('EEEEE h:mm a');
77+
// final DateFormat formatter = DateFormat('MMM d, yyyy h:mm a');
7078
// format date
7179
// String formattedDate =
7280
// date != null ? formatter.format(date as DateTime) : "";

lib/model/user.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ class User {
4545
}
4646
}
4747
}
48+
User.v2(userData) {
49+
username = userData['username'];
50+
censoredUsername =
51+
'${username.substring(0, usernameCensorLength)}...${username.substring(username.length - usernameCensorLength)}';
52+
attributes['name'] = userData['name'];
53+
attributes['email'] = userData['email'];
54+
enabled = userData['enabled'];
55+
}
4856

4957
@override
5058
String toString() {

lib/models/Checkin.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,10 @@ class Checkin extends Model {
224224
AuthRule(
225225
authStrategy: AuthStrategy.PRIVATE,
226226
operations: [
227-
ModelOperation.READ
227+
ModelOperation.CREATE,
228+
ModelOperation.READ,
229+
ModelOperation.UPDATE,
230+
ModelOperation.DELETE
228231
])
229232
];
230233

0 commit comments

Comments
 (0)