-
Notifications
You must be signed in to change notification settings - Fork 34
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
base: main
Are you sure you want to change the base?
Conversation
774047e
to
afd4fd2
Compare
@Component({ | ||
selector: 'o3r-state-panel', | ||
templateUrl: './state-panel.template.html', | ||
styles: ` |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both solutions are okay
apps/chrome-devtools/src/app-devtools/state-panel/state-panel.component.ts
Outdated
Show resolved
Hide resolved
apps/chrome-devtools/src/app-devtools/state-panel/state-panel.template.html
Outdated
Show resolved
Hide resolved
add the state feature to the |
e7d8590
to
d9cfc16
Compare
d9cfc16
to
6bdd008
Compare
"name" | ||
], | ||
"properties": { | ||
"color": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing description to the properties
</ng-template> | ||
</li> | ||
</ul> | ||
<form [formGroup]="form" class="px-4 pt-{{hasLocalChanges() ? '2' : '3'}} ng-pristine ng-valid ng-touched border-bottom ms-auto"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's be CSS optimizer ready and not cut css class.
<form [formGroup]="form" class="px-4 pt-{{hasLocalChanges() ? '2' : '3'}} ng-pristine ng-valid ng-touched border-bottom ms-auto"> | |
<form [formGroup]="form" class="px-4 {{hasLocalChanges() ? 'pt-2' : 'pt-3'}} ng-pristine ng-valid ng-touched border-bottom ms-auto"> |
@@ -7,6 +7,7 @@ | |||
"permissions": [ | |||
"activeTab", | |||
"scripting", | |||
"storage", |
There was a problem hiding this comment.
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)
this.debugPanelService.update(msg); | ||
} | ||
}); | ||
const activateStateNameFormValueChanges = toSignal(this.form.controls.activeStateName.valueChanges, { initialValue: this.activeStateName() }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be nice to establish some recommendation and consistency over the code on how we handle the link between a form valueChange and a signal
this.stateService.setActiveState(stateName); | ||
} | ||
|
||
public updateState(stateName: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing tsdoc for this file
if (!el) { | ||
return; | ||
} | ||
el.nativeElement.innerHTML = (e as Error).message; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not handle the importStateText as another signal?
@@ -31,6 +37,64 @@ const isInjectionContentMessage = (content: any): content is InjectContentMessag | |||
return content?.dataType === 'inject'; | |||
}; | |||
|
|||
|
|||
const isApplicationInformationMessage = (data?: OtterMessageContent): data is ApplicationInformationContentMessage => data?.dataType === 'applicationInformation'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing tsdoc in this file
We need to provide a documentation to help a user with this feature.
|
import type { ExtensionMessage } from './interface'; | ||
import type { InjectContentMessage, OtterMessage, OtterMessageContent, otterMessageType } from '@o3r/core'; | ||
import type { ApplicationInformationContentMessage } from '@o3r/application'; | ||
import { type scriptToInject as ScriptToInject } from '../services/connection.service'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { type scriptToInject as ScriptToInject } from '../services/connection.service'; | |
import type { scriptToInject as ScriptToInject } from '../services/connection.service'; |
do not change anything but accentuate the point that only import type
is allow in this file
), | ||
{ initialValue: false } | ||
); | ||
private readonly lang = signal<string | undefined>(undefined); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be declared before public
field.
I was thinking the linter would check it :S
Proposed change
Related issues