web: fix needed because recent upgrade to task breaks spinner button (#10142)
web: fix broken Task plug-in rebase and fix package json Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
		
							
								
								
									
										18
									
								
								web/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										18
									
								
								web/package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -18,10 +18,10 @@ | |||||||
|                 "@formatjs/intl-listformat": "^7.5.7", |                 "@formatjs/intl-listformat": "^7.5.7", | ||||||
|                 "@fortawesome/fontawesome-free": "^6.5.2", |                 "@fortawesome/fontawesome-free": "^6.5.2", | ||||||
|                 "@goauthentik/api": "^2024.4.2-1718378698", |                 "@goauthentik/api": "^2024.4.2-1718378698", | ||||||
|                 "@lit-labs/task": "^3.1.0", |  | ||||||
|                 "@lit/context": "^1.1.2", |                 "@lit/context": "^1.1.2", | ||||||
|                 "@lit/localize": "^0.12.1", |                 "@lit/localize": "^0.12.1", | ||||||
|                 "@lit/reactive-element": "^2.0.4", |                 "@lit/reactive-element": "^2.0.4", | ||||||
|  |                 "@lit/task": "^1.0.1", | ||||||
|                 "@open-wc/lit-helpers": "^0.7.0", |                 "@open-wc/lit-helpers": "^0.7.0", | ||||||
|                 "@patternfly/elements": "^3.0.2", |                 "@patternfly/elements": "^3.0.2", | ||||||
|                 "@patternfly/patternfly": "^4.224.2", |                 "@patternfly/patternfly": "^4.224.2", | ||||||
| @ -3333,15 +3333,6 @@ | |||||||
|             "integrity": "sha512-yWJKmpGE6lUURKAaIltoPIE/wrbY3TEkqQt+X0m+7fQNnAv0keydnYvbiJFP1PnMhizmIWRWOG5KLhYyc/xl+g==", |             "integrity": "sha512-yWJKmpGE6lUURKAaIltoPIE/wrbY3TEkqQt+X0m+7fQNnAv0keydnYvbiJFP1PnMhizmIWRWOG5KLhYyc/xl+g==", | ||||||
|             "license": "BSD-3-Clause" |             "license": "BSD-3-Clause" | ||||||
|         }, |         }, | ||||||
|         "node_modules/@lit-labs/task": { |  | ||||||
|             "version": "3.1.0", |  | ||||||
|             "resolved": "https://registry.npmjs.org/@lit-labs/task/-/task-3.1.0.tgz", |  | ||||||
|             "integrity": "sha512-zMlcUtZeHDT83IiT2+CJBSoFvWDLnPEezhOCgqjxW4DmRHlbgd7jdft97T6dw4S4RvIETfI7OOyvubCV/EzTlg==", |  | ||||||
|             "license": "BSD-3-Clause", |  | ||||||
|             "dependencies": { |  | ||||||
|                 "@lit/task": "^1.0.0" |  | ||||||
|             } |  | ||||||
|         }, |  | ||||||
|         "node_modules/@lit/context": { |         "node_modules/@lit/context": { | ||||||
|             "version": "1.1.2", |             "version": "1.1.2", | ||||||
|             "resolved": "https://registry.npmjs.org/@lit/context/-/context-1.1.2.tgz", |             "resolved": "https://registry.npmjs.org/@lit/context/-/context-1.1.2.tgz", | ||||||
| @ -3403,10 +3394,9 @@ | |||||||
|             } |             } | ||||||
|         }, |         }, | ||||||
|         "node_modules/@lit/task": { |         "node_modules/@lit/task": { | ||||||
|             "version": "1.0.0", |             "version": "1.0.1", | ||||||
|             "resolved": "https://registry.npmjs.org/@lit/task/-/task-1.0.0.tgz", |             "resolved": "https://registry.npmjs.org/@lit/task/-/task-1.0.1.tgz", | ||||||
|             "integrity": "sha512-7jocGBh3yGlo3kKxQggZph2txK4X5GYNWp2FAsmV9u2spzUypwrzRzXe8I72icAb02B00+k2nlvxVcrQB6vyrw==", |             "integrity": "sha512-fVLDtmwCau8NywnFIXaJxsCZjzaIxnVq+cFRKYC1Y4tA4/0rMTvF6DLZZ2JE51BwzOluaKtgJX8x1QDsQtAaIw==", | ||||||
|             "license": "BSD-3-Clause", |  | ||||||
|             "dependencies": { |             "dependencies": { | ||||||
|                 "@lit/reactive-element": "^1.0.0 || ^2.0.0" |                 "@lit/reactive-element": "^1.0.0 || ^2.0.0" | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -39,10 +39,10 @@ | |||||||
|         "@formatjs/intl-listformat": "^7.5.7", |         "@formatjs/intl-listformat": "^7.5.7", | ||||||
|         "@fortawesome/fontawesome-free": "^6.5.2", |         "@fortawesome/fontawesome-free": "^6.5.2", | ||||||
|         "@goauthentik/api": "^2024.4.2-1718378698", |         "@goauthentik/api": "^2024.4.2-1718378698", | ||||||
|         "@lit-labs/task": "^3.1.0", |  | ||||||
|         "@lit/context": "^1.1.2", |         "@lit/context": "^1.1.2", | ||||||
|         "@lit/localize": "^0.12.1", |         "@lit/localize": "^0.12.1", | ||||||
|         "@lit/reactive-element": "^2.0.4", |         "@lit/reactive-element": "^2.0.4", | ||||||
|  |         "@lit/task": "^1.0.1", | ||||||
|         "@open-wc/lit-helpers": "^0.7.0", |         "@open-wc/lit-helpers": "^0.7.0", | ||||||
|         "@patternfly/elements": "^3.0.2", |         "@patternfly/elements": "^3.0.2", | ||||||
|         "@patternfly/patternfly": "^4.224.2", |         "@patternfly/patternfly": "^4.224.2", | ||||||
|  | |||||||
| @ -66,7 +66,11 @@ export abstract class BaseTaskButton extends CustomEmitterElement(AKElement) { | |||||||
|         this.onSuccess = this.onSuccess.bind(this); |         this.onSuccess = this.onSuccess.bind(this); | ||||||
|         this.onError = this.onError.bind(this); |         this.onError = this.onError.bind(this); | ||||||
|         this.onClick = this.onClick.bind(this); |         this.onClick = this.onClick.bind(this); | ||||||
|         this.actionTask = new Task(this, { |         this.actionTask = this.buildTask(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     buildTask() { | ||||||
|  |         return new Task(this, { | ||||||
|             task: () => this.callAction(), |             task: () => this.callAction(), | ||||||
|             args: () => [], |             args: () => [], | ||||||
|             autoRun: false, |             autoRun: false, | ||||||
| @ -77,8 +81,9 @@ export abstract class BaseTaskButton extends CustomEmitterElement(AKElement) { | |||||||
|  |  | ||||||
|     onComplete() { |     onComplete() { | ||||||
|         setTimeout(() => { |         setTimeout(() => { | ||||||
|             this.actionTask.status = TaskStatus.INITIAL; |  | ||||||
|             this.dispatchCustomEvent(`${this.eventPrefix}-reset`); |             this.dispatchCustomEvent(`${this.eventPrefix}-reset`); | ||||||
|  |             // set-up for the next task... | ||||||
|  |             this.actionTask = this.buildTask(); | ||||||
|             this.requestUpdate(); |             this.requestUpdate(); | ||||||
|         }, SPINNER_TIMEOUT); |         }, SPINNER_TIMEOUT); | ||||||
|     } |     } | ||||||
| @ -98,7 +103,8 @@ export abstract class BaseTaskButton extends CustomEmitterElement(AKElement) { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     onClick() { |     onClick() { | ||||||
|         if (this.actionTask.status !== TaskStatus.INITIAL) { |         // Don't accept clicks when a task is in progress.. | ||||||
|  |         if (this.actionTask.status === TaskStatus.PENDING) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|         this.dispatchCustomEvent(`${this.eventPrefix}-click`); |         this.dispatchCustomEvent(`${this.eventPrefix}-click`); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Ken Sternberg
					Ken Sternberg