Skip to content

Commit

Permalink
AAE 22837 Move confirm to core (#9750)
Browse files Browse the repository at this point in the history
* confirm dialog is used in many places and should be part of the core

* fix

* Update confirm.dialog.spec.ts

* Update public-api.ts
  • Loading branch information
eromano authored Jun 8, 2024
1 parent 5ba46ac commit b5d34b5
Show file tree
Hide file tree
Showing 49 changed files with 153 additions and 115 deletions.
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ for more information about installing and using the source code.

| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [Confirm dialog component](core/dialogs/confirm.dialog.md) | Requests a yes/no choice from the user. | [Source](../lib/core/src/lib/dialogs/confirm-dialog/confirm.dialog.ts) |
| [Edit JSON Dialog](core/dialogs/edit-json.dialog.md) | Allows a user to preview or edit a JSON content in a dialog. | [Source](../lib/testing/src/lib/core/dialog/edit-json-dialog.ts) |
| [Unsaved Changes Dialog](core/dialogs/unsaved-changes-dialog.component.md) | Dialog which informs about unsaved changes. Allows discard them and proceed or close dialog and stop proceeding. | [Source](../lib/core/src/lib/dialogs/unsaved-changes-dialog/unsaved-changes-dialog.component.ts) |

Expand Down Expand Up @@ -343,7 +344,6 @@ for more information about installing and using the source code.
| Name | Description | Source link |
| ---- | ----------- | ----------- |
| [Dialog component](content-services/dialogs/dialog.md) | Dialog styled wrapper. | [Source](../lib/content-services/src/lib/dialogs/dialog/dialog.component.ts) |
| [Confirm dialog component](content-services/dialogs/confirm.dialog.md) | Requests a yes/no choice from the user. | [Source](../lib/content-services/src/lib/dialogs/confirm.dialog.ts) |
| [Library dialog component](content-services/dialogs/library.dialog.md) | Creates a new Content Services document library/site. | [Source](../lib/content-services/src/lib/dialogs/library/library.dialog.ts) |

### Interfaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Status: Active
Last reviewed: 2019-01-22
---

# [Confirm dialog component](../../../lib/content-services/src/lib/dialogs/confirm.dialog.ts "Defined in confirm.dialog.ts")
# [Confirm dialog component](../../../lib/core/src/lib/dialogs/confirm-dialog/confirm.dialog.ts "Defined in confirm.dialog.ts")

Requests a yes/no choice from the user.

Expand Down
2 changes: 1 addition & 1 deletion docs/release-notes/RelNote320.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ Is now possible add an extra button in the Confirm Dialog

For more details refer to the:

- [Confirm Dialog](../content-services/dialogs/confirm.dialog.md)
- [Confirm Dialog](../core/dialogs/confirm.dialog.md)

### Configuration option to change the default viewer zoom

Expand Down
2 changes: 1 addition & 1 deletion docs/versionIndex.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ backend services have been tested with each released version of ADF.
<!--v230 start-->

- [Comment content service](core/services/comment-content.service.md)
- [Confirm dialog](content-services/dialogs/confirm.dialog.md)
- [Confirm dialog](core/dialogs/confirm.dialog.md)
- [Content node share directive](content-services/directives/content-node-share.directive.md)
- [Custom resources service](content-services/services/custom-resources.service.md)
- [Inherited button directive](content-services/directives/inherited-button.directive.md)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Subject } from 'rxjs';
import { ContentService } from '../common/services/content.service';
import { SharedLinksApiService } from './services/shared-links-api.service';
import { SharedLinkBodyCreate } from '@alfresco/js-api';
import { ConfirmDialogComponent } from '../dialogs/confirm.dialog';
import { ConfirmDialogComponent } from '@alfresco/adf-core';
import { ContentNodeShareSettings } from './content-node-share.settings';
import { RenditionService } from '../common/services/rendition.service';
import { format, add, endOfDay, isBefore } from 'date-fns';
Expand Down
3 changes: 0 additions & 3 deletions lib/content-services/src/lib/dialogs/dialog.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import { CoreModule } from '@alfresco/adf-core';
import { MaterialModule } from '../material.module';
import { FolderDialogComponent } from './folder.dialog';
import { NodeLockDialogComponent } from './node-lock.dialog';
import { ConfirmDialogComponent } from './confirm.dialog';
import { MatDatetimepickerModule } from '@mat-datetimepicker/core';
import { LibraryDialogComponent } from './library/library.dialog';
import { ContentDirectiveModule } from '../directives';
Expand All @@ -46,14 +45,12 @@ import { CategoriesModule } from '../category';
declarations: [
FolderDialogComponent,
NodeLockDialogComponent,
ConfirmDialogComponent,
LibraryDialogComponent,
CategorySelectorDialogComponent
],
exports: [
FolderDialogComponent,
NodeLockDialogComponent,
ConfirmDialogComponent,
LibraryDialogComponent,
CategorySelectorDialogComponent
]
Expand Down
1 change: 0 additions & 1 deletion lib/content-services/src/lib/dialogs/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

export * from './folder.dialog';
export * from './node-lock.dialog';
export * from './confirm.dialog';
export * from './category-selector.dialog';

export * from './dialog.module';
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "أيقونة السهم الأيمن"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "تأكيد",
"ACTION": "هل تريد المتابعة؟",
"YES_LABEL": "نعم",
"NO_LABEL": "لا"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "هذا المجلد فارغ"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Ikona se šipkou doprava"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Potvrdit",
"ACTION": "Chcete pokračovat?",
"YES_LABEL": "Ano",
"NO_LABEL": "Ne"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Tato složka je prázdná"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Pil højre ikon"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Bekræft",
"ACTION": "Vil du fortsætte?",
"YES_LABEL": "Ja",
"NO_LABEL": "Nej"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Denne mappe er tom"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Pfeil-nach-rechts-Symbol"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Bestätigen",
"ACTION": "Möchten Sie fortfahren?",
"YES_LABEL": "Ja",
"NO_LABEL": "Nein"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Dieser Ordner ist leer"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Arrow right icon"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Confirm",
"ACTION": "Do you want to proceed?",
"YES_LABEL": "Yes",
"NO_LABEL": "No"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "This folder is empty"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Icono de dirección a la derecha"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Confirmar",
"ACTION": "¿Desea continuar?",
"YES_LABEL": "",
"NO_LABEL": "No"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Esta carpeta está vacía"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Oikea nuoli -kuvake"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Vahvista",
"ACTION": "Haluatko jatkaa?",
"YES_LABEL": "Kyllä",
"NO_LABEL": "Ei"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Tämä kansio on tyhjä"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Icône flèche vers la droite"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Confirmer",
"ACTION": "Voulez-vous continuer ?",
"YES_LABEL": "Oui",
"NO_LABEL": "Non"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Ce dossier est vide"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Icona freccia destra"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Conferma",
"ACTION": "Procedere?",
"YES_LABEL": "",
"NO_LABEL": "No"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Questa cartella è vuota"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "右矢印アイコン"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "確認",
"ACTION": "作業を続けますか?",
"YES_LABEL": "はい",
"NO_LABEL": "いいえ"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "このフォルダは空です"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/nb.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Høyrepil-ikon"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Bekreft",
"ACTION": "Vil du fortsette?",
"YES_LABEL": "Ja",
"NO_LABEL": "Nei"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Denne mappen er tom"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Pictogram pijl-rechts"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Bevestigen",
"ACTION": "Wilt u doorgaan?",
"YES_LABEL": "Ja",
"NO_LABEL": "Nee"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Deze map is leeg"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Ikona strzałki w prawo"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Potwierdź",
"ACTION": "Czy chcesz kontynuować?",
"YES_LABEL": "Tak",
"NO_LABEL": "Nie"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Ten folder jest pusty"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Ícone de seta direita"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Confirmar",
"ACTION": "Deseja continuar?",
"YES_LABEL": "Sim",
"NO_LABEL": "Não"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Esta pasta está vazia"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Значок правой стрелки"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Подтвердить",
"ACTION": "Хотите продолжить?",
"YES_LABEL": "Да",
"NO_LABEL": "Нет"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Эта папка пуста"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "Ikon för högerpil"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "Bekräfta",
"ACTION": "Vill du fortsätta?",
"YES_LABEL": "Ja",
"NO_LABEL": "Nej"
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "Den här mappen är tom"
Expand Down
6 changes: 0 additions & 6 deletions lib/content-services/src/lib/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
"ARROW_ICON": "右箭头图标"
}
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "确认",
"ACTION": "是否要继续?",
"YES_LABEL": "",
"NO_LABEL": ""
},
"ADF-DOCUMENT-LIST": {
"EMPTY": {
"HEADER": "此文件夹为空"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { AlfrescoApiService } from '@alfresco/adf-core';
import { Component, Input, OnChanges, ViewEncapsulation, EventEmitter, Output, OnInit, OnDestroy, ViewChild } from '@angular/core';
import { VersionsApi, Node, VersionEntry, NodesApi, NodeEntry, ContentApi, ContentPagingQuery } from '@alfresco/js-api';
import { MatDialog } from '@angular/material/dialog';
import { ConfirmDialogComponent } from '../dialogs';
import { ConfirmDialogComponent } from '@alfresco/adf-core';

Check failure on line 22 in lib/content-services/src/lib/version-manager/version-list.component.ts

View workflow job for this annotation

GitHub Actions / Lint

'@alfresco/adf-core' import is duplicated
import { ContentVersionService } from './content-version.service';
import { ContentService } from '../common';
import { InfiniteScrollDatasource } from '../infinite-scroll-datasource';
Expand Down
37 changes: 37 additions & 0 deletions lib/core/src/lib/dialogs/confirm-dialog/confirm.dialog.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*!

Check failure on line 1 in lib/core/src/lib/dialogs/confirm-dialog/confirm.dialog.module.ts

View workflow job for this annotation

GitHub Actions / Lint

Invalid license header
* @license
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { NgModule } from '@angular/core';
import { ConfirmDialogComponent } from './confirm.dialog';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { TranslateModule } from '@ngx-translate/core';
import { MatDialogModule } from '@angular/material/dialog';
import { MatButtonModule } from '@angular/material/button';
@NgModule({
declarations: [ConfirmDialogComponent],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
TranslateModule,
MatDialogModule,
MatButtonModule
],
exports: [ConfirmDialogComponent]
})
export class ConfirmDialogModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import { TestBed, ComponentFixture } from '@angular/core/testing';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ConfirmDialogComponent } from './confirm.dialog';
import { ContentTestingModule } from '../testing/content.testing.module';
import { By } from '@angular/platform-browser';
import { CoreTestingModule } from '@alfresco/adf-cor';

describe('Confirm Dialog Component', () => {
let fixture: ComponentFixture<ConfirmDialogComponent>;
Expand All @@ -38,7 +38,7 @@ describe('Confirm Dialog Component', () => {

beforeEach(() => {
TestBed.configureTestingModule({
imports: [ContentTestingModule],
imports: [CoreTestingModule],
providers: [
{ provide: MatDialogRef, useValue: dialogRef },
{ provide: MAT_DIALOG_DATA, useValue: data }
Expand Down
5 changes: 5 additions & 0 deletions lib/core/src/lib/dialogs/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@

export * from './edit-json/edit-json.dialog';
export * from './edit-json/edit-json.dialog.module';

export * from './unsaved-changes-dialog/unsaved-changes-dialog.component';
export * from './unsaved-changes-dialog/unsaved-changes-dialog.module';
export * from './unsaved-changes-dialog/unsaved-changes.guard';

export * from './confirm-dialog/confirm.dialog';
export * from './confirm-dialog/confirm.dialog.module';

export * from './dialog';
6 changes: 6 additions & 0 deletions lib/core/src/lib/i18n/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -566,5 +566,11 @@
"ADF_DROPDOWN": {
"LOADING": "جار التحميل...",
"SELECTION_ARIA_LABEL": "{{placeholder}} مربع تحرير وسرد {{selectedOption}}"
},
"ADF_CONFIRM_DIALOG": {
"TITLE": "تأكيد",
"ACTION": "هل تريد المتابعة؟",
"YES_LABEL": "نعم",
"NO_LABEL": "لا"
}
}
Loading

0 comments on commit b5d34b5

Please sign in to comment.