Skip to content

Commit d98f66d

Browse files
committed
allow use of a license even for public published shares
1 parent 74eb433 commit d98f66d

File tree

2 files changed

+40
-47
lines changed

2 files changed

+40
-47
lines changed

src/packages/frontend/share/config.tsx

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -422,31 +422,28 @@ export default function Configure(props: Props) {
422422
}
423423
/>
424424
</Paragraph>
425-
{sharingOptionsState == "public_unlisted" && (
426-
<>
427-
<Title level={4}>
428-
<Icon name="key" /> License Code - optional
429-
</Title>
430-
<Paragraph>
431-
<EnterLicenseCode
432-
licenseId={licenseId}
433-
setLicenseId={(licenseId) => {
434-
setLicenseId(licenseId);
435-
props.set_public_path({ site_license_id: licenseId });
436-
}}
437-
/>
438-
<Paragraph type="secondary">
439-
When people edit a copy of your shared document in a new
440-
project, their project will get upgraded using{" "}
441-
<b>
442-
<i>your</i>
443-
</b>{" "}
444-
license. You can thus provide a high quality experience
445-
to the people you share this link with.
446-
</Paragraph>
447-
</Paragraph>
448-
</>
449-
)}
425+
426+
<Title level={4}>
427+
<Icon name="key" /> License Code - optional
428+
</Title>
429+
<Paragraph>
430+
<EnterLicenseCode
431+
licenseId={licenseId}
432+
setLicenseId={(licenseId) => {
433+
setLicenseId(licenseId);
434+
props.set_public_path({ site_license_id: licenseId });
435+
}}
436+
/>
437+
<Paragraph type="secondary">
438+
When people edit a copy of your shared document in a new
439+
project, their project will get upgraded using{" "}
440+
<b>
441+
<i>your</i>
442+
</b>{" "}
443+
license. You can thus provide a high quality experience to
444+
the people you share this link with.
445+
</Paragraph>
446+
</Paragraph>
450447
</div>
451448
<ConfigureJupyterApi
452449
disabled={parent_is_public}

src/packages/next/components/share/configure-public-path.tsx

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -210,27 +210,23 @@ export default function ConfigurePublicPath({ id, project_id, path }: Props) {
210210
</Radio.Group>
211211
</Space>
212212
</EditRow>
213-
{visibility == "unlisted" && (
214-
<EditRow
215-
label="Upgrade with a site license?"
216-
description={
217-
<>
218-
For unlisted shares, you can select a site license that you
219-
manage, and anybody who edits a copy of this share will have
220-
this site license applied to their project. You can track and
221-
remove usage of this license in the{" "}
222-
<A>license management page</A> (coming soon).
223-
</>
224-
}
225-
>
226-
<SelectSiteLicense
227-
defaultLicenseId={original.site_license_id}
228-
onChange={(site_license_id) => {
229-
setEdited({ ...edited, site_license_id });
230-
}}
231-
/>
232-
</EditRow>
233-
)}
213+
<EditRow
214+
label="Upgrade with a license?"
215+
description={
216+
<>
217+
You can select a license that you manage, and anybody who edits a
218+
copy of this share will have this license applied to their
219+
project.
220+
</>
221+
}
222+
>
223+
<SelectSiteLicense
224+
defaultLicenseId={original.site_license_id}
225+
onChange={(site_license_id) => {
226+
setEdited({ ...edited, site_license_id });
227+
}}
228+
/>
229+
</EditRow>
234230
<EditRow
235231
label="Permission"
236232
description={
@@ -259,7 +255,7 @@ function License({ license, onChange }) {
259255
options.push(
260256
<Option key={value} value={value}>
261257
{LICENSES[value]}
262-
</Option>
258+
</Option>,
263259
);
264260
}
265261
return (

0 commit comments

Comments
 (0)