Skip to content

Commit

Permalink
Add standardView query parameter to view managed data source as stand…
Browse files Browse the repository at this point in the history
…ard ones (#1873)
  • Loading branch information
spolu authored Sep 29, 2023
1 parent 6b2bc09 commit e80571c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion front/pages/w/[wId]/a/[aId]/runs/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const getServerSideProps: GetServerSideProps<{
// `wIdTarget` is used to change the workspace owning the runs of the apps we're looking at.
// Mostly useful for debugging as an example our use of `dust-apps` as `dust`.
const wIdTarget = (context.query?.wIdTarget as string) || null;
console.log("WIDTARGET", wIdTarget);

return {
props: {
Expand Down
13 changes: 11 additions & 2 deletions front/pages/w/[wId]/builder/data-sources/[name]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const getServerSideProps: GetServerSideProps<{
isAdmin: boolean;
dataSource: DataSourceType;
connector: ConnectorType | null;
standardView: boolean;
nangoConfig: {
publicKey: string;
slackConnectorId: string;
Expand Down Expand Up @@ -94,6 +95,10 @@ export const getServerSideProps: GetServerSideProps<{
const readOnly = !auth.isBuilder();
const isAdmin = auth.isAdmin();

// `standardView` is used to force the presentation of a managed data source as a standard one so
// that it can be explored.
const standardView = !!context.query?.standardView;

return {
props: {
user,
Expand All @@ -102,6 +107,7 @@ export const getServerSideProps: GetServerSideProps<{
isAdmin,
dataSource,
connector,
standardView,
nangoConfig: {
publicKey: NANGO_PUBLIC_KEY,
slackConnectorId: NANGO_SLACK_CONNECTOR_ID,
Expand Down Expand Up @@ -557,6 +563,7 @@ export default function DataSourceView({
isAdmin,
dataSource,
connector,
standardView,
nangoConfig,
githubAppUrl,
gaTrackingId,
Expand All @@ -583,7 +590,7 @@ export default function DataSourceView({
}
hideSidebar={true}
>
{dataSource.connectorId && connector ? (
{!standardView && dataSource.connectorId && connector ? (
<ManagedDataSourceView
{...{
owner,
Expand All @@ -596,7 +603,9 @@ export default function DataSourceView({
}}
/>
) : (
<StandardDataSourceView {...{ owner, readOnly, dataSource }} />
<StandardDataSourceView
{...{ owner, readOnly: readOnly || standardView, dataSource }}
/>
)}
</AppLayout>
);
Expand Down

0 comments on commit e80571c

Please sign in to comment.