-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore/show unlock icon next to view entities (#23238)
* Show unlock icon next to views and foreign tables * Temp header actions for all entities * Add warnings for views and foreign tables * Add labels for each entity type * Cleanup * Unneeded comma * Remove unneeded useEffect * Check lints on the entities menu too * Pass exposed schemas to lint query * Type cleanup * Update * Update lint, add 0016 * Fix materialized view logic * Cleanup * Grab lint count * Update apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx Co-authored-by: Inian <inian1234@gmail.com> * Update apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx Co-authored-by: Inian <inian1234@gmail.com> * Update apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx Co-authored-by: Inian <inian1234@gmail.com> * Update apps/studio/components/interfaces/TableGridEditor/GridHeaderActions.tsx Co-authored-by: Inian <inian1234@gmail.com> * Language changes * Use lints for gridheaderactions * Types cleanup --------- Co-authored-by: Inian <inian1234@gmail.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
- Loading branch information
1 parent
2dc39a7
commit aa90e57
Showing
6 changed files
with
281 additions
and
34 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
22 changes: 22 additions & 0 deletions
22
apps/studio/components/interfaces/TableGridEditor/TableEntity.utils.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,22 @@ | ||
import { Lint } from '../../../data/lint/lint-query' | ||
|
||
export const checkEntityForLints = ( | ||
entityName: string, | ||
lintName: string, | ||
lintLevels: ('ERROR' | 'WARN')[], | ||
lints: Lint[], | ||
schema: string | ||
): { hasLint: boolean; count: number } => { | ||
const matchingLints = lints?.filter( | ||
(lint) => | ||
lint?.metadata?.name === entityName && | ||
lint?.metadata?.schema === schema && | ||
lint?.name === lintName && | ||
lintLevels.includes(lint?.level as 'ERROR' | 'WARN') | ||
) | ||
|
||
return { | ||
hasLint: matchingLints.length > 0, | ||
count: matchingLints.length, | ||
} | ||
} |
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.