Skip to content

Commit

Permalink
Add Link to PocketBase Admin Panel
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrozadotdev committed Jun 7, 2024
1 parent 29130e4 commit a821bc0
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --clean --skip-validate
args: release --clean --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Publish Package
Expand Down
1 change: 1 addition & 0 deletions client/packages/openblocks/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,7 @@ export const en = {
preview: "Preview",
editError: "History preview mode, no operation is supported.",
clone: "Clone",
pocketbasePanel: "Pocketbase Admin Panel",
},
userAuth: {
registerByEmail: "Sign up",
Expand Down
1 change: 1 addition & 0 deletions client/packages/openblocks/src/i18n/locales/pt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1945,6 +1945,7 @@ export const pt = {
editError:
"Modo de visualização de histórico, nenhuma operação é suportada.",
clone: "Clonar",
pocketbasePanel: "Painel Administrativo do Pocketbase",
},
userAuth: {
registerByEmail: "Registre-se",
Expand Down
21 changes: 20 additions & 1 deletion client/packages/openblocks/src/pages/common/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,26 @@ export function AppHeader() {
<LogoWithName branding={!user.orgDev} />
</StyledLink>
);
const headerEnd = <HeaderProfile user={user} />;
const headerEnd = (
<>
{user.orgDev && (
<div title={trans("header.pocketbasePanel")}>
<StyledLink
onClick={() => {
window.open("/_", "_blank");
}}
>
<img
src="/_/images/logo.svg"
alt="PocketBase Logo"
style={{ maxHeight: 24 }}
/>
</StyledLink>
</div>
)}
<HeaderProfile user={user} />;
</>
);
return (
<LayoutHeader
headerStart={headerStart}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,26 @@ export function ProfileInfoCard(props: ProfileModalCardProps) {
const username = user.connections?.find(c => c.source === UserConnectionSource.email)?.rawUserInfo?.username as string | undefined
return (
<>
<HeadNameFiled />
<ProfileInfoItem
key="email"
titleLabel="Email:"
infoLabel={trans("profile.loginAfterBind", { name: trans("profile.email") })}
value={email}
actionButtonConfig={{
label: trans("profile.change"),
onClick: () => {
setModalContent(<EmailCard />);
setTitle(trans("profile.change") + " Email");
setShowBackLink(true);
},
hidden: !!provider || !allowUpdate.includes("email") || !smtp
}}
/>
{ !provider && (
<HeadNameFiled />
{ type.includes("email") && (
<ProfileInfoItem
key="email"
titleLabel="Email:"
infoLabel={trans("profile.loginAfterBind", { name: trans("profile.email") })}
value={email}
actionButtonConfig={{
label: trans("profile.change"),
onClick: () => {
setModalContent(<EmailCard />);
setTitle(trans("profile.change") + " Email");
setShowBackLink(true);
},
hidden: !!provider || !allowUpdate.includes("email") || !smtp
}}
/> )
}

{ !provider && type.includes("username") && (
<>
{ mask && (
<TacoInput
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function createInputLabel({ label, type, mask }: any, cap = true): string {
if(type.length > 1 && !mask) {
return `${EMAIL}/${LABEL || USERNAME}`
}
return LABEL || EMAIL
return LABEL || (type[0] === "email" ? EMAIL : USERNAME)
}

export default function FormLogin() {
Expand Down

0 comments on commit a821bc0

Please sign in to comment.