Skip to content

Commit

Permalink
Merge pull request #18 from badetitou/innerHTML-widget-representation
Browse files Browse the repository at this point in the history
a specific widget can have a specirfic representation
  • Loading branch information
badetitou authored Mar 23, 2023
2 parents 1d16a4f + 023abe1 commit b32c7b5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ CSNModelExporterAngularBLMaterial >> generateHTMLSourceCodeForBusinessPage: aBLP
currentWriteStream
<< '</mat-tab-group>';
<< String crlf ].
self generateInnerHtmlOf: aBLPageMetier
self generateRootHtmlOf: aBLPageMetier
]

{ #category : #visiting }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ Class {

{ #category : #initialization }
CSNExporterAngularConfiguration >> angularRepresentationOf: aCSNWidget [
aCSNWidget class withAllSuperclasses
do: [:class | mapping
at: class
ifPresent: [ :widgetRepresentation | ^ widgetRepresentation ] ].

mapping
at: aCSNWidget
ifPresent: [ :widgetRepresentation | ^ widgetRepresentation ].
aCSNWidget class withAllSuperclasses do: [ :class |
mapping
at: class
ifPresent: [ :widgetRepresentation | ^ widgetRepresentation ] ].
^ WidgetRepresentation new
]

Expand Down
36 changes: 20 additions & 16 deletions src/Casino-Model-Exporter-Angular/CSNModelExporterAngular.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ CSNModelExporterAngular >> generateAsSubComponent: aCSNWidget [
(exporter currentPath / aCSNWidget getHTMLName) asFileReference
writeStreamDo: [ :aWriteStream |
exporter currentWriteStream: aWriteStream.
exporter generateInnerHtmlOf: aCSNWidget ].
exporter generateRootHtmlOf: aCSNWidget ].

(exporter currentPath / aCSNWidget getTSName) asFileReference
writeStreamDo: [ :aWriteStream |
Expand Down Expand Up @@ -219,7 +219,7 @@ CSNModelExporterAngular >> generateHTMLSourceCodeForBusinessPage: aBLPageMetier
currentWriteStream
<< '</bl-tabs>';
<< String crlf ].
self generateInnerHtmlOf: aBLPageMetier
self generateRootHtmlOf: aBLPageMetier
]

{ #category : #'generate - model' }
Expand Down Expand Up @@ -277,17 +277,9 @@ CSNModelExporterAngular >> generateHTMLSourceCodeForPage: aBLPhase [
]

{ #category : #generate }
CSNModelExporterAngular >> generateInnerHtmlOf: aCSNWidget [
CSNModelExporterAngular >> generateInnerHTMLOf: aCSNWidget [

| angularRepresentation |
self
<< '<form [formGroup]="';
<<< aCSNWidget id uncapitalized;
<<< 'Form';
<<< '">';
indentPlus;
crlf.

aCSNWidget layout ifNotNil: [
angularRepresentation := self angularRepresentationOf: aCSNWidget.
angularRepresentation exportHeaderOf: aCSNWidget with: self.
Expand All @@ -299,11 +291,7 @@ CSNModelExporterAngular >> generateInnerHtmlOf: aCSNWidget [
reject: [ :widget | widget isPageMetier ]
thenDo: [ :widget |
self visit: widget.
currentWriteStream << String crlf ].

self
indentMinus;
<< '</form>'
currentWriteStream << String crlf ]
]

{ #category : #'generate - model' }
Expand Down Expand Up @@ -567,6 +555,22 @@ export class ';
<< String crlf
]

{ #category : #generate }
CSNModelExporterAngular >> generateRootHtmlOf: aCSNWidget [

self
<< '<form [formGroup]="';
<<< aCSNWidget id uncapitalized;
<<< 'Form';
<<< '">';
indentPlus;
crlf.
self generateInnerHTMLOf: aCSNWidget.
self
indentMinus;
<< '</form>'
]

{ #category : #'generate - model' }
CSNModelExporterAngular >> generateRouteSourceCodeForModel: aModel [

Expand Down

0 comments on commit b32c7b5

Please sign in to comment.