forked from jupyterlab/jupyterlab
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add readonly indicator (jupyterlab#14600)
* add readonly to `DocumentWidget.contentHeader.dataset` * added `readonly.svg` to icons * add semi-loud readonly label to front of notebook toolbar * Move readonly status to next to kernel/debugger, make it not a ToolbarButtonClass * debugging * notification is showing up * rebasing work * well formatted * improve css classname and change label from document to notebook is read-only * cleanup * remove unused code * remove unused code * add translators * added read-only tag to non-notebook files, updated tag to say notebook vs file. file toolbar looks off when a file isn't read-only though * toolbar is showing up properly on writeable fileeditors. indicator on fileeditors is still on left side * failing because of cirucular dependency * Still fialing for circular dependency * adding component * read-only label injection is working * working with toolbar injection * fixes read-only label for RTC * update yarn.lock * Automatic application of license header * undoin unneeded changes * clean up code * Update packages/docregistry/src/default.ts Co-authored-by: Michał Krassowski <[email protected]> * updates based on PR review * adding font-size to .jp-ToolbarLabelComponent * remove Notification, add dialog for save-all, update label on disabled save icon when read-only * Update packages/docregistry/src/components.tsx Co-authored-by: Michał Krassowski <[email protected]> * update * fix save-all read-only notification * Fix error on eslint:typed * try making _translator private again * updated on rebase * change dialog back to Notification, add autoclose option * Update packages/ui-components/style/toolbar.css Co-authored-by: Michał Krassowski <[email protected]> --------- Co-authored-by: telamonian <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Michał Krassowski <[email protected]>
- Loading branch information
1 parent
ecf684f
commit 272e390
Showing
8 changed files
with
87 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) Jupyter Development Team. | ||
* Distributed under the terms of the Modified BSD License. | ||
*/ | ||
|
||
import { ReactWidget } from '@jupyterlab/apputils'; | ||
import { ITranslator, nullTranslator } from '@jupyterlab/translation'; | ||
import { Widget } from '@lumino/widgets'; | ||
import * as React from 'react'; | ||
|
||
import { IDocumentWidget } from './index'; | ||
|
||
/** | ||
* create readonly label toolbar item | ||
*/ | ||
export function createReadonlyLabel( | ||
panel: IDocumentWidget, | ||
translator?: ITranslator | ||
): Widget { | ||
let trans = (translator ?? nullTranslator).load('jupyterlab'); | ||
return ReactWidget.create( | ||
<div> | ||
<span | ||
className="jp-ToolbarLabelComponent" | ||
title={trans.__( | ||
`Document is permissioned read-only; "save" is disabled, use "save as..." instead` | ||
)} | ||
> | ||
{trans.__(`%1 is read-only`, panel.context.contentsModel?.type)} | ||
</span> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters