-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't support packages in out-of-stack-buckets (#2641)
- Loading branch information
Showing
5 changed files
with
130 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as React from 'react' | ||
|
||
import Message from 'components/Message' | ||
import { docs } from 'constants/urls' | ||
import * as BucketConfig from 'utils/BucketConfig' | ||
import * as Config from 'utils/Config' | ||
import StyledLink from 'utils/StyledLink' | ||
|
||
const ADD_BUCKET_DOCS = `${docs}/catalog/admin#buckets` | ||
|
||
interface WithPackagesSupportProps { | ||
bucket: string | ||
children: React.ReactNode | ||
} | ||
|
||
export default function WithPackagesSupport({ | ||
bucket, | ||
children, | ||
}: WithPackagesSupportProps) { | ||
const localMode = Config.use().mode === 'LOCAL' | ||
const isInStack = BucketConfig.useIsInStack() | ||
const inStack = React.useMemo(() => isInStack(bucket), [bucket, isInStack]) | ||
|
||
return inStack || localMode ? ( | ||
<>{children}</> | ||
) : ( | ||
<Message headline="Packages not supported"> | ||
Catalog does not support listing packages in out-of-stack buckets. | ||
<br /> | ||
<StyledLink href={ADD_BUCKET_DOCS} target="_blank"> | ||
Learn how to add this bucket to Quilt | ||
</StyledLink>{' '} | ||
to see the packages in it. | ||
</Message> | ||
) | ||
} |
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