Skip to content

Commit 76348b3

Browse files
committed
Revert "ENGAGE-243"
This reverts commit 7469a7e.
1 parent 30b91ac commit 76348b3

5 files changed

Lines changed: 21 additions & 122 deletions

File tree

scripts/validate-branch-name.husky.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
#!/usr/bin/env node
22

3-
// Enforce branch naming: <developer-name>/AAAA-000[0][anything]
3+
// Enforce branch naming: <developer-name>/AA-0000[anything]
44
// - developer-name: lowercase letters, numbers, dot, underscore, hyphen (one or more)
5-
// - ticket: 2+ uppercase letters, hyphen, 3 or 4 digits (e.g., EN-243, ENGAGE-243, or PD-0000)
5+
// - ticket: exactly 2 uppercase letters, hyphen, exactly 4 digits (e.g., PD-0000)
66
// - suffix: any optional characters after the ticket (e.g., "/feature-x", "-refactor", etc.)
77
// Special allowed names: transifex
88
// Examples:
99
// yourname/PD-0000
1010
// yourname/PD-0000-my-feature
1111
// your.name/AB-0123/quick-fix
12-
// lmendoza/EN-243
13-
// lmendoza/ENGAGE-243
1412

1513
const { execSync } = require('child_process')
1614

@@ -69,17 +67,15 @@ function main() {
6967
process.exit(0)
7068
}
7169

72-
// developer-name / AAAA-000[0] [anything]
73-
const pattern = /^[a-z0-9._-]+\/[A-Z]{2,}-\d{3,4}.*$/
70+
// developer-name / AA-0000 [anything]
71+
const pattern = /^[a-z0-9._-]+\/[A-Z]{2}-\d{4}.*$/
7472

7573
if (!pattern.test(branch)) {
7674
console.error(
77-
'\u001b[31mBranch name must follow "<developer-name>/AAAA-000[0][anything]" or be a special allowed name (e.g., "transifex").\u001b[0m'
75+
'\u001b[31mBranch name must follow "<developer-name>/AA-0000[anything]" or be a special allowed name (e.g., "transifex").\u001b[0m'
7876
)
7977
console.error('\nExamples:')
8078
console.error(' yourname/PD-0000')
81-
console.error(' lmendoza/EN-243')
82-
console.error(' lmendoza/ENGAGE-243')
8379
console.error(' yourname/PD-0000-my-feature')
8480
console.error(' your.name/AB-0123/quick-fix')
8581
console.error(' transifex')

scripts/validate-commit-msg.husky.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#!/usr/bin/env node
22

3-
// Enforce commit message format: AAAA-000[0] [optional message]
4-
// - AAAA: 2+ uppercase letters (A-Z)
5-
// - 000[0]: 3 or 4 digits
3+
// Enforce commit message format: AA-0000 [optional message]
4+
// - AA: exactly 2 uppercase letters (A-Z)
5+
// - 0000: exactly 4 digits
66
// - Example: PD-0000 Add feature
77
// - Also valid: PD-0000
8-
// - Also valid: ENGAGE-243
98

109
const fs = require('fs')
1110

@@ -50,16 +49,15 @@ try {
5049
process.exit(0)
5150
}
5251

53-
// Pattern: start, 2+ uppercase letters, hyphen, 3-4 digits, optional space and message
54-
const pattern = /^[A-Z]{2,}-\d{3,4}(?:\s.+)?$/
52+
// Pattern: start, 2 uppercase letters, hyphen, 4 digits, optional space and message
53+
const pattern = /^[A-Z]{2}-\d{4}(?:\s.+)?$/
5554

5655
if (!pattern.test(firstLine)) {
5756
console.error(
58-
'\u001b[31mCommit message must start with an issue key like "AAAA-000[0]" followed by an optional message.\u001b[0m'
57+
'\u001b[31mCommit message must start with an issue key like "AA-0000" followed by an optional message.\u001b[0m'
5958
)
6059
console.error('\nExamples:')
6160
console.error(' PD-0000')
62-
console.error(' ENGAGE-243')
6361
console.error(' PD-0000 Fix broken tests')
6462
console.error('\nYour message was:')
6563
console.error(` ${firstLine || '(empty)'}`)
Lines changed: 8 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,17 @@
1-
<ng-template #wizardItem let-recordImportWizard>
2-
<h2 class="orc-font-body-small wizard-header">
3-
<img
4-
*ngIf="recordImportWizard.redirectUriMetadata?.logoUrl"
5-
[src]="recordImportWizard.redirectUriMetadata.logoUrl"
6-
[alt]="recordImportWizard.name + ' logo'"
7-
class="wizard-logo"
8-
loading="lazy"
9-
/>
1+
<div *ngFor="let recordImportWizard of recordImportWizards">
2+
<h2 class="orc-font-body-small">
103
<a
114
target="_blank"
125
rel="noopener noreferrer"
136
[href]="openImportWizardUrlFilter(recordImportWizard)"
147
>
158
{{ recordImportWizard.name }}
169
</a>
17-
<span
18-
*ngIf="recordImportWizard.redirectUriMetadata?.type"
19-
class="orc-font-body-small wizard-type"
20-
>
21-
{{ recordImportWizard.redirectUriMetadata.type }}
22-
</span>
2310
</h2>
2411
<p class="orc-font-body-small">
25-
<ng-container *ngIf="displayDescription(recordImportWizard).length > 125">
12+
<ng-container *ngIf="recordImportWizard.description.length > 125">
2613
<ng-container *ngIf="!recordImportWizard.show">
27-
{{ displayDescription(recordImportWizard).substring(0, 125) + '...' }}
14+
{{ recordImportWizard.description.substring(0, 125) + '...' }}
2815
<a
2916
class="underline"
3017
i18n="@@shared.showMore"
@@ -34,7 +21,7 @@ <h2 class="orc-font-body-small wizard-header">
3421
</a>
3522
</ng-container>
3623
<ng-container *ngIf="recordImportWizard.show">
37-
{{ displayDescription(recordImportWizard) }}
24+
{{ recordImportWizard.description }}
3825
<br />
3926
<a
4027
class="underline"
@@ -45,29 +32,8 @@ <h2 class="orc-font-body-small wizard-header">
4532
</a>
4633
</ng-container>
4734
</ng-container>
48-
<ng-container *ngIf="displayDescription(recordImportWizard).length < 125">
49-
{{ displayDescription(recordImportWizard) }}
35+
<ng-container *ngIf="recordImportWizard.description.length < 125">
36+
{{ recordImportWizard.description }}
5037
</ng-container>
5138
</p>
52-
</ng-template>
53-
54-
<h3 class="orc-font-body-small">Certified</h3>
55-
<ng-container
56-
*ngFor="let recordImportWizard of certifiedWizards"
57-
[ngTemplateOutlet]="wizardItem"
58-
[ngTemplateOutletContext]="{ $implicit: recordImportWizard }"
59-
></ng-container>
60-
61-
<h3 class="orc-font-body-small">Featured</h3>
62-
<ng-container
63-
*ngFor="let recordImportWizard of featuredWizards"
64-
[ngTemplateOutlet]="wizardItem"
65-
[ngTemplateOutletContext]="{ $implicit: recordImportWizard }"
66-
></ng-container>
67-
68-
<h3 class="orc-font-body-small">Default</h3>
69-
<ng-container
70-
*ngFor="let recordImportWizard of defaultWizards"
71-
[ngTemplateOutlet]="wizardItem"
72-
[ngTemplateOutletContext]="{ $implicit: recordImportWizard }"
73-
></ng-container>
39+
</div>

src/app/record/components/search-link-wizard/search-link-wizard.component.ts

Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'
1+
import { Component, Input, OnInit } from '@angular/core'
22
import { RecordImportWizard } from '../../../types/record-peer-review-import.endpoint'
33

44
@Component({
@@ -7,64 +7,13 @@ import { RecordImportWizard } from '../../../types/record-peer-review-import.end
77
styleUrls: ['./search-link-wizard.component.scss'],
88
standalone: false,
99
})
10-
export class SearchLinkWizardComponent implements OnInit, OnChanges {
10+
export class SearchLinkWizardComponent implements OnInit {
1111
@Input() recordImportWizards: RecordImportWizard[]
1212

13-
certifiedWizards: RecordImportWizard[] = []
14-
featuredWizards: RecordImportWizard[] = []
15-
defaultWizards: RecordImportWizard[] = []
16-
1713
constructor() {}
1814

1915
ngOnInit(): void {}
2016

21-
ngOnChanges(changes: SimpleChanges): void {
22-
if (changes.recordImportWizards) {
23-
this.groupWizards()
24-
}
25-
}
26-
27-
displayDescription(recordImportWizard: RecordImportWizard): string {
28-
return (
29-
recordImportWizard?.redirectUriMetadata?.defaultDescription ||
30-
recordImportWizard?.description ||
31-
''
32-
)
33-
}
34-
35-
private groupWizards(): void {
36-
const wizards = this.recordImportWizards || []
37-
38-
const certified: RecordImportWizard[] = []
39-
const featured: RecordImportWizard[] = []
40-
const defaults: RecordImportWizard[] = []
41-
42-
for (const w of wizards) {
43-
const type = w?.redirectUriMetadata?.type || 'Default'
44-
if (type === 'Certified') {
45-
certified.push(w)
46-
} else if (type === 'Featured') {
47-
featured.push(w)
48-
} else {
49-
defaults.push(w)
50-
}
51-
}
52-
53-
const sortByIndexThenName = (a: RecordImportWizard, b: RecordImportWizard) => {
54-
const ai = a?.redirectUriMetadata?.index ?? Number.POSITIVE_INFINITY
55-
const bi = b?.redirectUriMetadata?.index ?? Number.POSITIVE_INFINITY
56-
if (ai !== bi) return ai - bi
57-
return (a?.name || '').localeCompare(b?.name || '')
58-
}
59-
60-
const sortByName = (a: RecordImportWizard, b: RecordImportWizard) =>
61-
(a?.name || '').localeCompare(b?.name || '')
62-
63-
this.certifiedWizards = certified.sort(sortByIndexThenName)
64-
this.featuredWizards = featured.sort(sortByIndexThenName)
65-
this.defaultWizards = defaults.sort(sortByName)
66-
}
67-
6817
openImportWizardUrlFilter(client: RecordImportWizard): string {
6918
if (client.status === 'RETIRED') {
7019
return client.clientWebsite

src/app/types/record-peer-review-import.endpoint.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
export type RecordImportWizardMetadataType = 'Featured' | 'Default' | 'Certified'
2-
3-
export interface RecordImportWizardMetadata {
4-
type?: RecordImportWizardMetadataType
5-
index?: number
6-
defaultDescription?: string
7-
logoUrl?: string
8-
}
9-
101
export interface RecordImportWizard {
112
actTypes: string[]
123
clientWebsite: string
@@ -15,7 +6,6 @@ export interface RecordImportWizard {
156
id: string
167
name: string
178
redirectUri: string
18-
redirectUriMetadata?: RecordImportWizardMetadata
199
scopes: string
2010
status: string
2111
show: boolean

0 commit comments

Comments
 (0)