-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Don't show external label in label selector #161
Conversation
Your Render PR Server URL is https://ozone-staging-pr-161.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cqttct3v2p9s739u466g. |
9ae2e40
to
490ebb4
Compare
@@ -37,7 +37,7 @@ | |||
"labels":[ | |||
{ | |||
"ver":1, | |||
"src":"did:plc:4wke3qtisoohr7tf6vfhe5r2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these had to be changed because we never used the src value for any functionality being tested, now that we're hitting that path in tests, we need to make sure the src matches with the test dataset.
(label) => !isSelfLabel(label), | ||
)} | ||
defaultLabels={currentLabels.filter((label) => { | ||
const serviceDid = client.getServiceDid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that this "DID" contains the service id #atproto_labeler
, yet l.src
below will omit that? Or does getServiceDid()
return just the DID without the service id on the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right yeah that needs to be trimmed out thanks!
const isExternalLabel = allLabels.find((l) => { | ||
return l.val === label && l.src !== serviceDid | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No biggie, but if we're trying to get a bool out (as indicated by the name isExternalLabel
) then some()
does that for us.
const isExternalLabel = allLabels.find((l) => { | |
return l.val === label && l.src !== serviceDid | |
}) | |
const isExternalLabel = allLabels.some((l) => { | |
return l.val === label && l.src !== serviceDid | |
}) |
made the changes requested and merging but happy to make other changes if needed. |
When taking label action, the label selector shows all labels that are currently applied on the subject and as a result, any label applied by an external labeler can be
unselected
. However, in reality, this doesn't do anything since one can not remove a label applied by an external labeler.To reduce confusion around this, this PR removes external labelers from label selector.