-
-
Notifications
You must be signed in to change notification settings - Fork 357
[Live] Add data-error
attribute + fix loading behaviour on error
#1916
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
Open
YummYume
wants to merge
13
commits into
symfony:2.x
Choose a base branch
from
YummYume:feature/error-plugin
base: 2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
c8b8160
Added new ErrorPlugin for data-error attributes and fixed loading sta…
YummYume d68caab
Perform pending requests even on error
YummYume e6038e5
Added tests and documentation for data-error
YummYume baac4dd
Removed unused css rule for data-error + better documentation
YummYume f824a23
Patch doc lint for data-error
YummYume 22e36c1
Patch typo in data-error doc example
YummYume d349edc
Rename data-error to data-live-error and switch error documentation o…
YummYume ce503ff
Revert typing fix for hooks (done in another pr)
YummYume 468ae87
Trigger response:error hook after loading.state:finished hook
YummYume 81f01c3
Rebase error plugin + linter
YummYume 8dedb08
Revert unwanted change for HookManager
YummYume 876e282
Lint HookManager + rebuild assets
YummYume cd3121b
Fix example typo for live components documentation
YummYume File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
27 changes: 27 additions & 0 deletions
27
src/LiveComponent/assets/dist/Component/plugins/ErrorPlugin.d.ts
This file contains hidden or 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,27 @@ | ||
import type { Component } from '../../live_controller'; | ||
import type { PluginInterface } from './PluginInterface'; | ||
export default class ErrorPlugin implements PluginInterface { | ||
static errorAttribute: string; | ||
static isErrorAttribute: string; | ||
static supportedActions: { | ||
show: string; | ||
hide: string; | ||
addClass: string; | ||
removeClass: string; | ||
addAttribute: string; | ||
removeAttribute: string; | ||
}; | ||
attachToComponent(component: Component): void; | ||
showErrors(component: Component): void; | ||
hideErrors(component: Component): void; | ||
private handleErrorToggle; | ||
private handleErrorDirective; | ||
private getErrorDirectives; | ||
private parseErrorAction; | ||
private showElement; | ||
private hideElement; | ||
private addClass; | ||
private removeClass; | ||
private addAttributes; | ||
private removeAttributes; | ||
} |
9 changes: 2 additions & 7 deletions
9
src/LiveComponent/assets/dist/Component/plugins/LoadingPlugin.d.ts
This file contains hidden or 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,23 +1,18 @@ | ||
import { type Directive } from '../../Directive/directives_parser'; | ||
import { type ElementDirectives } from '../../Directive/directives_parser'; | ||
import type BackendRequest from '../../Backend/BackendRequest'; | ||
import type Component from '../../Component'; | ||
import type { PluginInterface } from './PluginInterface'; | ||
interface ElementLoadingDirectives { | ||
element: HTMLElement | SVGElement; | ||
directives: Directive[]; | ||
} | ||
export default class implements PluginInterface { | ||
attachToComponent(component: Component): void; | ||
startLoading(component: Component, targetElement: HTMLElement | SVGElement, backendRequest: BackendRequest): void; | ||
finishLoading(component: Component, targetElement: HTMLElement | SVGElement): void; | ||
private handleLoadingToggle; | ||
private handleLoadingDirective; | ||
getLoadingDirectives(component: Component, element: HTMLElement | SVGElement): ElementLoadingDirectives[]; | ||
getLoadingDirectives(component: Component, element: HTMLElement | SVGElement): ElementDirectives[]; | ||
private showElement; | ||
private hideElement; | ||
private addClass; | ||
private removeClass; | ||
private addAttributes; | ||
private removeAttributes; | ||
} | ||
export {}; |
This file contains hidden or 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 hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let's remove this :)
We'll make the change in another small PR
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.
I never made that change, I think that's just the linter ?