Skip to content

Commit

Permalink
temp stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
fpaul-1A committed Nov 20, 2024
1 parent 7aed3af commit f19fa65
Show file tree
Hide file tree
Showing 44 changed files with 452 additions and 235 deletions.
1 change: 1 addition & 0 deletions apps/showcase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@ngx-translate/core": "~15.0.0",
"@nx/jest": "~19.5.0",
"@o3r-training/showcase-sdk": "workspace:^",
"@o3r-training/training-sdk": "workspace:^",
"@o3r-training/training-tools": "workspace:^",
"@o3r/application": "workspace:^",
"@o3r/components": "workspace:^",
Expand Down
5 changes: 5 additions & 0 deletions apps/showcase/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@
"glob": "*.json",
"input": "packages/@o3r-training/training-sdk/dist/structure",
"output": "/assets/@o3r-training/training-sdk/structure"
},
{
"glob": "*.json",
"input": "packages/@o3r-training/showcase-sdk/dist/structure",
"output": "/assets/@o3r-training/showcase-sdk/structure"
}
],
"styles": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavPresComponent } from '../../compo
import { AsyncPipe } from '@angular/common';
import { ComponentReplacementPresComponent } from '../../components/showcase/component-replacement/component-replacement-pres.component';
import { RouterModule } from '@angular/router';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';

@O3rComponent({ componentType: 'Page' })
@Component({
Expand All @@ -22,8 +22,7 @@ import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
IN_PAGE_NAV_PRES_DIRECTIVES,
ComponentReplacementPresComponent,
MarkdownModule
],
providers: [provideMarkdown()]
]
})
export class ComponentReplacementComponent implements AfterViewInit {
private readonly inPageNavPresService = inject(InPageNavPresService);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { ComponentReplacementComponent } from './component-replacement.component';
import { RouterModule } from '@angular/router';
import { AsyncPipe } from '@angular/common';
import { provideMarkdown } from 'ngx-markdown';
import { ComponentReplacementPresComponent } from '../../components/showcase/component-replacement/component-replacement-pres.component';

describe('ComponentReplacementComponent', () => {
Expand All @@ -13,7 +14,8 @@ describe('ComponentReplacementComponent', () => {
await TestBed.configureTestingModule({
imports: [ComponentReplacementComponent,
RouterModule.forRoot([]),
AsyncPipe]
AsyncPipe],
providers: [provideMarkdown()]
}).overrideComponent(ComponentReplacementComponent, {
remove: { imports: [ComponentReplacementPresComponent] }
}).compileComponents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AfterViewInit, ChangeDetectionStrategy, Component, computed, inject, Qu
import { RouterModule } from '@angular/router';
import { ConfigurationBaseServiceModule } from '@o3r/configuration';
import { O3rComponent } from '@o3r/core';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';
import { ConfigurationPresComponent, IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavLink, InPageNavLinkDirective, InPageNavPresService } from '../../components/index';
import { ConfigurationPresConfig } from '../../components/showcase/configuration/configuration-pres.config';

Expand All @@ -29,7 +29,6 @@ const CONFIG_OVERRIDE: ConfigurationPresConfig = {
AsyncPipe,
MarkdownModule
],
providers: [provideMarkdown()],
templateUrl: './configuration.template.html',
styleUrls: ['./configuration.style.scss'],
encapsulation: ViewEncapsulation.None,
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/src/app/configuration/configuration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterModule } from '@angular/router';
import { StoreModule } from '@ngrx/store';
import { O3rElement } from '@o3r/testing/core';
import { provideMarkdown } from 'ngx-markdown';
import { ConfigurationComponent } from './configuration.component';
import { ConfigurationFixtureComponent } from './configuration.fixture';
let componentFixture: ConfigurationFixtureComponent;
Expand All @@ -18,7 +19,8 @@ describe('ConfigurationComponent', () => {
StoreModule.forRoot(),
RouterModule.forRoot([]),
AsyncPipe
]
],
providers: [provideMarkdown()]
});
fixture = TestBed.createComponent(ConfigurationComponent);
component = fixture.componentInstance;
Expand Down
3 changes: 1 addition & 2 deletions apps/showcase/src/app/design-token/design-token.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AsyncPipe } from '@angular/common';
import { AfterViewInit, ChangeDetectionStrategy, Component, inject, QueryList, ViewChildren, ViewEncapsulation } from '@angular/core';
import { RouterLink } from '@angular/router';
import { O3rComponent } from '@o3r/core';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';
import { DesignTokenPresComponent, IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavLink, InPageNavLinkDirective, InPageNavPresService } from '../../components';

@O3rComponent({ componentType: 'Page' })
Expand All @@ -16,7 +16,6 @@ import { DesignTokenPresComponent, IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavLink, I
IN_PAGE_NAV_PRES_DIRECTIVES,
MarkdownModule
],
providers: [provideMarkdown()],
templateUrl: './design-token.template.html',
styleUrl: './design-token.style.scss',
encapsulation: ViewEncapsulation.None,
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/src/app/design-token/design-token.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterModule } from '@angular/router';
import { provideMarkdown } from 'ngx-markdown';

import { DesignTokenComponent } from './design-token.component';

Expand All @@ -12,7 +13,8 @@ describe('DesignTokenComponent', () => {
imports: [
DesignTokenComponent,
RouterModule.forRoot([])
]
],
providers: [provideMarkdown()]
})
.compileComponents();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AfterViewInit, ChangeDetectionStrategy, Component, inject, QueryList, V
import { RouterModule } from '@angular/router';
import { O3rComponent } from '@o3r/core';
import { DynamicContentModule } from '@o3r/dynamic-content';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';
import { DynamicContentPresComponent, IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavLink, InPageNavLinkDirective, InPageNavPresService } from '../../components/index';

@O3rComponent({ componentType: 'Page' })
Expand All @@ -18,7 +18,6 @@ import { DynamicContentPresComponent, IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavLink
AsyncPipe,
MarkdownModule
],
providers: [provideMarkdown()],
templateUrl: './dynamic-content.template.html',
styleUrls: ['./dynamic-content.style.scss'],
encapsulation: ViewEncapsulation.None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AsyncPipe } from '@angular/common';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterModule } from '@angular/router';
import { O3rElement } from '@o3r/testing/core';
import { provideMarkdown } from 'ngx-markdown';
import { DynamicContentComponent } from './dynamic-content.component';
import { DynamicContentFixtureComponent } from './dynamic-content.fixture';
let componentFixture: DynamicContentFixtureComponent;
Expand All @@ -16,7 +17,8 @@ describe('DynamicContentComponent', () => {
DynamicContentComponent,
RouterModule.forRoot([]),
AsyncPipe
]
],
providers: [provideMarkdown()]
});
fixture = TestBed.createComponent(DynamicContentComponent);
component = fixture.componentInstance;
Expand Down
3 changes: 1 addition & 2 deletions apps/showcase/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
import { O3rComponent } from '@o3r/core';
import { DynamicContentModule } from '@o3r/dynamic-content';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';

@O3rComponent({ componentType: 'Page' })
@Component({
selector: 'o3r-home',
standalone: true,
imports: [DynamicContentModule, MarkdownModule],
providers: [provideMarkdown()],
templateUrl: './home.template.html',
styleUrls: ['./home.style.scss'],
encapsulation: ViewEncapsulation.None,
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/src/app/home/home.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideMarkdown } from 'ngx-markdown';
import { HomeComponent } from './home.component';

describe('HomeComponent', () => {
Expand All @@ -7,7 +8,8 @@ describe('HomeComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [HomeComponent]
imports: [HomeComponent],
providers: [provideMarkdown()]
});
fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
Expand Down
3 changes: 1 addition & 2 deletions apps/showcase/src/app/localization/localization.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AsyncPipe } from '@angular/common';
import { AfterViewInit, ChangeDetectionStrategy, Component, inject, QueryList, ViewChildren, ViewEncapsulation } from '@angular/core';
import { RouterModule } from '@angular/router';
import { O3rComponent } from '@o3r/core';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';
import { IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavLink, InPageNavLinkDirective, InPageNavPresService, LocalizationPresComponent } from '../../components/index';

@O3rComponent({ componentType: 'Page' })
Expand All @@ -16,7 +16,6 @@ import { IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavLink, InPageNavLinkDirective, InP
AsyncPipe,
MarkdownModule
],
providers: [provideMarkdown()],
templateUrl: './localization.template.html',
styleUrls: ['./localization.style.scss'],
encapsulation: ViewEncapsulation.None,
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/src/app/localization/localization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { RouterModule } from '@angular/router';
import { TranslateCompiler, TranslateFakeCompiler } from '@ngx-translate/core';
import { LocalizationService } from '@o3r/localization';
import { mockTranslationModules } from '@o3r/testing/localization';
import { provideMarkdown } from 'ngx-markdown';
import { LocalizationComponent } from './localization.component';
const localizationConfiguration = { language: 'en' };
const mockTranslations = {
Expand All @@ -25,7 +26,8 @@ describe('LocalizationComponent', () => {
LocalizationComponent,
...mockTranslationModules(localizationConfiguration, mockTranslations, mockTranslationsCompilerProvider),
AsyncPipe
]
],
providers: [provideMarkdown()]
});
fixture = TestBed.createComponent(LocalizationComponent);
component = fixture.componentInstance;
Expand Down
3 changes: 1 addition & 2 deletions apps/showcase/src/app/rules-engine/rules-engine.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
Ruleset,
UnaryOperator
} from '@o3r/rules-engine';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';
import { firstValueFrom } from 'rxjs';
import { IN_PAGE_NAV_PRES_DIRECTIVES, InPageNavLink, InPageNavLinkDirective, InPageNavPresService, RulesEnginePresComponent } from '../../components/index';
import { environment } from '../../environments/environment.development';
Expand Down Expand Up @@ -58,7 +58,6 @@ import { duringSummer } from '../../operators/index';
AsyncPipe,
MarkdownModule
],
providers: [provideMarkdown()],
templateUrl: './rules-engine.template.html',
styleUrls: ['./rules-engine.style.scss'],
encapsulation: ViewEncapsulation.None,
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/src/app/rules-engine/rules-engine.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { TranslateCompiler, TranslateFakeCompiler } from '@ngx-translate/core';
import { LocalizationService } from '@o3r/localization';
import { RulesEngineRunnerModule } from '@o3r/rules-engine';
import { mockTranslationModules } from '@o3r/testing/localization';
import { provideMarkdown } from 'ngx-markdown';
import { RulesEngineComponent } from './rules-engine.component';
import { RouterModule } from '@angular/router';

Expand All @@ -33,7 +34,8 @@ describe('RulesEngineComponent', () => {
RouterModule.forRoot([]),
...mockTranslationModules(localizationConfiguration, mockTranslations, mockTranslationsCompilerProvider),
AsyncPipe
]
],
providers: [provideMarkdown()]
});
global.fetch = jest.fn(() =>
Promise.resolve({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
import { O3rComponent } from '@o3r/core';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';

@O3rComponent({ componentType: 'Page' })
@Component({
selector: 'o3r-run-app-locally',
standalone: true,
imports: [MarkdownModule],
providers: [provideMarkdown()],
templateUrl: './run-app-locally.template.html',
styleUrls: ['./run-app-locally.style.scss'],
encapsulation: ViewEncapsulation.None,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideMarkdown } from 'ngx-markdown';

import { RunAppLocallyComponent } from './run-app-locally.component';

Expand All @@ -8,7 +9,8 @@ describe('RunAppLocallyComponent', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [RunAppLocallyComponent]
imports: [RunAppLocallyComponent],
providers: [provideMarkdown()]
});
fixture = TestBed.createComponent(RunAppLocallyComponent);
component = fixture.componentInstance;
Expand Down
3 changes: 1 addition & 2 deletions apps/showcase/src/app/sdk/sdk.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AsyncPipe } from '@angular/common';
import { AfterViewInit, ChangeDetectionStrategy, Component, inject, QueryList, ViewChildren, ViewEncapsulation } from '@angular/core';
import { RouterLink } from '@angular/router';
import { O3rComponent } from '@o3r/core';
import { MarkdownModule, provideMarkdown } from 'ngx-markdown';
import { MarkdownModule } from 'ngx-markdown';
import {
IN_PAGE_NAV_PRES_DIRECTIVES,
InPageNavLink,
Expand All @@ -22,7 +22,6 @@ import {
AsyncPipe,
MarkdownModule
],
providers: [provideMarkdown()],
templateUrl: './sdk.template.html',
styleUrls: ['./sdk.style.scss'],
encapsulation: ViewEncapsulation.None,
Expand Down
4 changes: 3 additions & 1 deletion apps/showcase/src/app/sdk/sdk.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { PetApiFixture } from '@o3r-training/showcase-sdk/fixtures';
import { AsyncPipe } from '@angular/common';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterModule } from '@angular/router';
import { provideMarkdown } from 'ngx-markdown';

import { SdkComponent } from './sdk.component';
import '@angular/localize/init';
Expand All @@ -21,7 +22,8 @@ describe('SdkComponent', () => {
AsyncPipe
],
providers: [
{provide: PetApi, useValue: petApiFixture}
{provide: PetApi, useValue: petApiFixture},
provideMarkdown()
]
});
fixture = TestBed.createComponent(SdkComponent);
Expand Down
35 changes: 34 additions & 1 deletion apps/showcase/src/assets/trainings/sdk/program.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,40 @@
},
{
"stepTitle": "How to use the Otter SDK?",
"htmlContentUrl": "./steps/typescript-sdk/instructions.md"
"htmlContentUrl": "./steps/typescript-sdk/instructions.md",
"filesConfiguration": {
"name": "how-to-use-otter-sdk",
"startingFile": "apps/tutorial-app/src/app/app.component.ts",
"urls": [
{
"path": ".",
"contentUrl": "./shared/monorepo-template.json"
},
{
"path": "./libs/sdk",
"contentUrl": "@o3r-training/showcase-sdk/structure/spec.json"
},
{
"path": "./libs/sdk/src",
"contentUrl": "@o3r-training/showcase-sdk/structure/src.json"
},
{
"path": "./apps/tutorial-app/src/app",
"contentUrl": "./steps/typescript-sdk/exercise.json"
}
],
"solutionUrls": [
{
"path": "./apps/tutorial-app/src/app",
"contentUrl": "./steps/typescript-sdk/solution.json"
}
],
"mode": "interactive",
"commands": [
"npm install --legacy-peer-deps --ignore-scripts --force",
"npm run ng run tutorial-app:serve"
]
}
},
{
"stepTitle": "Customize your fetch client with plugins",
Expand Down
Loading

0 comments on commit f19fa65

Please sign in to comment.