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

Added platform.isEditable, filtered Open Scripture Editor and Open Resource Viewer dialogs by isEditable #903

Merged
merged 2 commits into from
May 22, 2024

Conversation

tjcouch-sil
Copy link
Member

@tjcouch-sil tjcouch-sil commented May 21, 2024

Also added exercising buttons on hello world web view. Both should do the same no matter what project you have selected since a project is a project and a resource is a resource.

image


This change is Reviewable

rolfheij-sil
rolfheij-sil previously approved these changes May 21, 2024
Copy link
Contributor

@rolfheij-sil rolfheij-sil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!
One quick question. I noticed this sentence a few times:
Projects that are not editable are sometimes called "resources"
Why the 'sometimes'?

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Member

@lyonsil lyonsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't answer why TJ phrased things like this, but I can envision a situation where you are looking at a non-finalized project that you haven't been granted permissions to edit.

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @tjcouch-sil)


c-sharp/Projects/ParatextProjectDataProvider.cs line 227 at r1 (raw file):

        return settingValue switch
        {
            "T" => ResponseToRequest.Succeeded(true),

Do we know for sure that the only situation where "T" or "F" could be a valid parameter is as a boolean? It seems like this is a very particular mapping for one parameter value, not a general rule to enshrine into parameter reading/writing for all parameters.


extensions/src/platform-scripture-editor/src/main.ts line 59 at r1 (raw file):

    projectForWebView.projectId = await papi.dialogs.selectProject({
      title: `Open ${isReadOnly ? 'Resource Viewer' : 'Scripture Editor'}`,

title and prompt should be converted into localized strings at this point.

Copy link
Member Author

@tjcouch-sil tjcouch-sil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I phrased it like that because we don't always call non-editable projects resources. The word project includes editable projects and non-editable projects. I think we probably often use the word project to refer to something we would call a resource. As such, sometimes, but not always, we use the word "resource" for a non-editable project. Is that too confusing? We can always change it. I just didn't want to confuse people further than we already are going to by having these two different words in the first place.

Reviewable status: 5 of 29 files reviewed, 2 unresolved discussions (waiting on @lyonsil and @rolfheij-sil)


c-sharp/Projects/ParatextProjectDataProvider.cs line 227 at r1 (raw file):

Previously, lyonsil (Matt Lyons) wrote…

Do we know for sure that the only situation where "T" or "F" could be a valid parameter is as a boolean? It seems like this is a very particular mapping for one parameter value, not a general rule to enshrine into parameter reading/writing for all parameters.

Good point! I looked at Settings.xml and put in the specific ones that seem to be T or F.


extensions/src/platform-scripture-editor/src/main.ts line 59 at r1 (raw file):

Previously, lyonsil (Matt Lyons) wrote…

title and prompt should be converted into localized strings at this point.

Ah good call. Fixed

lyonsil
lyonsil previously approved these changes May 22, 2024
Copy link
Member

@lyonsil lyonsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 24 of 24 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


c-sharp/Projects/ParatextProjectDataProvider.cs line 227 at r1 (raw file):

Previously, tjcouch-sil (TJ Couch) wrote…

Good point! I looked at Settings.xml and put in the specific ones that seem to be T or F.

Thanks!


extensions/src/platform-scripture-editor/src/main.ts line 59 at r1 (raw file):

Previously, tjcouch-sil (TJ Couch) wrote…

Ah good call. Fixed

Thanks!

…y isEditable, added exercising buttons on hello world web view
…ngs on dialog call, added includeProjectIds on filtering projects
Copy link
Member

@lyonsil lyonsil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@tjcouch-sil tjcouch-sil merged commit 59f04c3 into main May 22, 2024
7 checks passed
@tjcouch-sil tjcouch-sil deleted the filter-open-editor branch May 22, 2024 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants