Skip to content

Commit f31e33c

Browse files
zJaaalclaude
andauthored
refactor(uve): remove duplicate copy URL button from editor toolbar (#35518)
## Parent Issue Closes #35517 ## Summary The UVE editor was rendering the same "copy page URL" popover in two places: - the top editor toolbar (`pi pi-copy`, next to the bookmark star) - the browser URL pill (`pi pi-link`, on the pill that shows the URL itself) Both buttons opened the same `$pageURLS` popover and called the same toast. The pill version was added in #35417 when the URL pill itself was introduced. Since the URL now lives on the pill, the copy control belongs there — the toolbar one is pure duplication. This PR removes the toolbar copy button and cleans up the symbols that became unused. ## Changes - `dot-uve-toolbar.component.html` — drop the `<p-button>` + `<p-popover>` block - `dot-uve-toolbar.component.ts` — remove `ClipboardModule`, `PopoverModule`, `$pageURLS`, `copyUrlPopoverPt`, `triggerCopyToast`, and the `createFullURL` import - `edit-ema-editor.component.*` — unchanged; the pill copy button stays ## Test plan - [x] `yarn nx lint portlets-edit-ema-portlet` — clean (only pre-existing warnings in another file) - [x] `yarn nx test portlets-edit-ema-portlet` — 63 suites, 1331 passed, 5 skipped - [ ] Manual smoke: open a page in UVE, confirm the copy button on the URL pill still copies and toasts; confirm the toolbar no longer has the duplicate 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5905fa2 commit f31e33c

2 files changed

Lines changed: 1 addition & 78 deletions

File tree

core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/components/dot-uve-toolbar/dot-uve-toolbar.component.html

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,6 @@
1616
<div class="flex items-center gap-1" [class.p-0]="preview || live">
1717
<dot-editor-mode-selector data-testId="uve-toolbar-editor-mode-selector" />
1818
<dot-ema-bookmarks [url]="$toolbar().editor.bookmarksUrl" />
19-
<p-button
20-
size="small"
21-
(click)="op.toggle($event)"
22-
[text]="true"
23-
[rounded]="true"
24-
[pTooltip]="'editpage.header.copy' | dm"
25-
tooltipPosition="bottom"
26-
icon="pi pi-copy"
27-
data-testId="uve-toolbar-copy-url">
28-
<p-popover #op [pt]="copyUrlPopoverPt">
29-
<div class="flex flex-col divide-y divide-gray-200">
30-
@for (url of $pageURLS(); track url.value) {
31-
<div class="flex flex-col gap-1 py-2 first:pt-0 last:pb-0">
32-
<span class="text-sm font-semibold text-gray-900">
33-
{{ url.label | dm }}:
34-
</span>
35-
<div class="flex min-w-0 items-center gap-2">
36-
<a
37-
[href]="url.value"
38-
class="block min-w-0 flex-1 truncate text-gray-900 no-underline! hover:underline"
39-
target="_blank"
40-
rel="noreferrer noopener">
41-
{{ url.value }}
42-
</a>
43-
<p-button
44-
icon="pi pi-copy"
45-
[text]="true"
46-
[rounded]="true"
47-
class="shrink-0"
48-
(cdkCopyToClipboardCopied)="triggerCopyToast()"
49-
[cdkCopyToClipboard]="url.value"
50-
data-testId="copy-url-button" />
51-
</div>
52-
</div>
53-
}
54-
</div>
55-
</p-popover>
56-
</p-button>
5719
<a
5820
size="small"
5921
[text]="true"

core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/components/dot-uve-toolbar/dot-uve-toolbar.component.ts

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { ClipboardModule } from '@angular/cdk/clipboard';
21
import { HttpErrorResponse } from '@angular/common/http';
32
import {
43
ChangeDetectionStrategy,
@@ -18,7 +17,6 @@ import { ConfirmationService, MessageService } from 'primeng/api';
1817
import { ButtonModule } from 'primeng/button';
1918
import { ChipModule } from 'primeng/chip';
2019
import { DatePickerModule } from 'primeng/datepicker';
21-
import { PopoverModule } from 'primeng/popover';
2220
import { SplitButtonModule } from 'primeng/splitbutton';
2321
import { ToolbarModule } from 'primeng/toolbar';
2422
import { TooltipModule } from 'primeng/tooltip';
@@ -46,8 +44,7 @@ import { PageType } from '../../../store/models';
4644
import {
4745
convertLocalTimeToUTC,
4846
convertUTCToLocalTime,
49-
createFavoritePagesURL,
50-
createFullURL
47+
createFavoritePagesURL
5148
} from '../../../utils';
5249

5350
@Component({
@@ -58,8 +55,6 @@ import {
5855
ButtonModule,
5956
DatePickerModule,
6057
ChipModule,
61-
ClipboardModule,
62-
PopoverModule,
6358
ToolbarModule,
6459
TooltipModule,
6560
SplitButtonModule,
@@ -125,18 +120,6 @@ export class DotUveToolbarComponent {
125120
currentLanguage: this.$currentLanguage()
126121
}));
127122

128-
readonly $pageURLS = computed<{ label: string; value: string }[]>(() => {
129-
const params = this.#store.pageParams();
130-
const site = this.#store.pageAsset()?.site;
131-
132-
return [
133-
{
134-
label: 'uve.toolbar.page.url',
135-
value: createFullURL(params, site?.identifier)
136-
}
137-
];
138-
});
139-
140123
readonly $showWorkflowActions = this.#store.$showWorkflowsActions;
141124
readonly $mode = this.#store.viewMode;
142125
readonly $isPreviewMode = this.#store.$isPreviewMode;
@@ -150,15 +133,6 @@ export class DotUveToolbarComponent {
150133
readonly $isPaletteOpen = this.#store.editorPaletteOpen;
151134
readonly $canEditPage = this.#store.editorCanEditContent;
152135

153-
/**
154-
* Popover passthrough styles for the "Copy URLs" popover.
155-
* Keeps the popover compact and prevents long URLs from stretching the overlay.
156-
*/
157-
readonly copyUrlPopoverPt = {
158-
root: { class: 'w-full max-w-[25rem]' },
159-
content: { class: '!p-3' }
160-
};
161-
162136
readonly $devices: Signal<DotDeviceListItem[]> = toSignal(
163137
this.#deviceService.get().pipe(map((devices = []) => [...DEFAULT_DEVICES, ...devices])),
164138
{
@@ -336,19 +310,6 @@ export class DotUveToolbarComponent {
336310
this.#store.pageLoad({ language_id });
337311
}
338312

339-
/**
340-
* Trigger the copy toasts
341-
*
342-
* @memberof DotUveToolbarComponent
343-
*/
344-
triggerCopyToast(): void {
345-
this.#messageService.add({
346-
severity: 'success',
347-
summary: this.#dotMessageService.get('Copied!'),
348-
life: 3000
349-
});
350-
}
351-
352313
/**
353314
* Handle the persona selection
354315
*

0 commit comments

Comments
 (0)