misc: finalized labels

This commit is contained in:
Sheen Capadngan
2024-09-04 23:54:19 +08:00
parent 27852607d1
commit 09e621539e
5 changed files with 6 additions and 11 deletions
@@ -39,7 +39,6 @@ export const triggerSecretApprovalSlackNotif = async ({
environment, environment,
secretPath secretPath
}: TTriggerSecretApprovalSlackNotif) => { }: TTriggerSecretApprovalSlackNotif) => {
// construct message here
const appCfg = getConfig(); const appCfg = getConfig();
const project = await projectDAL.findProjectWithOrg(projectId); const project = await projectDAL.findProjectWithOrg(projectId);
const user = await userDAL.findById(secretApprovalRequest.committerUserId); const user = await userDAL.findById(secretApprovalRequest.committerUserId);
@@ -1,5 +1,5 @@
export enum WorkflowIntegrationPlatform { export enum WorkflowIntegrationPlatform {
SLACK = "slack" SLACK = "Slack"
} }
export type SlackIntegration = { export type SlackIntegration = {
@@ -38,11 +38,7 @@ export const AddWorkflowIntegrationForm = ({ isOpen, onToggle }: Props) => {
return ( return (
<Modal isOpen={isOpen} onOpenChange={(state) => handleFormReset(state)}> <Modal isOpen={isOpen} onOpenChange={(state) => handleFormReset(state)}>
<ModalContent <ModalContent title={`Add a ${selectedPlatform ?? "workflow"} integration`} className="my-4">
title="Add a workflow integration"
subTitle="Configure a workflow integration"
className="my-4"
>
<AnimatePresence exitBeforeEnter> <AnimatePresence exitBeforeEnter>
{wizardStep === WizardSteps.SelectPlatform && ( {wizardStep === WizardSteps.SelectPlatform && (
<motion.div <motion.div
@@ -13,7 +13,7 @@ type Props = {
export const IntegrationFormDetails = ({ isOpen, id, onOpenChange, workflowPlatform }: Props) => { export const IntegrationFormDetails = ({ isOpen, id, onOpenChange, workflowPlatform }: Props) => {
return ( return (
<Modal isOpen={isOpen} onOpenChange={onOpenChange}> <Modal isOpen={isOpen} onOpenChange={onOpenChange}>
<ModalContent title="Workflow integration details"> <ModalContent title={`${WorkflowIntegrationPlatform.SLACK} integration`}>
{workflowPlatform === WorkflowIntegrationPlatform.SLACK && ( {workflowPlatform === WorkflowIntegrationPlatform.SLACK && (
<SlackIntegrationForm id={id} onClose={() => onOpenChange(false)} /> <SlackIntegrationForm id={id} onClose={() => onOpenChange(false)} />
)} )}
@@ -89,7 +89,7 @@ export const SlackIntegrationForm = ({ id, onClose }: Props) => {
control={control} control={control}
name="slug" name="slug"
render={({ field, fieldState: { error } }) => ( render={({ field, fieldState: { error } }) => (
<FormControl label="Alias" errorText={error?.message} isError={Boolean(error)}> <FormControl label="Alias" isRequired errorText={error?.message} isError={Boolean(error)}>
<Input placeholder="" {...field} /> <Input placeholder="" {...field} />
</FormControl> </FormControl>
)} )}
@@ -104,13 +104,13 @@ export const SlackIntegrationForm = ({ id, onClose }: Props) => {
)} )}
/> />
{slackIntegration && ( {slackIntegration && (
<FormControl label="Slack workspace"> <FormControl label="Connected Slack workspace">
<Input value={slackIntegration?.teamName} isReadOnly className="bg-white/[0.07]" /> <Input value={slackIntegration?.teamName} isReadOnly className="bg-white/[0.07]" />
</FormControl> </FormControl>
)} )}
<div className="mt-6 flex items-center space-x-4"> <div className="mt-6 flex items-center space-x-4">
<Button type="submit" isLoading={isSubmitting || isConnectLoading} isDisabled={!isDirty}> <Button type="submit" isLoading={isSubmitting || isConnectLoading} isDisabled={!isDirty}>
{slackIntegration ? "Save" : "Connect"} {slackIntegration ? "Save" : "Connect Slack"}
</Button> </Button>
<Button variant="outline_bg" onClick={onClose}> <Button variant="outline_bg" onClick={onClose}>
Cancel Cancel