fix: review changes

This commit is contained in:
DarkPhoenix2704
2025-10-25 13:58:59 +05:30
parent 328d3320a4
commit 2a4787895b
3 changed files with 28 additions and 25 deletions

View File

@@ -50,52 +50,47 @@ const hasPrintableContent = computed(() => {
>
<div class="flex gap-2 items-center">
<GeneralIcon v-if="!isGenerating" icon="ncPrinter" />
{{ isGenerating ? 'Generating PDF...' : 'Print' }}
{{ isGenerating ? $t('labels.generatingPDF') : $t('labels.print') }}
</div>
</NcButton>
<template #title>
{{ isGenerating ? 'Generating PDF...' : 'Run the script first to print output' }}
{{ isGenerating ? $t('labels.generatingPDF') : $t('labels.executeScriptToPrint') }}
</template>
</NcTooltip>
<template #overlay>
<NcMenu class="nc-print-page-size-menu">
<div class="px-3 py-2 text-xs font-semibold text-nc-content-gray-subtle mb-1 border-b border-nc-border-gray-medium">
Page Size
</div>
<NcMenu variant="small" class="nc-print-page-size-menu">
<NcMenuItemLabel> {{ $t('labels.pageSize') }} </NcMenuItemLabel>
<NcMenuItem v-for="pageSize in pageSizes" :key="pageSize.type" class="!py-2" @click="selectedPageSize = pageSize.type">
<div class="flex items-center justify-between w-full gap-2">
<span class="text-sm">{{ pageSize.type }}</span>
<GeneralIcon v-if="selectedPageSize === pageSize.type" icon="check" class="text-nc-content-brand" />
</div>
</NcMenuItem>
<div
class="px-3 py-2 text-xs font-semibold text-nc-content-gray-subtle mb-1 mt-1 border-t border-b border-nc-border-gray-medium"
>
Orientation
</div>
<NcDivider />
<NcMenuItemLabel> {{ $t('labels.orientation') }} </NcMenuItemLabel>
<NcMenuItem
v-for="orientation in orientations"
:key="orientation.type"
class="!py-2"
@click="selectedOrientation = orientation.type"
>
<div class="flex items-center justify-between w-full gap-2">
<span class="text-sm">{{ orientation.type }}</span>
<div class="flex items-center flex-1 justify-between w-full gap-2">
<span class="text-sm w-full flex-1">{{ orientation.type }}</span>
<GeneralIcon v-if="selectedOrientation === orientation.type" icon="check" class="text-nc-content-brand" />
</div>
</NcMenuItem>
<NcDivider />
<div class="border-t !pt-1 mt-1 border-nc-border-gray-medium">
<NcMenuItem class="!py-2" @click="handlePrint">
<div class="flex items-center gap-2 text-nc-content-brand">
<GeneralLoader v-if="isGenerating" />
<GeneralIcon v-else icon="ncPrinter" />
<span class="text-sm font-semibold">Generate PDF</span>
</div>
</NcMenuItem>
</div>
<NcMenuItem @click="handlePrint">
<div class="flex items-center gap-2 text-nc-content-brand">
<GeneralLoader v-if="isGenerating" />
<GeneralIcon v-else icon="ncPrinter" />
<span class="text-sm font-semibold">
{{ $t('labels.generatePDF') }}
</span>
</div>
</NcMenuItem>
</NcMenu>
</template>
</NcDropdown>
@@ -151,4 +146,8 @@ const hasPrintableContent = computed(() => {
.nc-print-page-size-menu {
min-width: 240px;
}
:deep(.nc-menu-item-inner) {
@apply w-full;
}
</style>

View File

@@ -998,6 +998,12 @@
"changeWorkspaceRoleTo": "Change Workspace Role to"
},
"labels": {
"generatePDF": "Generate PDF",
"orientation": "Orientation",
"pageSize": "Page Size",
"executeScriptToPrint": "Run the script first to print output",
"print": "Print",
"generatingPDF": "Generating PDF...",
"activeMcpServersLabel": "View and manage your active Model Context Protocol servers across all bases",
"activeMcpServers": "Active MCP Servers",
"hideEditor": "Hide Editor",

2
pnpm-lock.yaml generated
View File

@@ -11458,7 +11458,6 @@ packages:
eslint-plugin-markdown@3.0.1:
resolution: {integrity: sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
deprecated: Please use @eslint/markdown instead
peerDependencies:
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
@@ -16844,7 +16843,6 @@ packages:
request-filtering-agent@1.1.2:
resolution: {integrity: sha512-v6uYIoey6rhe+nQXB5rlYEWJI+5SrnvM72XGeLUsykzu2omOEPoW4QmzEH+8/sheK4M/hwQ85L7aPj1cTJfPLg==}
deprecated: This version is not maintain. Please upgrade to the latest version.
request-ip@3.3.0:
resolution: {integrity: sha512-cA6Xh6e0fDBBBwH77SLJaJPBmD3nWVAcF9/XAcsrIHdjhFzFiB5aNQFytdjCGPezU3ROwrR11IddKAM08vohxA==}