-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(chrome-ext): toggle button for placeholder
- Loading branch information
1 parent
56e22af
commit 7588891
Showing
29 changed files
with
238 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/chrome-devtools/src/components/config-form/config-form.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,12 @@ | ||
[] | ||
[ | ||
{ | ||
"library": "@o3r/showcase", | ||
"name": "PlaceholderComponent", | ||
"placeholders": [ | ||
{ | ||
"id": "placeholder-showcase", | ||
"description": "Showcase placeholder in app" | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './placeholder.component'; |
48 changes: 48 additions & 0 deletions
48
apps/showcase/src/app/placeholder/placeholder.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { type AfterViewInit, ChangeDetectionStrategy, Component, type QueryList, ViewChildren, ViewEncapsulation } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
import { O3rComponent } from '@o3r/core'; | ||
import { PlaceholderModule } from '@o3r/components'; | ||
import { PlaceholderRulesEngineActionHandler, PlaceholderRulesEngineActionModule } from '@o3r/components/rules-engine'; | ||
import { RulesEngineDevtoolsModule, RulesEngineRunnerModule, RulesEngineRunnerService } from '@o3r/rules-engine'; | ||
import { IN_PAGE_NAV_PRES_DIRECTIVES, type InPageNavLink, InPageNavLinkDirective, InPageNavPresService, RulesEnginePresComponent } from '../../components'; | ||
import { TripFactsService } from '../../facts'; | ||
import { AsyncPipe } from '@angular/common'; | ||
|
||
@O3rComponent({ componentType: 'Page' }) | ||
@Component({ | ||
selector: 'o3r-placeholder-page', | ||
standalone: true, | ||
imports: [ | ||
RulesEnginePresComponent, | ||
RulesEngineRunnerModule, | ||
RulesEngineDevtoolsModule, | ||
PlaceholderRulesEngineActionModule, | ||
PlaceholderModule, | ||
RouterModule, | ||
IN_PAGE_NAV_PRES_DIRECTIVES, | ||
AsyncPipe | ||
], | ||
templateUrl: './placeholder.template.html', | ||
styleUrl: './placeholder.style.scss', | ||
encapsulation: ViewEncapsulation.None, | ||
changeDetection: ChangeDetectionStrategy.OnPush | ||
}) | ||
export class PlaceholderComponent implements AfterViewInit { | ||
@ViewChildren(InPageNavLinkDirective) | ||
private readonly inPageNavLinkDirectives!: QueryList<InPageNavLink>; | ||
public links$ = this.inPageNavPresService.links$; | ||
|
||
constructor( | ||
private readonly inPageNavPresService: InPageNavPresService, | ||
private readonly tripFactsService: TripFactsService, | ||
rulesEngine: RulesEngineRunnerService, | ||
placeholderRulesEngineActionHandler: PlaceholderRulesEngineActionHandler | ||
) { | ||
this.tripFactsService.register(); | ||
rulesEngine.actionHandlers.add(placeholderRulesEngineActionHandler); | ||
} | ||
|
||
public ngAfterViewInit() { | ||
this.inPageNavPresService.initialize(this.inPageNavLinkDirectives); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { PlaceholderComponent } from './placeholder.component'; | ||
|
||
describe('PlaceholderComponent', () => { | ||
let component: PlaceholderComponent; | ||
let fixture: ComponentFixture<PlaceholderComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [PlaceholderComponent] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(PlaceholderComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
o3r-placeholder { | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
apps/showcase/src/app/placeholder/placeholder.template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<h1>Placeholder</h1> | ||
<div class="row"> | ||
<div class="right-nav order-1 order-lg-2 col-12 col-lg-2 sticky-lg-top pt-5 pt-lg-0"> | ||
<o3r-in-page-nav-pres | ||
id="localization-nav" | ||
[links]="links$ | async" | ||
> | ||
</o3r-in-page-nav-pres> | ||
</div> | ||
<div class="order-2 order-lg-1 col-12 col-lg-10"> | ||
<h2 id="localization-description">Description</h2> | ||
<div> | ||
<p>The Otter framework provides a placeholder component mechanism to help integrate dynamic HTML elements (with a basic rendering system) at a predefined position in the application.</p> | ||
</div> | ||
|
||
<h2 id="localization-example">Example</h2> | ||
<div class="d-flex flex-column"> | ||
<o3r-placeholder id="placeholder-showcase"> | ||
Placeholder is loading... | ||
</o3r-placeholder> | ||
<o3r-rules-engine-pres></o3r-rules-engine-pres> | ||
</div> | ||
<h2 id="localization-references">References</h2> | ||
<div> | ||
<ul> | ||
<li> | ||
<a href="https://github.com/AmadeusITGroup/otter/blob/main/docs/components/PLACEHOLDERS.md" target="_blank" rel="noopener">Placeholder documentation</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> |
9 changes: 9 additions & 0 deletions
9
apps/showcase/src/assets/placeholders/placeholder-showcase.schema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"template": "<p>My fact: <%= outboundDate %></p>", | ||
"vars": { | ||
"outboundDate": { | ||
"value": "outboundDate", | ||
"type": "fact" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
packages/@o3r/components/src/devkit/components-devtools.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.