Updates to contacts UI. Sweep for buildIdentity and buildHeaders #35

Merged
anomalist merged 7 commits from contacts-identity into master 2023-07-09 02:58:52 +00:00
Owner

@trentlarson I added a case to Contacts to show a message when no contacts. Also added a (no name) to the Home page since the buttons didn't cover that case.

Rest of this commit is a partial cleanup of identity and header creations. There's an edge case where it's checking for accounts which I didn't cover just yet.

@trentlarson I added a case to Contacts to show a message when no contacts. Also added a (no name) to the Home page since the buttons didn't cover that case. Rest of this commit is a partial cleanup of identity and header creations. There's an edge case where it's checking for accounts which I didn't cover just yet.
anomalist added 1 commit 2023-07-07 09:30:31 +00:00
anomalist added 1 commit 2023-07-07 09:42:56 +00:00
anomalist added 1 commit 2023-07-07 11:33:26 +00:00
trentlarson requested changes 2023-07-08 01:26:49 +00:00
@@ -358,4 +381,1 @@
await accountsDB.open();
const accounts = await accountsDB.accounts.toArray();
this.numAccounts = accounts.length;
Owner

This cuts some extra code: in this case the "this.numAccounts" isn't set and so the "Switch Identifier" section does not show. (I looked for others and didn't see anything obvious but it's worth another look.)

This cuts some extra code: in this case the "this.numAccounts" isn't set and so the "Switch Identifier" section does not show. (I looked for others and didn't see anything obvious but it's worth another look.)
Author
Owner

@trentlarson going to push something after this message. I did a little thinking and approach this in a different way.

@trentlarson going to push something after this message. I did a little thinking and approach this in a different way.
anomalist marked this conversation as resolved
trentlarson reviewed 2023-07-08 01:33:28 +00:00
@@ -53,0 +58,4 @@
if (!identity) {
throw new Error(
"Attempted to load Give records with no identity available.",
Owner

Note that this message doesn't really apply on this page. The original has the more generic: "An ID is chosen but there are no keys for it so it cannot be used to talk with the service." Recommend making some more generic message for all these cases if you want to keep the same error message for them all.

Note that this message doesn't really apply on this page. The original has the more generic: "An ID is chosen but there are no keys for it so it cannot be used to talk with the service." Recommend making some more generic message for all these cases if you want to keep the same error message for them all.
anomalist marked this conversation as resolved
trentlarson reviewed 2023-07-08 01:34:22 +00:00
@@ -456,1 +463,3 @@
this.limitsMessage = data?.error?.message || "Bad server response.";
if (
error.message ===
"Attempted to load Give records with no identity available."
Owner

Someday we can have a specific error type, rather than relying on a message string check. Not critical now.

Someday we can have a specific error type, rather than relying on a message string check. Not critical now.
anomalist marked this conversation as resolved
trentlarson reviewed 2023-07-08 01:36:35 +00:00
@@ -104,0 +109,4 @@
if (!identity) {
throw new Error(
"Attempted to load Give records with no identity available.",
Owner

Here's another case where the message about "Give records" is not appropriate for this screen.

Here's another case where the message about "Give records" is not appropriate for this screen.
anomalist marked this conversation as resolved
trentlarson reviewed 2023-07-08 01:45:54 +00:00
@@ -279,3 +325,3 @@
}
}
createAndSubmitGive(
Owner

Thanks for cutting out this moved stuff!

Thanks for cutting out this moved stuff!
anomalist marked this conversation as resolved
anomalist added 1 commit 2023-07-08 08:19:48 +00:00
anomalist added 1 commit 2023-07-08 08:39:02 +00:00
anomalist added 1 commit 2023-07-08 09:30:51 +00:00
anomalist added 1 commit 2023-07-08 09:42:33 +00:00
anomalist merged commit 81dd6eb595 into master 2023-07-09 02:58:52 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: trent_larson/crowd-funder-for-time-pwa#35