-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components/core): update
SkyHelpService
to allow for updating …
…global help and the utilization of a page default help key (#2734)
- Loading branch information
1 parent
01a1cc2
commit def8123
Showing
9 changed files
with
160 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
import { Injectable } from '@angular/core'; | ||
import { SkyHelpOpenArgs, SkyHelpService } from '@skyux/core'; | ||
import { | ||
SkyHelpOpenArgs, | ||
SkyHelpService, | ||
SkyHelpUpdateArgs, | ||
} from '@skyux/core'; | ||
|
||
@Injectable() | ||
export class PlaygroundHelpService extends SkyHelpService { | ||
public override openHelp(args: SkyHelpOpenArgs): void { | ||
alert('help key: ' + args.helpKey); | ||
public override openHelp(args?: SkyHelpOpenArgs): void { | ||
if (args) { | ||
alert('help key: ' + args.helpKey); | ||
} | ||
} | ||
|
||
public override updateHelp(args: SkyHelpUpdateArgs): void { | ||
if ('helpKey' in args) { | ||
alert('help key update: ' + args.helpKey); | ||
} | ||
|
||
if ('pageDefaultHelpKey' in args) { | ||
alert('page default help key update: ' + args.pageDefaultHelpKey); | ||
} | ||
} | ||
} |
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
13 changes: 13 additions & 0 deletions
13
libs/components/core/src/lib/modules/help/help-update-args.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,13 @@ | ||
/** | ||
* Options for updating a globally accessible help dialog. | ||
*/ | ||
export interface SkyHelpUpdateArgs { | ||
/** | ||
* A unique key that identifies the current help content to display. If set to `undefined`, the page's default help content will be displayed. | ||
*/ | ||
helpKey?: string; | ||
/** | ||
* A unique key that identifies the page's default help content to display. Set this property to `undefined` to unset the current page default help key. | ||
* */ | ||
pageDefaultHelpKey?: string; | ||
} |
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