Skip to content

Add Service Banners #5272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use translations
  • Loading branch information
ammario committed Dec 6, 2022
commit e5484d4ccc7169620ed16a14a2bf1fb07a38cd43
2 changes: 2 additions & 0 deletions site/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import usersPage from "./usersPage.json"
import templateVersionPage from "./templateVersionPage.json"
import loginPage from "./loginPage.json"
import workspaceChangeVersionPage from "./workspaceChangeVersionPage.json"
import serviceBannerSettings from "./serviceBannerSettings.json"

export const en = {
common,
Expand All @@ -26,4 +27,5 @@ export const en = {
templateVersionPage,
loginPage,
workspaceChangeVersionPage,
serviceBannerSettings,
}
5 changes: 5 additions & 0 deletions site/src/i18n/en/serviceBannerSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"updateLabel": "Update",
"messageHelperText": "Markdown bold, italics, and links are supported.",
"showPreviewLabel": "Show Preview"
}
12 changes: 6 additions & 6 deletions site/src/pages/DeploySettingsPage/ServiceBannerSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Header } from "components/DeploySettingsLayout/Header"
import { LoadingButton } from "components/LoadingButton/LoadingButton"
import { Stack } from "components/Stack/Stack"
import { FormikContextType, useFormik } from "formik"
import React, { useContext, useState } from "react"
import React, { useContext, useState, useTransition } from "react"
import { Helmet } from "react-helmet-async"
import { pageTitle } from "util/page"
import * as Yup from "yup"
Expand All @@ -24,6 +24,7 @@ import { BlockPicker } from "react-color"
import { useTheme } from "@material-ui/core/styles"
import FormHelperText from "@material-ui/core/FormHelperText"
import Button from "@material-ui/core/Button"
import { useTranslation } from "react-i18next"

export interface ServiceBannerFormValues {
message?: string
Expand Down Expand Up @@ -92,6 +93,7 @@ const ServiceBannerSettingsPage: React.FC = () => {
)

const theme = useTheme()
const [t] = useTranslation("serviceBannerSettings")

return (
<>
Expand Down Expand Up @@ -148,9 +150,7 @@ const ServiceBannerSettingsPage: React.FC = () => {
)
}}
/>
<FormHelperText>
Markdown bold, italics, and links are supported.
</FormHelperText>
<FormHelperText>{t("messageHelperText")}</FormHelperText>
</Stack>

<Stack spacing={0}>
Expand Down Expand Up @@ -190,7 +190,7 @@ const ServiceBannerSettingsPage: React.FC = () => {

<Stack direction="row">
<LoadingButton loading={false} type="submit" variant="contained">
{"Update"}
{t("updateLabel")}
</LoadingButton>
</Stack>
</Stack>
Expand All @@ -214,7 +214,7 @@ const ServiceBannerSettingsPage: React.FC = () => {
)
}}
>
Show Preview
{t("showPreviewLabel")}
</Button>
</>
)}
Expand Down