Skip to content

Commit e710116

Browse files
committed
fix(withdraw-dialog): renamed dialogs
1 parent 05d833c commit e710116

File tree

12 files changed

+30
-32
lines changed

12 files changed

+30
-32
lines changed

src/app/features/preprints/components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export { PreprintMakeDecisionComponent } from './preprint-details/preprint-make-
88
export { PreprintMetricsInfoComponent } from './preprint-details/preprint-metrics-info/preprint-metrics-info.component';
99
export { PreprintTombstoneComponent } from './preprint-details/preprint-tombstone/preprint-tombstone.component';
1010
export { PreprintWarningBannerComponent } from './preprint-details/preprint-warning-banner/preprint-warning-banner.component';
11+
export { PreprintWithdrawDialogComponent } from './preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component';
1112
export { ShareAndDownloadComponent } from './preprint-details/share-and-download/share-and-download.component';
1213
export { StatusBannerComponent } from './preprint-details/status-banner/status-banner.component';
13-
export { WithdrawDialogComponent } from './preprint-details/withdraw-dialog/withdraw-dialog.component';
1414
export { PreprintProviderFooterComponent } from './preprint-provider-footer/preprint-provider-footer.component';
1515
export { PreprintProviderHeroComponent } from './preprint-provider-hero/preprint-provider-hero.component';
1616
export { PreprintServicesComponent } from './preprint-services/preprint-services.component';

src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.spec.ts renamed to src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ import { formInputLimits } from '@osf/features/preprints/constants';
99
import { ProviderReviewsWorkflow, ReviewsState } from '@osf/features/preprints/enums';
1010
import { PreprintModel, PreprintProviderDetails } from '@osf/features/preprints/models';
1111

12-
import { WithdrawDialogComponent } from './withdraw-dialog.component';
12+
import { PreprintWithdrawDialogComponent } from './preprint-withdraw-dialog.component';
1313

1414
import { PREPRINT_MOCK } from '@testing/mocks/preprint.mock';
1515
import { PREPRINT_PROVIDER_DETAILS_MOCK } from '@testing/mocks/preprint-provider-details';
1616
import { OSFTestingModule } from '@testing/osf.testing.module';
1717
import { provideMockStore } from '@testing/providers/store-provider.mock';
1818

19-
describe('WithdrawDialogComponent', () => {
20-
let component: WithdrawDialogComponent;
21-
let fixture: ComponentFixture<WithdrawDialogComponent>;
19+
describe('PreprintWithdrawDialogComponent', () => {
20+
let component: PreprintWithdrawDialogComponent;
21+
let fixture: ComponentFixture<PreprintWithdrawDialogComponent>;
2222
let dialogRefMock: any;
2323
let dialogConfigMock: any;
2424

@@ -34,7 +34,7 @@ describe('WithdrawDialogComponent', () => {
3434
};
3535

3636
await TestBed.configureTestingModule({
37-
imports: [WithdrawDialogComponent, OSFTestingModule, MockPipe(TitleCasePipe)],
37+
imports: [PreprintWithdrawDialogComponent, OSFTestingModule, MockPipe(TitleCasePipe)],
3838
providers: [
3939
MockProvider(DynamicDialogRef, dialogRefMock),
4040
MockProvider(DynamicDialogConfig, dialogConfigMock),
@@ -44,7 +44,7 @@ describe('WithdrawDialogComponent', () => {
4444
],
4545
}).compileComponents();
4646

47-
fixture = TestBed.createComponent(WithdrawDialogComponent);
47+
fixture = TestBed.createComponent(PreprintWithdrawDialogComponent);
4848
component = fixture.componentInstance;
4949
fixture.detectChanges();
5050
});
@@ -103,7 +103,7 @@ describe('WithdrawDialogComponent', () => {
103103
dialogConfigMock.data = { provider: providerWithPreMod, preprint: preprintWithPending };
104104

105105
expect(() => {
106-
fixture = TestBed.createComponent(WithdrawDialogComponent);
106+
fixture = TestBed.createComponent(PreprintWithdrawDialogComponent);
107107
component = fixture.componentInstance;
108108
component.ngOnInit();
109109
}).not.toThrow();
@@ -116,7 +116,7 @@ describe('WithdrawDialogComponent', () => {
116116
dialogConfigMock.data = { provider: providerWithPreMod, preprint: preprintWithAccepted };
117117

118118
expect(() => {
119-
fixture = TestBed.createComponent(WithdrawDialogComponent);
119+
fixture = TestBed.createComponent(PreprintWithdrawDialogComponent);
120120
component = fixture.componentInstance;
121121
component.ngOnInit();
122122
}).not.toThrow();
@@ -128,7 +128,7 @@ describe('WithdrawDialogComponent', () => {
128128
dialogConfigMock.data = { provider: providerWithPostMod, preprint: mockPreprint };
129129

130130
expect(() => {
131-
fixture = TestBed.createComponent(WithdrawDialogComponent);
131+
fixture = TestBed.createComponent(PreprintWithdrawDialogComponent);
132132
component = fixture.componentInstance;
133133
component.ngOnInit();
134134
}).not.toThrow();

src/app/features/preprints/components/preprint-details/withdraw-dialog/withdraw-dialog.component.ts renamed to src/app/features/preprints/components/preprint-details/preprint-withdraw-dialog/preprint-withdraw-dialog.component.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ import { INPUT_VALIDATION_MESSAGES } from '@osf/shared/constants/input-validatio
2121
import { CustomValidators } from '@osf/shared/helpers/custom-form-validators.helper';
2222

2323
@Component({
24-
selector: 'osf-withdraw-dialog',
24+
selector: 'osf-preprint-withdraw-dialog',
2525
imports: [Textarea, ReactiveFormsModule, Message, TranslatePipe, Button, TitleCasePipe],
26-
templateUrl: './withdraw-dialog.component.html',
27-
styleUrl: './withdraw-dialog.component.scss',
26+
templateUrl: './preprint-withdraw-dialog.component.html',
27+
styleUrl: './preprint-withdraw-dialog.component.scss',
2828
changeDetection: ChangeDetectionStrategy.OnPush,
2929
})
30-
export class WithdrawDialogComponent implements OnInit {
30+
export class PreprintWithdrawDialogComponent implements OnInit {
3131
private readonly config = inject(DynamicDialogConfig);
3232
private readonly translateService = inject(TranslateService);
3333
private readonly environment = inject(ENVIRONMENT);
@@ -39,9 +39,7 @@ export class WithdrawDialogComponent implements OnInit {
3939
private provider!: PreprintProviderDetails;
4040
private preprint!: PreprintModel;
4141

42-
private actions = createDispatchMap({
43-
withdrawPreprint: WithdrawPreprint,
44-
});
42+
private actions = createDispatchMap({ withdrawPreprint: WithdrawPreprint });
4543

4644
inputLimits = formInputLimits;
4745
readonly INPUT_VALIDATION_MESSAGES = INPUT_VALIDATION_MESSAGES;

src/app/features/preprints/pages/preprint-details/preprint-details.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ import {
4747
PreprintMetricsInfoComponent,
4848
PreprintTombstoneComponent,
4949
PreprintWarningBannerComponent,
50+
PreprintWithdrawDialogComponent,
5051
ShareAndDownloadComponent,
5152
StatusBannerComponent,
52-
WithdrawDialogComponent,
5353
} from '../../components';
5454
import { PreprintRequestMachineState, ProviderReviewsWorkflow, ReviewsState } from '../../enums';
5555
import {
@@ -314,7 +314,7 @@ export class PreprintDetailsComponent implements OnInit, OnDestroy {
314314

315315
handleWithdrawClicked() {
316316
this.customDialogService
317-
.open(WithdrawDialogComponent, {
317+
.open(PreprintWithdrawDialogComponent, {
318318
header: this.translateService.instant('preprints.details.withdrawDialog.title', {
319319
preprintWord: this.preprintProvider()!.preprintWord,
320320
}),

src/app/features/registry/components/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ export * from './add-resource-dialog/add-resource-dialog.component';
22
export * from './archiving-message/archiving-message.component';
33
export * from './edit-resource-dialog/edit-resource-dialog.component';
44
export * from './registration-links-card/registration-links-card.component';
5+
export * from './registration-withdraw-dialog/registration-withdraw-dialog.component';
56
export * from './registry-blocks-section/registry-blocks-section.component';
67
export * from './registry-revisions/registry-revisions.component';
78
export * from './registry-statuses/registry-statuses.component';
89
export * from './resource-form/resource-form.component';
9-
export * from './withdraw-dialog/withdraw-dialog.component';

src/app/features/registry/components/withdraw-dialog/withdraw-dialog.component.spec.ts renamed to src/app/features/registry/components/registration-withdraw-dialog/registration-withdraw-dialog.component.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
66

77
import { TextInputComponent } from '@osf/shared/components/text-input/text-input.component';
88

9-
import { WithdrawDialogComponent } from './withdraw-dialog.component';
9+
import { RegistrationWithdrawDialogComponent } from './registration-withdraw-dialog.component';
1010

1111
import { DynamicDialogRefMock } from '@testing/mocks/dynamic-dialog-ref.mock';
1212
import { OSFTestingModule } from '@testing/osf.testing.module';
1313
import { provideMockStore } from '@testing/providers/store-provider.mock';
1414

15-
describe('WithdrawDialogComponent', () => {
16-
let component: WithdrawDialogComponent;
17-
let fixture: ComponentFixture<WithdrawDialogComponent>;
15+
describe('RegistrationWithdrawDialogComponent', () => {
16+
let component: RegistrationWithdrawDialogComponent;
17+
let fixture: ComponentFixture<RegistrationWithdrawDialogComponent>;
1818
let mockDialogConfig: jest.Mocked<DynamicDialogConfig>;
1919

2020
beforeEach(async () => {
@@ -23,7 +23,7 @@ describe('WithdrawDialogComponent', () => {
2323
} as jest.Mocked<DynamicDialogConfig>;
2424

2525
await TestBed.configureTestingModule({
26-
imports: [WithdrawDialogComponent, OSFTestingModule, MockComponent(TextInputComponent)],
26+
imports: [RegistrationWithdrawDialogComponent, OSFTestingModule, MockComponent(TextInputComponent)],
2727
providers: [
2828
DynamicDialogRefMock,
2929
MockProvider(DynamicDialogConfig, mockDialogConfig),
@@ -33,7 +33,7 @@ describe('WithdrawDialogComponent', () => {
3333
],
3434
}).compileComponents();
3535

36-
fixture = TestBed.createComponent(WithdrawDialogComponent);
36+
fixture = TestBed.createComponent(RegistrationWithdrawDialogComponent);
3737
component = fixture.componentInstance;
3838
fixture.detectChanges();
3939
});

0 commit comments

Comments
 (0)