Skip to content

Commit

Permalink
Merge branch 'feature/sc-30092/remove-sidebar-in-sheets-editor' into …
Browse files Browse the repository at this point in the history
…feature/sc-30093/title-summary-editable-in-sheets-editor
  • Loading branch information
stevekaplan123 committed Dec 11, 2024
2 parents 92be7a1 + 6113d8c commit 0e0331c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 19 deletions.
1 change: 1 addition & 0 deletions static/css/s2.css
Original file line number Diff line number Diff line change
Expand Up @@ -13884,6 +13884,7 @@ span.ref-link-color-3 {color: blue}
content: "";
transform: scale(0.75);
} */

.sheetsInPanel .dropdownLinks a.dropdownLinks-button::after {
display: inline-block;
height: 10px;
Expand Down
5 changes: 2 additions & 3 deletions static/js/ConnectionsPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,11 @@ class ConnectionsPanel extends Component {
}

Sefaria.getTranslations(ref).then(versions => this.setState({ availableTranslations: Object.values(versions).flat() })); //for counting translations
Sefaria.getRef(this.props.currentlyVisibleRef).then(data => { //this does not properly return a secionRef for a spanning/ranged ref
Sefaria.getRef(this.props.currentlyVisibleRef).then(data => { //this does not properly return a sectionRef for a spanning/ranged ref
const currRef = (typeof data == "string") ? Sefaria.sectionRef(data) : data["sectionRef"]; //this is an annoying consequence of getRef not actually returning a
// consistent response. Its either the ref from cache or the entire text api response if async.
this.setState({currentlyVisibleSectionRef: currRef});
});
//this.setState({currentlyVisibleSectionRef: Sefaria.sectionRef(this.props.currentlyVisibleRef)});
}
reloadData() {
this.setState({
Expand Down Expand Up @@ -701,7 +700,7 @@ const ToolsList = ({ setConnectionsMode, toggleSignUpModal, openComparePanel, co
// A list of Resources in addition to connection
return (
<div className="toolButtonsList">
<ToolsButton en="Add to Sheet" he="הוספה לדף מקורות" image="sheetsplus.svg" onClick={() => !Sefaria._uid ? toggleSignUpModal(SignUpModalKind.AddToSheet) : setConnectionsMode("Add To Sheet", { "addSource": "mainPanel" })} />
{Sefaria._uid && <ToolsButton en="Add to Sheet" he="הוספה לדף מקורות" image="sheetsplus.svg" onClick={() => setConnectionsMode("Add To Sheet", { "addSource": "mainPanel" })} />}
<ToolsButton en="Dictionaries" he="מילונים" image="dictionaries.svg" urlConnectionsMode="Lexicon" onClick={() => setConnectionsMode("Lexicon")} />
{openComparePanel ? <ToolsButton en="Compare Text" he="טקסט להשוואה" image="compare-panel.svg" onClick={openComparePanel} /> : null}
<ToolsButton en="Notes" he="הערות" image="notes.svg" alwaysShow={true} count={counts["notes"]} urlConnectionsMode="Notes" onClick={() => !Sefaria._uid ? toggleSignUpModal(SignUpModalKind.Notes) : setConnectionsMode("Notes")} />
Expand Down
1 change: 0 additions & 1 deletion static/js/Misc.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { ReaderApp } from './ReaderApp';
import {ToolsButton} from "./ConnectionsPanel";
import {DropdownMenuItemWithIcon} from "./common/DropdownMenu";


/**
* Component meant to simply denote a language specific string to go inside an InterfaceText element
* ```
Expand Down
11 changes: 0 additions & 11 deletions static/js/Sheet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,15 @@ class Sheet extends Component {
const sheetRef = "Sheet " + data.id + (this.props.highlightedNode ? "." + this.props.highlightedNode : "");
this.props.openSheet(sheetRef, true); // Replace state now that data is loaded so History can include sheet title
this.forceUpdate();
this.preloadConnections();
this.updateDivineNameStateWithSheetValue()
}
ensureData() {
if (!this.getSheetFromCache()) {
this.getSheetFromAPI();
} else {
this.preloadConnections();
this.updateDivineNameStateWithSheetValue()
}
}
preloadConnections() {
const data = this.getSheetFromCache();
if (!data) {return; }
for (let i = 0; i < data.sources.length; i++) {
if ("ref" in data.sources[i]) {
Sefaria.related(data.sources[i].ref, () => this.forceUpdate);
}
}
}
updateDivineNameStateWithSheetValue() {
const sheet = this.getSheetFromCache();
this.props.setDivineNameReplacement(sheet.options.divineNames)
Expand Down
2 changes: 1 addition & 1 deletion static/js/TextList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class TextList extends Component {
/>
<ConnectionButtons>
<OpenConnectionTabButton srefs={[link.sourceRef]} openInTabCallback={this.props.onTextClick}/>
<AddConnectionToSheetButton srefs={[link.sourceRef]} addToSheetCallback={this.props.setConnectionsMode}/>
{Sefaria._uid && <AddConnectionToSheetButton srefs={[link.sourceRef]} addToSheetCallback={this.props.setConnectionsMode}/>}
{Sefaria.is_moderator ?
<DeleteConnectionButton delUrl={"/api/links/" + link._id} connectionDeleteCallback={this.onDataChange}/> : null
}
Expand Down
2 changes: 1 addition & 1 deletion static/js/TranslationsBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class VersionsTextList extends Component {
/>
<ConnectionButtons>
<OpenConnectionTabButton srefs={this.props.srefs} openInTabCallback={onRangeClick}/>
<AddConnectionToSheetButton srefs={this.props.srefs} versions={{[language]: vTitle}} addToSheetCallback={this.props.setConnectionsMode}/>
{Sefaria._uid && <AddConnectionToSheetButton srefs={this.props.srefs} versions={{[language]: vTitle}} addToSheetCallback={this.props.setConnectionsMode}/>}
</ConnectionButtons>
</div>);
}
Expand Down
4 changes: 2 additions & 2 deletions static/js/sheets/SheetOptions.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, {useEffect, useState} from "react";
import {DropdownMenu, DropdownMenuItem, DropdownMenuItemWithIcon} from "../common/DropdownMenu";
import {InterfaceText, SaveButtonWithText} from "../Misc";
import Modal from "../shared/modal";
import Modal from "../common/modal";
import {ShareBox} from "../ConnectionsPanel";
import Sefaria from "../sefaria/sefaria";
import $ from "../sefaria/sefariaJquery";
Expand Down Expand Up @@ -67,7 +67,7 @@ const SheetOptions = ({historyObject, toggleSignUpModal, sheetID, editable}) =>
return <GoogleDocExportModal close={() => setExportingMode(false)} sheetID={sheetID}/>;
}
return (
<DropdownMenu menu_icon={"/static/icons/ellipses.svg"}>
<DropdownMenu menuIconComponent={<img src="/static/icons/ellipses.svg" alt="Options"/>}>
<DropdownMenuItem>
<SaveButtonWithText
historyObject={historyObjectForSheet}
Expand Down

0 comments on commit 0e0331c

Please sign in to comment.