Skip to content
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

Bug/sc 19462/new editor s gdocs export ignores some layout #2299

Draft
wants to merge 143 commits into
base: sheets-editor-final
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
8177a59
chore: need to adapt SheetContentMetaDataBox
stevekaplan123 Nov 7, 2024
5adeaa9
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Nov 10, 2024
490a1b9
chore: cleanup css for editor
stevekaplan123 Nov 10, 2024
debc6e3
chore: delete button
stevekaplan123 Nov 11, 2024
eb94e21
chore: publish button
stevekaplan123 Nov 11, 2024
8e7372e
chore: start implementing publish button
stevekaplan123 Nov 11, 2024
e2791c9
chore: delete success should load profile
stevekaplan123 Nov 11, 2024
db55ead
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Nov 11, 2024
c589db1
chore: publish button and unpublish button when appropriate
stevekaplan123 Nov 11, 2024
c68f85a
chore: publish button css
stevekaplan123 Nov 11, 2024
7787587
chore: start PublishModal
stevekaplan123 Nov 12, 2024
405557f
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Nov 12, 2024
c677afd
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Nov 12, 2024
a7a1772
chore: togglePublish not working due to lastModified dateModified issue
stevekaplan123 Nov 12, 2024
a0a5b0d
chore: lastModified passed to SheetOptions, dont pass SheetOptions do…
stevekaplan123 Nov 13, 2024
f7894d2
chore: publish button does not open modal but does publish
stevekaplan123 Nov 13, 2024
d42812b
chore: sheetIsPublished doesnt need to be state
stevekaplan123 Nov 13, 2024
7140f96
chore: start publishmodal
stevekaplan123 Nov 14, 2024
36a9e71
chore: use ReactTags in PublishModal
stevekaplan123 Nov 14, 2024
8e33419
chore: use textarea for summary
stevekaplan123 Nov 14, 2024
02d1ad1
chore: dont need to pass sheet
stevekaplan123 Nov 17, 2024
2afcf74
chore: add validation from aboutsheet
stevekaplan123 Nov 19, 2024
51a719f
chore: start css styling of publish box
stevekaplan123 Nov 19, 2024
0bf5ab1
chore: PublishModal contains PublishMenu
stevekaplan123 Nov 20, 2024
252c8d8
fix: published sheets once modified do not get unpublished
stevekaplan123 Nov 20, 2024
d9bfb3c
chore: set publish status on sefaria editor level
stevekaplan123 Nov 20, 2024
6fd6f0f
chore: title and summary implemented using react state
stevekaplan123 Nov 21, 2024
5764fd3
chore: title and summary update but sheet gets saved twice upon initi…
stevekaplan123 Nov 21, 2024
a2ed04c
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Nov 24, 2024
15c8508
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Nov 24, 2024
8f348be
chore: use Untitled placeholder
stevekaplan123 Nov 24, 2024
4ab45e9
chore: default to Untitled in post
stevekaplan123 Nov 24, 2024
b664125
chore: postSheet should be synchronous
stevekaplan123 Nov 26, 2024
1457050
chore: lastModified doesnt need to be state. it can be derived from …
stevekaplan123 Nov 27, 2024
2137345
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Nov 28, 2024
833bd32
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Nov 28, 2024
1b38776
Merge branch 'feature/sc-30092/remove-sidebar-in-sheets-editor' into …
stevekaplan123 Dec 1, 2024
9cab141
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Dec 1, 2024
923eeb9
chore: shared -> common directory
stevekaplan123 Dec 1, 2024
d307f74
chore: css adjustments for publish modal
stevekaplan123 Dec 1, 2024
0acedb6
chore: catch error in calling postSheet
stevekaplan123 Dec 2, 2024
5c31d43
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Dec 11, 2024
ae2dc58
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Dec 11, 2024
79c330f
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Dec 15, 2024
1bade3f
chore: css fixes for sheet options
stevekaplan123 Dec 15, 2024
1b24ed0
chore: if editor changes collections, show immediately in PartOfColle…
stevekaplan123 Dec 15, 2024
368aba4
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Dec 15, 2024
57ae1dc
chore: pass handleCollectionsChange from Sheet to Editor to SheetOptions
stevekaplan123 Dec 15, 2024
9512706
chore: css fix
stevekaplan123 Dec 15, 2024
16f3d8c
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Dec 17, 2024
14f58a9
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Dec 17, 2024
88e543f
chore: add comment
stevekaplan123 Dec 19, 2024
8c73eb8
chore: clarify comment
stevekaplan123 Dec 22, 2024
9b91711
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Dec 23, 2024
b694300
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Dec 23, 2024
8f09e9c
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Dec 23, 2024
5cb57dc
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Dec 23, 2024
184a628
chore: start using readerdisplayoptionsmenu
stevekaplan123 Dec 24, 2024
42411bb
chore: getDirection in SheetMetadatabox
stevekaplan123 Dec 24, 2024
1d5d636
chore: dropdownMenu getDirection
stevekaplan123 Dec 24, 2024
de63f61
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Dec 24, 2024
64a2763
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Dec 24, 2024
0f0a2e4
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Dec 24, 2024
a0c1b28
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Dec 24, 2024
d36513b
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Dec 24, 2024
77eef73
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Dec 24, 2024
e609d76
chore: attempted to fix sheet font size
stevekaplan123 Dec 24, 2024
193b30f
chore: DropdownMenu shouldnt have a tag inside of a tag
stevekaplan123 Dec 30, 2024
316dcce
chore: remove direction from SheetMetaDataBox and SheetMetaDataSegment
stevekaplan123 Dec 30, 2024
f93e08a
chore: generalize css readerOptions for SheetMetaDataBox
stevekaplan123 Dec 30, 2024
5c4d848
chore: remove unnecessary css
stevekaplan123 Dec 30, 2024
feae111
chore: menuIcon to button
stevekaplan123 Dec 30, 2024
b3c0f33
chore: modify sheetmetadatabox css
stevekaplan123 Dec 30, 2024
63b14c2
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Dec 30, 2024
40e8a7b
chore: css fixes
stevekaplan123 Dec 31, 2024
60840df
chore: css fixes for sheetmetadatabox
stevekaplan123 Jan 7, 2025
ec813c1
chore: adjust texts properties menu
stevekaplan123 Jan 7, 2025
483bd03
chore: adjust collections
stevekaplan123 Jan 7, 2025
30bc2af
chore: refactor SheetCollectionsList to include case of topics
stevekaplan123 Jan 8, 2025
4958108
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Jan 12, 2025
8ce15aa
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Jan 12, 2025
156f2f8
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Jan 12, 2025
04c7d70
Merge branch 'feature/sc-30599/language-control' into feature/sc-3129…
stevekaplan123 Jan 12, 2025
d654339
chore: remove bad merge code
stevekaplan123 Jan 12, 2025
73abd64
Merge branch 'feature/sc-30599/language-control' into feature/sc-3129…
stevekaplan123 Jan 12, 2025
b48c096
chore: remove import
stevekaplan123 Jan 13, 2025
5cd8482
chore: fix spelling
stevekaplan123 Jan 13, 2025
9c59449
chore: handle bad data in sheets
stevekaplan123 Jan 13, 2025
1bbc9a6
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Jan 16, 2025
ccb70d0
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Jan 16, 2025
50679b5
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Jan 16, 2025
2f8319c
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Jan 16, 2025
c1be855
chore: handle bad data in sheet.sources
stevekaplan123 Jan 16, 2025
03af069
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Jan 16, 2025
0b55b08
Merge branch 'feature/sc-30599/language-control' into feature/sc-3129…
stevekaplan123 Jan 16, 2025
c78342e
Merge branch 'feature/sc-31291/display-topics-in-sheet-sidebar' into …
stevekaplan123 Jan 20, 2025
c42648c
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Jan 20, 2025
1bc5a8b
chore: update SheetModals
stevekaplan123 Jan 20, 2025
7d64076
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Jan 20, 2025
523efc5
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Jan 20, 2025
96ed9d6
Merge branch 'feature/sc-30599/language-control' into feature/sc-3129…
stevekaplan123 Jan 20, 2025
b939490
Merge branch 'feature/sc-31291/display-topics-in-sheet-sidebar' into …
stevekaplan123 Jan 20, 2025
e50eebd
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Jan 20, 2025
db2a38d
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Jan 20, 2025
92bbaaa
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Jan 21, 2025
38a3a16
chore: finish merging
stevekaplan123 Jan 21, 2025
6974d48
chore: onClick shouldnt be passed to deletebutton
stevekaplan123 Jan 22, 2025
aa411a4
chore: no need for handleCitationClick as copied sheets open in new tab
stevekaplan123 Jan 22, 2025
7d2eed0
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Jan 22, 2025
914241b
chore: oops, repair bad merge
stevekaplan123 Jan 22, 2025
bc13684
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Jan 22, 2025
d738479
Merge branch 'feature/sc-30599/language-control' into feature/sc-3129…
stevekaplan123 Jan 22, 2025
ae6dff4
Merge branch 'feature/sc-31291/display-topics-in-sheet-sidebar' into …
stevekaplan123 Jan 22, 2025
8d42875
chore: /profile to /sheets/profile
stevekaplan123 Jan 23, 2025
8f3b108
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Jan 23, 2025
250ac04
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Jan 23, 2025
2b8fcd6
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Jan 23, 2025
9b27d8d
Merge branch 'feature/sc-30599/language-control' into feature/sc-3129…
stevekaplan123 Jan 23, 2025
2a48e9f
Merge branch 'feature/sc-31291/display-topics-in-sheet-sidebar' into …
stevekaplan123 Jan 23, 2025
2ca6c1d
Merge branch 'sheets-editor-final' into feature/sc-30094/add-sheet-op…
stevekaplan123 Jan 26, 2025
ad59345
Merge branch 'sheets-editor-final' into feature/sc-27385/publish-sett…
stevekaplan123 Jan 26, 2025
8c39638
Merge pull request #2273 from Sefaria/chore/sc-31640/change-urls-in-m…
yitzhakc Jan 26, 2025
fbe83d2
Merge branch 'feature/sc-30093/title-summary-editable-in-sheets-edito…
stevekaplan123 Jan 28, 2025
42d209f
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Jan 28, 2025
6f740a4
Merge remote-tracking branch 'origin/feature/sc-31701/consistent-lang…
stevekaplan123 Feb 3, 2025
68fdd00
Merge branch 'feature/sc-31701/consistent-language-toggle-uis' into f…
stevekaplan123 Feb 3, 2025
be4e10d
Merge branch 'feature/sc-30599/language-control' into feature/sc-3129…
stevekaplan123 Feb 3, 2025
0e8b9b5
chore: backend changes
stevekaplan123 Feb 4, 2025
07f9c70
feat(Sheets): wysiwyg for export
stevekaplan123 Feb 4, 2025
e9e2ad9
chore: adjust css dialog
stevekaplan123 Feb 4, 2025
fe6395f
chore: fix broken editor bilingual display
stevekaplan123 Feb 4, 2025
da45ed9
Merge branch 'sheets-editor-final' into bug/sc-19462/new-editor-s-gdo…
stevekaplan123 Feb 4, 2025
eb3ae8b
Merge branch 'sheets-editor-final' into feature/sc-30094/add-sheet-op…
stevekaplan123 Feb 9, 2025
c27f3cd
Merge branch 'modularization-main' into bug/sc-19462/new-editor-s-gdo…
stevekaplan123 Feb 10, 2025
cd2f39b
chore: language instead of sourceLanguage
stevekaplan123 Feb 11, 2025
4406eac
Merge branch 'sheets-editor-final' into feature/sc-30094/add-sheet-op…
stevekaplan123 Feb 12, 2025
1cb303d
Merge branch 'feature/sc-30094/add-sheet-options-to-sheets-editor' in…
stevekaplan123 Feb 12, 2025
c6073dd
Merge branch 'feature/sc-27385/publish-settings2' into feature/sc-305…
stevekaplan123 Feb 12, 2025
38b91ae
Merge branch 'feature/sc-30599/language-control' into feature/sc-3129…
stevekaplan123 Feb 12, 2025
85c41ac
Merge branch 'feature/sc-31291/display-topics-in-sheet-sidebar' into …
stevekaplan123 Feb 12, 2025
bc1519b
chore: use sheet options not source options
stevekaplan123 Feb 12, 2025
162f84f
chore: change param names
stevekaplan123 Feb 12, 2025
40b041a
chore: sheets editor should be able to hebrew left and hebrew right
stevekaplan123 Feb 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sefaria/model/user_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,7 @@ def public_user_data(uid, ignore_cache=False):

data = {
"name": profile.full_name,
"profileUrl": "/profile/" + profile.slug,
"profileUrl": "/sheets/profile/" + profile.slug,
"imageUrl": profile.profile_pic_url_small,
"position": profile.position,
"organization": profile.organization,
Expand Down
2 changes: 1 addition & 1 deletion sefaria/sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def get_sheets_for_ref(tref, uid=None, in_collection=None):
"assignerName": sheet.get("assignerName", None),
"viaOwnerProfileUrl": sheet.get("viaOwnerProfileUrl", None),
"assignerProfileUrl": sheet.get("assignerProfileUrl", None),
"ownerProfileUrl": "/profile/" + ownerData["slug"],
"ownerProfileUrl": "/sheets/profile/" + ownerData["slug"],
"ownerImageUrl": ownerData.get('profile_pic_url_small',''),
"status": sheet["status"],
"views": sheet["views"],
Expand Down
26 changes: 5 additions & 21 deletions sourcesheets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def make_sheet_class_string(sheet):
"""
Returns a string of class names corresponding to the options of sheet.
"""

o = sheet["options"]
classes = []
classes.append(o.get("language", "bilingual"))
Expand Down Expand Up @@ -1053,8 +1054,6 @@ def sheet_to_html_string(sheet):
Create the html string of sheet with sheet_id.
"""
sheet["sources"] = annotate_user_links(sheet["sources"])
sheet = resolve_options_of_sources(sheet)

try:
owner = User.objects.get(id=sheet["owner"])
author = owner.first_name + " " + owner.last_name
Expand All @@ -1079,23 +1078,6 @@ def sheet_to_html_string(sheet):
return render_to_string('gdocs_sheet.html', context)


def resolve_options_of_sources(sheet):
for source in sheet['sources']:
if 'text' not in source:
continue
options = source.setdefault('options', {})
if not options.get('sourceLanguage'):
source['options']['sourceLanguage'] = sheet['options'].get(
'language', 'bilingual')
if not options.get('sourceLayout'):
source['options']['sourceLayout'] = sheet['options'].get(
'layout', 'sideBySide')
if not options.get('sourceLangLayout'):
source['options']['sourceLangLayout'] = sheet['options'].get(
'langLayout', 'heRight')
return sheet



@gauth_required(scope=['openid', 'https://www.googleapis.com/auth/drive.file', 'https://www.googleapis.com/auth/userinfo.email'], ajax=True)
def export_to_drive(request, credential, sheet_id):
Expand All @@ -1105,16 +1087,18 @@ def export_to_drive(request, credential, sheet_id):
# Using credentials in google-api-python-client.
service = build('drive', 'v3', credentials=credential, cache_discovery=False)
user_info_service = build('oauth2', 'v2', credentials=credential, cache_discovery=False)

sheet = get_sheet(sheet_id)
if 'error' in sheet:
return jsonResponse({'error': {'message': sheet["error"]}})

options = {'language': request.GET.get("language", "bilingual"),
'layout': request.GET.get("layout", "heRight")}
sheet['options'] = sheet['options'] | options

file_metadata = {
'name': strip_tags(sheet['title'].strip()),
'mimeType': 'application/vnd.google-apps.document'
}

html_string = bytes(sheet_to_html_string(sheet), "utf8")

media = MediaIoBaseUpload(
Expand Down
Loading
Loading