mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 07:26:00 +00:00
fix: copy shared secret link to clipboard on generate
This commit is contained in:
@@ -85,18 +85,22 @@ export const ShareSecretForm = ({ isPublic, value }: Props) => {
|
|||||||
accessType
|
accessType
|
||||||
});
|
});
|
||||||
|
|
||||||
setSecretLink(`${window.location.origin}/shared/secret/${id}`);
|
const link = `${window.location.origin}/shared/secret/${id}`;
|
||||||
|
|
||||||
|
setSecretLink(link);
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
|
navigator.clipboard.writeText(link);
|
||||||
setCopyTextSecret("secret");
|
setCopyTextSecret("secret");
|
||||||
|
|
||||||
createNotification({
|
createNotification({
|
||||||
text: "Successfully created a shared secret",
|
text: "Shared secret link copied to clipboard.",
|
||||||
type: "success"
|
type: "success"
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
createNotification({
|
createNotification({
|
||||||
text: "Failed to create a shared secret",
|
text: "Failed to create a shared secret.",
|
||||||
type: "error"
|
type: "error"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -226,7 +230,7 @@ export const ShareSecretForm = ({ isPublic, value }: Props) => {
|
|||||||
isLoading={isSubmitting}
|
isLoading={isSubmitting}
|
||||||
isDisabled={isSubmitting}
|
isDisabled={isSubmitting}
|
||||||
>
|
>
|
||||||
Create secret link
|
Create Secret Link
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
) : (
|
) : (
|
||||||
@@ -253,7 +257,7 @@ export const ShareSecretForm = ({ isPublic, value }: Props) => {
|
|||||||
onClick={() => setSecretLink("")}
|
onClick={() => setSecretLink("")}
|
||||||
rightIcon={<FontAwesomeIcon icon={faRedo} className="pl-2" />}
|
rightIcon={<FontAwesomeIcon icon={faRedo} className="pl-2" />}
|
||||||
>
|
>
|
||||||
Share another secret
|
Share Another Secret
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ export const PasswordContainer = ({
|
|||||||
onClick={() => window.open("https://app.infisical.com/share-secret", "_blank")}
|
onClick={() => window.open("https://app.infisical.com/share-secret", "_blank")}
|
||||||
rightIcon={<FontAwesomeIcon icon={faArrowRight} className="pl-2" />}
|
rightIcon={<FontAwesomeIcon icon={faArrowRight} className="pl-2" />}
|
||||||
>
|
>
|
||||||
Share your own secret
|
Share Your Own Secret
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ export const SecretContainer = ({ secret, secretKey: key }: Props) => {
|
|||||||
onClick={() => window.open("https://app.infisical.com/share-secret", "_blank")}
|
onClick={() => window.open("https://app.infisical.com/share-secret", "_blank")}
|
||||||
rightIcon={<FontAwesomeIcon icon={faArrowRight} className="pl-2" />}
|
rightIcon={<FontAwesomeIcon icon={faArrowRight} className="pl-2" />}
|
||||||
>
|
>
|
||||||
Share your own secret
|
Share Your Own Secret
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user