@@ -23,13 +23,14 @@ import { providerToText } from "~/utils/helpers/string";
2323import { useFetchAppList , createApp } from "./actions" ;
2424import { WelcomeModal , EmptyList } from "./_components" ;
2525import TeamStats from "./_components/TeamStats" ;
26+ import ActionRequired from "~/components/ActionRequired" ;
2627
2728let timeout : NodeJS . Timeout ;
2829const limit = 20 ;
2930const welcomeModalId = "welcome_modal" ;
3031
3132export default function Apps ( ) {
32- const { teams } = useContext ( AuthContext ) ;
33+ const { teams, providers } = useContext ( AuthContext ) ;
3334 const [ from , setFrom ] = useState ( 0 ) ;
3435 const [ filter , setFilter ] = useState ( "" ) ;
3536 const selectedTeam = useSelectedTeam ( { teams } ) ;
@@ -45,7 +46,11 @@ export default function Apps() {
4546 LocalStorage . get ( welcomeModalId ) !== "shown"
4647 ) ;
4748
48- const provider = LocalStorage . get < Provider > ( LS_PROVIDER ) ;
49+ let provider = LocalStorage . get < Provider > ( LS_PROVIDER ) ;
50+
51+ if ( ! providers ?. [ provider as Provider ] ) {
52+ provider = undefined ;
53+ }
4954
5055 if ( loading && ! filter ) {
5156 return (
@@ -67,10 +72,8 @@ export default function Apps() {
6772 < Box sx = { { width : "100%" } } maxWidth = "lg" >
6873 < Card sx = { { px : { xs : 1 , md : 4 } } } >
6974 < EmptyList
70- primaryActionText = "Configure authentication"
71- primaryDesc = "Configure authentication to import from private repositories
72-
73- "
75+ primaryActionText = "Configure provider"
76+ primaryDesc = "Configure provider to import from private repositories"
7477 primaryLink = "https://www.stormkit.io/docs/self-hosting/authentication"
7578 secondaryLink = "/apps/new/url"
7679 secondaryActionText = "Import from URL"
@@ -84,11 +87,9 @@ export default function Apps() {
8487
8588 const importFromProvider = provider
8689 ? `Import from ${ providerToText [ provider ] } `
87- : "Configure authentication " ;
90+ : "Configure provider " ;
8891
89- const newAppHref = provider
90- ? `/apps/new/${ provider } `
91- : "https://www.stormkit.io/docs/self-hosting/authentication" ;
92+ const newAppHref = provider ? `/apps/new/${ provider } ` : "/admin/git" ;
9293
9394 if ( apps . length === 0 && ! filter ) {
9495 return (
@@ -131,6 +132,13 @@ export default function Apps() {
131132 items = { [
132133 {
133134 icon : < ImportExport /> ,
135+ endIcon : provider ? undefined : (
136+ < ActionRequired
137+ placement = "bottom"
138+ subtitle = "Configure provider to import from private repositories"
139+ title = "Action required"
140+ />
141+ ) ,
134142 text : importFromProvider ,
135143 href : newAppHref ,
136144 } ,
@@ -164,8 +172,8 @@ export default function Apps() {
164172 setFilter ( e . target . value ) ;
165173 } , 250 ) ;
166174 } }
167- InputProps = { {
168- endAdornment : < SearchIcon sx = { { fontSize : 16 } } /> ,
175+ slotProps = { {
176+ input : { endAdornment : < SearchIcon sx = { { fontSize : 16 } } /> } ,
169177 } }
170178 />
171179 </ Box >
0 commit comments