Skip to content
Snippets Groups Projects
Unverified Commit 3e73e5d7 authored by Alexander Polyankin's avatar Alexander Polyankin Committed by GitHub
Browse files

Activation fixes for 0.42 (#19947)

parent a08fc3ff
No related merge requests found
Showing
with 22 additions and 144 deletions
......@@ -30,7 +30,7 @@ The default way to connect to MongoDB is to fill out your connection details in
- Port
- Username
- Password
- Authentication Database (optional database to use when authenticating)
- Authentication Database (optional)
- Additional connection string options (optional)
Additional settings:
......
import React from "react";
import { ComponentStory } from "@storybook/react";
import SlackHelpCard from "./SlackHelpCard";
export default {
title: "Admin/Settings/Slack/SlackHelpCard",
component: SlackHelpCard,
};
const Template: ComponentStory<typeof SlackHelpCard> = args => {
return <SlackHelpCard {...args} />;
};
export const Default = Template.bind({});
import styled from "styled-components";
import { color } from "metabase/lib/colors";
import Icon from "metabase/components/Icon";
import ExternalLink from "metabase/core/components/ExternalLink";
export const CardRoot = styled(ExternalLink)`
display: block;
padding: 1.5rem;
border: 1px solid ${color("border")};
border-radius: 0.375rem;
background-color: ${color("white")};
box-shadow: 0 1px 6px ${color("shadow")};
&:hover {
background-color: ${color("bg-light")};
}
`;
export const CardHeader = styled.span`
display: flex;
align-items: center;
margin-bottom: 1rem;
`;
export const CardTitle = styled.span`
flex: 1 1 auto;
color: ${color("brand")};
font-weight: bold;
margin: 0 0.5rem;
`;
export const CardIcon = styled(Icon)`
flex: 0 0 auto;
color: ${color("brand")};
`;
export const CardBody = styled.span`
color: ${color("text-medium")};
line-height: 1.25rem;
`;
import React from "react";
import { t } from "ttag";
import Settings from "metabase/lib/settings";
import {
CardBody,
CardHeader,
CardIcon,
CardRoot,
CardTitle,
} from "./SlackHelpCard.styled";
export interface SlackHelpCardProps {
className?: string;
}
const SlackHelpCard = ({ className }: SlackHelpCardProps): JSX.Element => {
const docsUrl = Settings.docsUrl("administration-guide/09-setting-up-slack");
return (
<CardRoot className={className} href={docsUrl}>
<CardHeader>
<CardIcon name="info" />
<CardTitle>{t`Need help?`}</CardTitle>
<CardIcon name="external" />
</CardHeader>
<CardBody>{t`Check out our docs on how to connect to Slack.`}</CardBody>
</CardRoot>
);
};
export default SlackHelpCard;
import React from "react";
import { render, screen } from "@testing-library/react";
import SlackHelpCard from "./SlackHelpCard";
describe("SlackHelpCard", () => {
it("should render correctly", () => {
render(<SlackHelpCard />);
expect(screen.getByText("Need help?")).toBeInTheDocument();
expect(screen.getByLabelText("info icon")).toBeInTheDocument();
expect(screen.getByLabelText("external icon")).toBeInTheDocument();
});
});
export { default } from "./SlackHelpCard";
......@@ -3,7 +3,6 @@ import { color, lighten } from "metabase/lib/colors";
import { breakpointMinLarge } from "metabase/styled-components/theme";
import Button from "metabase/core/components/Button";
import ExternalLink from "metabase/core/components/ExternalLink";
import SlackHelpCard from "../SlackHelpCard";
export const SetupRoot = styled.div`
max-width: 42rem;
......@@ -100,12 +99,3 @@ export const SectionCodeButton = styled(Button)`
right: 1rem;
background-color: ${color("white")};
`;
export const SetupHelpCard = styled(SlackHelpCard)`
${breakpointMinLarge} {
position: fixed;
right: 2rem;
bottom: 2rem;
max-width: 15%;
}
`;
......@@ -18,7 +18,6 @@ import {
SectionRoot,
SectionTitle,
SectionToggle,
SetupHelpCard,
SetupRoot,
} from "./SlackSetup.styled";
......@@ -41,7 +40,6 @@ const SlackSetup = ({
<CreateAppSection />
<CopyManifestSection manifest={manifest} />
<ActivateAppSection Form={Form} />
<SetupHelpCard />
</SetupRoot>
);
};
......
......@@ -12,7 +12,10 @@ export const TableLink = styled(Link)`
export const TableActionLink = styled(Link)`
line-height: initial;
margin-left: ${space(1)};
&:not(:first-child) {
margin-left: ${space(1)};
}
`;
export const TableCard = forwardRefToInnerRef(styled(Card)`
......
......@@ -14,16 +14,16 @@ import {
export interface DatabaseHelpCardProps {
className?: string;
engine?: string;
isHosted?: boolean;
}
const DatabaseHelpCard = ({
className,
engine,
isHosted,
}: DatabaseHelpCardProps): JSX.Element => {
const docsUrl = getDocsUrl(engine);
const docsUrl = Settings.docsUrl(
"administration-guide/01-managing-databases",
);
const CardRoot = isHosted ? CardRootStatic : CardRootLink;
const CardHeader = isHosted ? CardHeaderLink : CardHeaderStatic;
......@@ -35,7 +35,7 @@ const DatabaseHelpCard = ({
<CardIcon name="external" />
</CardHeader>
<CardMessage>
{t`Check out documentation for step-by-step directions on how to connect to your database.`}
{t`See our docs for step-by-step directions on how to connect your database.`}
</CardMessage>
{isHosted && (
<CardMessage>
......@@ -50,23 +50,4 @@ const DatabaseHelpCard = ({
);
};
const getDocsUrl = (engine?: string): string => {
switch (engine) {
case "bigquery":
return Settings.docsUrl("administration-guide/databases/bigquery");
case "mongo":
return Settings.docsUrl("administration-guide/databases/mongodb");
case "mysql":
return Settings.docsUrl("administration-guide/databases/mysql");
case "oracle":
return Settings.docsUrl("administration-guide/databases/oracle");
case "snowflake":
return Settings.docsUrl("administration-guide/databases/snowflake");
case "vertica":
return Settings.docsUrl("administration-guide/databases/vertica");
default:
return Settings.docsUrl("administration-guide/01-managing-databases");
}
};
export default DatabaseHelpCard;
......@@ -203,7 +203,7 @@ const EntityItem = ({
}}
/>
<Box>
<Box className="overflow-hidden">
<EntityItemName name={name} />
<Box>{extraInfo && extraInfo}</Box>
</Box>
......
import React, { Component } from "react";
import PropTypes from "prop-types";
import _ from "underscore";
import { Input } from "./InputBlurChange.styled";
/**
* A small wrapper around <input>, primarily should be used for the
......@@ -56,7 +56,7 @@ export default class InputBlurChange extends Component {
"onChange",
);
return (
<input
<Input
{...props}
value={this.state.value}
onBlur={this.onBlur}
......
import styled from "styled-components";
import { darken } from "metabase/lib/colors";
export const Input = styled.input`
border: 1px solid ${darken("border", 0.1)};
`;
......@@ -4,7 +4,6 @@ import { State } from "metabase-types/store";
export interface DatabaseHelpCardProps {
className?: string;
engine?: string;
}
interface DatabaseHelpCardStateProps {
......
......@@ -15,7 +15,7 @@ const DatabaseHelp = ({
return (
<DatabaseHelpRoot isVisible={isVisible}>
<DatabaseHelpCard engine={engine} />
<DatabaseHelpCard />
</DatabaseHelpRoot>
);
};
......
......@@ -25,7 +25,6 @@ driver:
- name: pass
- name: authdb
display-name: Authentication database (optional)
helper-text: Database to use when authenticating.
placeholder: admin
- cloud-ip-address-info
- ssl
......
......@@ -186,7 +186,7 @@
{:name "let-user-control-scheduling"
:type :boolean
:display-name (deferred-tru "Choose when syncs and scans happen")
:description (deferred-tru "By default, Metabase does a lightweight hourly sync and an intensive daily scan of field values. If you have a large database, we recommend turning this on and reviewing when and how often the field value scans happen.")
:description (deferred-tru "By default, Metabase does a lightweight hourly sync and an intensive daily scan of field values. If you have a large database, turn this on to make changes.")
:visible-if {"advanced-options" true}})
(def metadata-sync-schedule
......
......@@ -3,6 +3,7 @@
(:require [clojure.java.io :as io]
[clojure.string :as str]
[java-time :as t]
[metabase.analytics.snowplow :as snowplow]
[metabase.config :as config]
[metabase.models.setting :refer [defsetting]]
[metabase.public-settings :as public-settings]
......@@ -82,7 +83,7 @@
"www.google-analytics.com")
;; Snowplow analytics
(when (public-settings/anon-tracking-enabled)
"sp.metabase.com")
(snowplow/snowplow-url))
;; Webpack dev server
(when config/is-dev?
"localhost:8080 ws://localhost:8080")]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment