Skip to content

Commit c3891bc

Browse files
committed
Define explicit controller names for OP elements
Follows upgrade to Catalyst v1.8.0 and addition of explicit controller names in 0ebf631. This should resolve issues with incorrectly derived controller names when minified in production builds (e.g. with esbuild). See also github/catalyst#330
1 parent 7b9055d commit c3891bc

8 files changed

Lines changed: 8 additions & 8 deletions

File tree

app/components/primer/open_project/avatar_fallback.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {controller} from '@github/catalyst'
1313
* due to a Catalyst bug where @attr accessors aren't properly initialized
1414
* when elements have pre-existing attribute values.
1515
*/
16-
@controller
16+
@controller('avatar-fallback')
1717
export class AvatarFallbackElement extends HTMLElement {
1818
private img: HTMLImageElement | null = null
1919
private testImage: HTMLImageElement | null = null

app/components/primer/open_project/border_box/collapsible_header.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {controller} from '@github/catalyst'
22
import {CollapsibleElement} from '../collapsible'
33

4-
@controller
4+
@controller('collapsible-header')
55
class CollapsibleHeaderElement extends CollapsibleElement {
66
connectedCallback() {
77
if (!this.closest('.Box')) {

app/components/primer/open_project/collapsible_section.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {controller} from '@github/catalyst'
22
import {CollapsibleElement} from './collapsible'
33

4-
@controller
4+
@controller('collapsible-section')
55
class CollapsibleSectionElement extends CollapsibleElement {
66
get baseClass(): string {
77
return 'CollapsibleSection'

app/components/primer/open_project/danger_dialog_form_helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type {LiveRegionElement} from '@primer/live-region-element'
33

44
const SUBMIT_BUTTON_SELECTOR = 'input[type=submit],button[type=submit],button[data-submit-dialog-id]'
55

6-
@controller
6+
@controller('danger-dialog-form-helper')
77
class DangerDialogFormHelperElement extends HTMLElement {
88
@target checkbox: HTMLInputElement | undefined
99
@target liveRegion: LiveRegionElement

app/components/primer/open_project/filterable_tree_view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type NodeState = {
1818

1919
const ASYNC_DEBOUNCE_MS = 300
2020

21-
@controller
21+
@controller('filterable-tree-view')
2222
export class FilterableTreeViewElement extends HTMLElement {
2323
@target filterInput: HTMLInputElement
2424
@target filterModeControlList: HTMLElement

app/components/primer/open_project/page_header_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {controller} from '@github/catalyst'
22

3-
@controller
3+
@controller('page-header')
44
class PageHeaderElement extends HTMLElement {
55
menuItemClick(event: Event) {
66
const currentTarget = event.currentTarget as HTMLButtonElement

app/components/primer/open_project/sub_header_element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {controller, target, targets} from '@github/catalyst'
22

3-
@controller
3+
@controller('sub-header')
44
class SubHeaderElement extends HTMLElement {
55
@target filterInput: HTMLInputElement
66
@targets shownItemsOnExpandedFilter: HTMLElement[]

app/components/primer/open_project/zen_mode_button.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {controller, target} from '@github/catalyst'
22

3-
@controller
3+
@controller('zen-mode')
44
class ZenModeButtonElement extends HTMLElement {
55
@target button: HTMLElement
66
inZenMode = false

0 commit comments

Comments
 (0)