feat(#571): admin switch for sharing with people and groups #578
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-571ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First UI slice of #571: the admin control for
ShareInternalDisabled, which #575 has been enforcing server-side with no way to set it.It is a checkbox, not a toggle. The mockup drew toggles; the scout showed every other switch on that screen is an
input[type=checkbox]in.field.check. Matching what is there.Placed second, directly under Public share links, because those two are the pair a reader compares — outside and inside. The three that follow (upload links, require password, maximum expiry) are all modifiers of public links specifically, so putting the new switch after them would read as though it modified them too. It uses the
subfieldvariant so it can carry a hint: "sharing" now means two different things on this page, and the label alone does not separate them.The mapping is the part that can break silently.
shareInternalDisabledis stored negative like its two neighbours, so an instance upgrading into the field keeps sharing on. That inversion is one!and a flipped checkbox still renders perfectly — which is exactly why the existingpure:sharing-policyblock has tests. This extends them:the two sharing switches do not move together— turning public links off must leave internal sharing on, and vice versa. This is the whole reason the field exists, and it is the one a careless refactor would undo;true, notundefined.Red witnessed: 5 failing, every one
undefinedwhere a boolean belongs.One note on how this went, because it is the same class of mistake twice in one session. The first green wrote
!v.shareInternalDisabledon the assumption thatsharingPolicyToForm's parameter was namedv. It is not, and the whole mapping threwv is not defined— eight tests, including four that had been passing. The workflow now reads both signatures out of the block and prints them before splicing. Same lesson as the gofmt-alignment anchors earlier: if the source already contains the fact, do not retype it.Verified:
sharing-policy.test.jsgreen, all eight web tests green,extract.js+node --check(the #389 fence gate) green, the\\uescape guard from #568 green, full Go suite green.