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

feat(chrome-ext): support states #1787

Merged
merged 3 commits into from
Jul 18, 2024
Merged

Conversation

matthieu-crouzet
Copy link
Contributor

@matthieu-crouzet matthieu-crouzet commented May 15, 2024

Proposed change

image

  • Add current language in state (if has been changed?)
  • Add the schema in state json exported file
  • Validate the json imported file with the schema
  • Add reset button when configuration is changed
  • Choose between the save of only the override or all the current value
    • Split this choice by category (theming / localization / configuration / language)
  • Support the capability to close the chrome extension and reopen without loosing unsaved changes
    • Or find a way to block the closing of the devtools if unsaved changes and ask if they want to save it or not
  • Add capability to let the app select the state to activate on bootstrap (query param?)
  • Move the save button in the select of the states and remove the warning border
  • Add new import state methods
    • By URL
    • By textarea

Related issues

@matthieu-crouzet matthieu-crouzet requested a review from a team as a code owner May 15, 2024 08:24
Copy link

nx-cloud bot commented May 15, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit d046131. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

@Component({
selector: 'o3r-state-panel',
templateUrl: './state-panel.template.html',
styles: `
Copy link
Contributor

Choose a reason for hiding this comment

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

should the styles be in an scss file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both solutions are okay

@sdo-1A
Copy link
Contributor

sdo-1A commented May 17, 2024

add the state feature to the apps/chrome-devtools/README.md

Edit; covered in #1962

@matthieu-crouzet matthieu-crouzet force-pushed the feat/chrome-state branch 3 times, most recently from d9cfc16 to 6bdd008 Compare May 17, 2024 14:35
sdo-1A
sdo-1A previously approved these changes May 17, 2024
apps/chrome-devtools/src/app-devtools/app.component.html Outdated Show resolved Hide resolved
@@ -7,6 +7,7 @@
"permissions": [
"activeTab",
"scripting",
"storage",
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not forget to add a justification to this permission to the Chrome Developer Portal when publishing this new version (Otherwise the publication maybe rejected)

@cpaulve-1A
Copy link
Contributor

cpaulve-1A commented May 27, 2024

We need to provide a documentation to help a user with this feature.
It should answer the following questions:

  • how to whitelist a domain
  • how to activate a state - do they need to do it manually on the extension via the debugger tool or is it automatic?
  • do we support the same state in two different tabs ? (What happens in this case?)

Edit: new Issue create to cover this #1962

Comment on lines +85 to 87
public stateCompareWithFn(state: State, selectedStateName: string) {
return state.name === selectedStateName;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public stateCompareWithFn(state: State, selectedStateName: string) {
return state.name === selectedStateName;
}
public stateCompareWithFn = (state: State, selectedStateName: string) => state.name === selectedStateName;

there is no problem here but if we were to use this, it could lead to some issues as this method is passed as input in the template and lose the component context (I assume)

@cpaulve-1A cpaulve-1A changed the base branch from main to release/11.0.0-rc July 15, 2024 07:30
@cpaulve-1A cpaulve-1A removed bug Something isn't working breaking change This issue or pull request introduces a breaking change labels Jul 15, 2024
vscaiceanu-1a
vscaiceanu-1a previously approved these changes Jul 15, 2024
const extensionMessage = toSignal(this.connectionService.message$.pipe(filter(isRuleEngineEventsMessage)));
effect(() => {
const message = extensionMessage();
if (message) {
Copy link
Contributor

@mrednic-1A mrednic-1A Jul 17, 2024

Choose a reason for hiding this comment

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

not blocking: not needed to check the 'undefined' case as it is handled in the filter callback

matthieu-crouzet and others added 3 commits July 18, 2024 14:48
Limit the number of key translation displayed and only create inputs for displayed items

Encourage the user to use the search bar to find their translation
Fix issue on localization not available when currentLanguage or lang list is not set
Add tsdoc and json schema description
Handle the app connection state with signals
Add new option.html in nx input/output to avoid future cache issue
@cpaulve-1A cpaulve-1A merged commit f6941f6 into release/11.0.0-rc Jul 18, 2024
20 checks passed
@cpaulve-1A cpaulve-1A deleted the feat/chrome-state branch July 18, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants