Skip to content

Commit

Permalink
filter empty annotations (#3788)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianedwards authored Oct 10, 2023
1 parent 5b6ad3e commit 6b7e24f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions dashboard/src/lib/porter-apps/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,9 @@ export function serializeService(service: ClientService): SerializedService {
name: domain.name.value,
})),
ingressAnnotations: Object.fromEntries(
config.ingressAnnotations.map((annotation) => [
annotation.key,
annotation.value,
])
config.ingressAnnotations
.filter((a) => a.key.length > 0 && a.value.length > 0)
.map((annotation) => [annotation.key, annotation.value])
),
private: config.private?.value,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Settings: React.FC = () => {
const queryClient = useQueryClient();
const history = useHistory();
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
const { porterApp, clusterId, projectId } = useLatestRevision();
const { porterApp, clusterId, projectId, latestProto } = useLatestRevision();
const { updateAppStep } = useAppAnalytics();
const [isDeleting, setIsDeleting] = useState(false);

Expand Down Expand Up @@ -139,7 +139,9 @@ const Settings: React.FC = () => {

return (
<StyledSettingsTab>
{currentProject?.preview_envs_enabled && <PreviewEnvironmentSettings />}
{currentProject?.preview_envs_enabled && !!latestProto.build ? (
<PreviewEnvironmentSettings />
) : null}
<Text size={16}>Delete "{porterApp.name}"</Text>
<Spacer y={0.5} />
<Text color="helper">
Expand Down

0 comments on commit 6b7e24f

Please sign in to comment.