-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#415 Update solar section to include other planets
- Loading branch information
1 parent
53f4eec
commit ef9ad11
Showing
19 changed files
with
646 additions
and
28 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
33 changes: 33 additions & 0 deletions
33
.vscode/ngfg-templates/__name__.component.stories.ts.mustache
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,33 @@ | ||
import { Meta, StoryObj } from '@storybook/angular'; | ||
import { StoryFnAngularReturnType } from '@storybook/angular/dist/client/types'; | ||
|
||
import { {{upperCamelCaseName}}Component } from './{{dashCaseName}}.component'; | ||
|
||
type ComponentWithCustomControls = {{upperCamelCaseName}}Component; // & { }; | ||
|
||
const meta: Meta<ComponentWithCustomControls> = { | ||
// TODO: Make sure this title path is correct, uncomment tile, then remove this comment. OR remove both comment and title | ||
// title: 'Cheat Sheets/Game Base/{{upperReadableName}}', | ||
component: {{upperCamelCaseName}}Component, | ||
// decorators: [moduleMetadata({ imports: [] }), applicationConfig({ providers: [ importProvidersFrom() ]})], | ||
parameters: { | ||
docs: { description: { component: `{{upperCamelCaseName}}` } }, | ||
// layout: 'fullscreen', | ||
}, | ||
argTypes: { | ||
/** === Input Mapping === */ | ||
// input: { options: ['---', ...Object.values(YourEnum)], mapping: YourEnum & { '---': undefined }, control: { type: 'select' }} | ||
/** === Output Actions === */ | ||
// inputChange: { action: 'inputChange', table: { disable: true } } | ||
/** === Control Hide === */ | ||
// someControl: { table: { disable: true } } | ||
/** === Control Disable === */ | ||
// someControl: { control: { disable: true } } | ||
}, | ||
args: {}, | ||
}; | ||
export default meta; | ||
|
||
export const {{upperCamelCaseName}}: StoryObj<ComponentWithCustomControls> = { | ||
render: (args): StoryFnAngularReturnType => ({ props: args }), | ||
} |
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,31 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { Component } from '@angular/core'; | ||
import { DataService } from 'app/services'; | ||
import { FactorioIconModule } from 'app/shared'; | ||
import { CheatSheetTemplateComponent } from 'app/shared/cheat-sheet-template/cheat-sheet-template.component'; | ||
|
||
import { {{constantCaseName}}_DATA, {{upperCamelCaseName}}Data } from './{{dashCaseName}}.data'; | ||
|
||
export const {{constantCaseName}}_SHEET_ICON = 'Solar_panel'; | ||
export const {{constantCaseName}}_SHEET_TITLE = 'Solar Power'; | ||
|
||
@Component({ | ||
selector: '{{componentPrefix}}-{{dashCaseName}}', | ||
templateUrl: './{{dashCaseName}}.component.html', | ||
styles: [':host{display:contents}'], // Makes component host as if it was not there, can offer less css headaches. Use @HostBinding class approach for easier overrides. | ||
// host: { class: 'contents' }, | ||
standalone: true, | ||
imports: [ | ||
CommonModule, | ||
CheatSheetTemplateComponent, | ||
FactorioIconModule, | ||
], | ||
}) | ||
export class {{upperCamelCaseName}}Component { | ||
protected readonly cheatSheetIconId: string = {{constantCaseName}}_SHEET_ICON; | ||
protected readonly cheatSheetTitle: string = {{constantCaseName}}_SHEET_TITLE; | ||
|
||
protected readonly {{constantCaseName}}_DATA: PowerSolarData = {{constantCaseName}}_DATA; | ||
|
||
constructor(protected dataService: DataService) {} | ||
} |
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,30 @@ | ||
export enum {{upperCamelCaseName}} { | ||
'option1'= 'option1', | ||
} | ||
|
||
export const {{constantCaseName}}_OPTIONS: {{upperCamelCaseName}}[] = Object.values({{upperCamelCaseName}}); | ||
|
||
export function is{{upperCamelCaseName}}(value: string): value is {{upperCamelCaseName}} { | ||
return {{constantCaseName}}_OPTIONS.includes(value as {{upperCamelCaseName}}); | ||
} | ||
|
||
export const {{constantCaseName}}_DISPLAY: Record<{{upperCamelCaseName}}, string> = { | ||
[{{upperCamelCaseName}}.option1]: 'Option 1', | ||
}; | ||
|
||
// export interface {{upperCamelCaseName}}Info { | ||
// id: {{upperCamelCaseName}}; | ||
// display: string; | ||
// } | ||
|
||
// export const {{constantCaseName}}_INFO: Record<{{upperCamelCaseName}}, {{upperCamelCaseName}}Info> = { | ||
// [{{upperCamelCaseName}}.OptionId1]: { | ||
// id: {{upperCamelCaseName}}.OptionId1, | ||
// display: 'Option Id 1', | ||
// }, | ||
// } as const; | ||
|
||
// export const {{constantCaseName}}_INFO_OPTIONS: {{upperCamelCaseName}}Info[] = | ||
// {{constantCaseName}}_OPTIONS.map( | ||
// (o: {{upperCamelCaseName}}): {{upperCamelCaseName}}Info => {{constantCaseName}}_INFO[o], | ||
// ); |
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,17 @@ | ||
import { Provider } from '@angular/core'; | ||
import { Observable, of } from 'rxjs'; | ||
|
||
import { {{upperCamelCaseName}}Service } from './{{dashCaseName}}.service'; | ||
|
||
// export const MOCK_ExampleReturnType: ExampleReturnType = {}; | ||
|
||
export const MOCK_{{upperCamelCaseName}}Service: {{upperCamelCaseName}}Service = { | ||
// method(): Observable<ExampleReturnType> { | ||
// return of(MOCK_ExampleReturnType); | ||
// }, | ||
}; | ||
|
||
export const MOCK_{{upperCamelCaseName}}ServiceProvider: Provider = { | ||
provide: {{upperCamelCaseName}}Service, | ||
useValue: MOCK_{{upperCamelCaseName}}Service, | ||
}; |
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.