-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42e51e9
commit 928cf9d
Showing
3 changed files
with
48 additions
and
0 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
24 changes: 24 additions & 0 deletions
24
component/src/utils/outerTableComponents/error/errorElement.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,24 @@ | ||
import {OuterContainerElements} from '../outerContainerElements'; | ||
import {ActiveTable} from '../../../activeTable'; | ||
|
||
export class ErrorElement { | ||
public static create() { | ||
const containerElement = document.createElement('div'); | ||
containerElement.id = 'error-container'; | ||
containerElement.classList.add(OuterContainerElements.ABSOULUTE_FULL_TABLE_CLASS); | ||
const textElement = document.createElement('div'); | ||
textElement.id = 'error-text'; | ||
textElement.innerHTML = 'Error retrieving data'; | ||
containerElement.appendChild(textElement); | ||
return containerElement; | ||
} | ||
|
||
public static display(at: ActiveTable) { | ||
const {error} = at._activeOverlayElements; | ||
if (error) at._tableElementRef?.appendChild(error); | ||
} | ||
|
||
public static remove(at: ActiveTable) { | ||
at._activeOverlayElements.error?.remove(); | ||
} | ||
} |