-
Notifications
You must be signed in to change notification settings - Fork 9
Dev stage fixes #275
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
base: devStage
Are you sure you want to change the base?
Dev stage fixes #275
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,8 @@ Class { | |
| #instVars : [ | ||
| 'name', | ||
| 'icon', | ||
| 'block' | ||
| 'block', | ||
| 'status' | ||
| ], | ||
| #category : #'Pyramid-Bloc-plugin-navigation' | ||
| } | ||
|
|
@@ -85,3 +86,15 @@ PyramidLibraryElement >> name: anObject [ | |
|
|
||
| name := anObject | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidLibraryElement >> status [ | ||
|
|
||
| ^ status ifNil: [ #ok ] | ||
| ] | ||
|
|
||
| { #category : #accessing } | ||
| PyramidLibraryElement >> status: aSymbol [ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the different status should be defined on class methods (instead of calling #ok or #unstable, call PyramidLibraryElement statusUnstable). Easier to maintain. |
||
|
|
||
| status := aSymbol | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,30 +110,77 @@ PyramidToploThemePlugin class >> toploIconThemeCategoryFromClass: aClass withCat | |
| PyramidToploThemePlugin class >> toploLibraryCategory [ | ||
|
|
||
| <pyramidLibraryCategory: 1> | ||
| | classes elements | | ||
| classes := ToElement allSubclasses , { ToElement }. | ||
| elements := classes | ||
| reject: [ :each | | ||
| each isAbstract or: [ | ||
| (each name findString: 'Abstract') > 0 or: [ | ||
| [ | ||
| each new. | ||
| false ] | ||
| on: Error | ||
| do: [ true ] ] ] ] | ||
| thenCollect: [ :class | | ||
| | allowedClasses allClasses elements knownNotUsable testClass okElements unserializedElements | | ||
| allowedClasses := { | ||
| ToButton. | ||
| ToLabel. | ||
| ToImage. | ||
| ToAlbum. | ||
| ToTextField. | ||
| ToListElement. }. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ToAlbum and ToListElement are functional ? |
||
| knownNotUsable := #( #ToCircularMenuInnerElement | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why need this list ? |
||
| #ToCircularMenuList #ToExPicsumNode | ||
| #ToAnimatedIcon ). | ||
| testClass := Smalltalk at: #ToSerializerTest. | ||
| allClasses := ToElement allSubclasses , { ToElement }. | ||
| allClasses := allClasses reject: [ :each | | ||
| each isAbstract or: [ | ||
| (each name findString: 'Abstract') > 0 ] ]. | ||
| elements := allClasses collect: [ :class | | ||
| | notUsable serializable status | | ||
| notUsable := [ | ||
| class new. | ||
| false ] | ||
| on: Error | ||
| do: [ :e | true ]. | ||
| notUsable := notUsable or: [ | ||
| knownNotUsable includes: | ||
| class name asSymbol ]. | ||
| serializable := [ | ||
| | suite prefix | | ||
| prefix := 'test' , class name. | ||
| suite := testClass suite tests | ||
| select: [ :t | | ||
| t selector beginsWith: | ||
| prefix ]. | ||
| suite isNotEmpty ] | ||
| on: Error | ||
| do: [ false ]. | ||
| status := notUsable | ||
| ifTrue: [ #notUsable ] | ||
| ifFalse: [ | ||
| ((allowedClasses includes: class) and: [ | ||
| serializable ]) | ||
| ifTrue: [ #ok ] | ||
| ifFalse: [ #unstable ] ]. | ||
| PyramidLibraryElement new | ||
| icon: | ||
| (Smalltalk ui icons iconNamed: class systemIconName); | ||
| (Smalltalk ui icons iconNamed: (status = #notUsable | ||
| ifTrue: [ #error ] | ||
| ifFalse: [ | ||
| status = #unstable | ||
| ifTrue: [ #warning ] | ||
| ifFalse: [ class systemIconName ] ])); | ||
| name: class name; | ||
| block: [ { class new } ]; | ||
| status: status; | ||
| yourself ]. | ||
|
|
||
| ^ { (PyramidLibraryCategory new | ||
| name: 'Toplo'; | ||
| icon: (Smalltalk ui icons iconNamed: #box); | ||
| elements: (elements sorted: [ :a :b | a name < b name ]); | ||
| yourself) } | ||
| elements := elements reject: [ :e | e status = #notUsable ]. | ||
| okElements := elements select: [ :e | e status = #ok ]. | ||
| unserializedElements := elements select: [ :e | | ||
| e status = #unstable ]. | ||
| ^ { | ||
| (PyramidLibraryCategory new | ||
| name: 'Toplo'; | ||
| icon: (Smalltalk ui icons iconNamed: #box); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another icon ? With a check ? |
||
| elements: (okElements sorted: [ :a :b | a name < b name ]); | ||
| yourself). | ||
| (PyramidLibraryCategory new | ||
| name: 'Unstable'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe 'Toplo' and 'Unstable' not good names. ''Toplo-Verified' and 'Toplo-Unverified' ? |
||
| icon: (Smalltalk ui icons iconNamed: #warning); | ||
| elements: | ||
| (unserializedElements sorted: [ :a :b | a name < b name ]); | ||
| yourself) } | ||
| ] | ||
|
|
||
| { #category : #adding } | ||
|
|
||
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.
maybe #unstable default