Skip to content

Commit

Permalink
feat: atualizar para a versão angular 19
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-gregorio-totvs committed Dec 12, 2024
1 parent a1892b9 commit 3d5f325
Show file tree
Hide file tree
Showing 80 changed files with 228 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ import { PoCodeEditorRegisterableSuggestionType } from './interfaces/po-code-edi
* > As configurações para o registro de uma nova sintaxe no Monaco code editor podem ser encontradas em
* > [**Monaco Editor**](https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages).
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoCodeEditorRegister implements PoCodeEditorRegisterable {
/** Sintaxe a ser registrada. */
language: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ const providers: Array<Provider> = [
@Component({
selector: 'po-code-editor',
templateUrl: './po-code-editor.component.html',
providers,
standalone: false
})
export class PoCodeEditorComponent extends PoCodeEditorBaseComponent implements AfterViewInit, DoCheck {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Injectable } from '@angular/core';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class MenuComponentsService {
constructor() {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';

import { PoMenuItem } from '@po-ui/ng-components';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class MenuGuidesService {
constructor() {}

Expand Down
4 changes: 3 additions & 1 deletion projects/portal/docs/templates/menu.service.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { PoMenuItem } from '@po-ui/ng-components';

import { Documentation } from './documentation/documentation.class';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class MenuService {

constructor() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { map } from 'rxjs/operators';

import { Documentation } from './documentation.class';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class DocumentationService {
constructor(private http: HttpClient) {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Injectable } from '@angular/core';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class MenuComponentsService {
constructor() {}

Expand Down
4 changes: 3 additions & 1 deletion projects/portal/src/app/menu-components.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Injectable } from '@angular/core';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class MenuComponentsService {
constructor() {}

Expand Down
4 changes: 3 additions & 1 deletion projects/storage/src/lib/services/po-storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ export const PO_STORAGE_CONFIG_TOKEN = new InjectionToken('PO_STORAGE_CONFIG_TOK
* export class AppModule {}
* ```
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoStorageService {
private driver: string = null;
private idleQueue = new IdleQueue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ import { PoSyncSchema } from './../po-sync/interfaces/po-sync-schema.interface';

const EVENT_SOURCING_NAME: string = PoEventSourcingService['event_sourcing_name'];

@Injectable()
@Injectable({
providedIn: 'root'
})
class StorageServiceMock extends PoStorageService {
constructor() {
super();
}
}

@Injectable()
@Injectable({
providedIn: 'root'
})
class PoDataTransformMock extends PoDataTransform {
getDateFieldName(): string {
return undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ import { PoSyncConfig } from '../po-sync/interfaces/po-sync-config.interface';
import { PoSyncResponse } from '../po-sync/interfaces/po-sync-response.interface';
import { PoSyncSchema } from './../po-sync/interfaces/po-sync-schema.interface';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoEventSourcingService {
static readonly event_sourcing_name: string = 'EventSourcing';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import { PoHttpRequestType } from './po-http-request-type.enum';
*
* Serviço para execução de requisições HTTP.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoHttpClientService {
constructor(private httpClient: HttpClient) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import { PoNetworkStatus } from './../../models';
* O `PoNetworkService` é utilizado para verificar o status e o tipo da conexão de rede do dispositivo.
*/

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoNetworkService {
private networkType: string;
private networkTypeNow: Subject<{ status: boolean; type: string }>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { PoSchemaDefinitionService } from './po-schema-definition.service';
import { PoSchemaUtil } from './../po-schema-util/po-schema-util.model';
import { PoSyncSchema } from './../../po-sync/interfaces/po-sync-schema.interface';

@Injectable()
@Injectable({
providedIn: 'root'
})
class PoStorageServiceMock extends PoStorageService {
constructor() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { PoSyncSchema } from './../../po-sync/interfaces/po-sync-schema.interfac
*
* Serviço que disponibiliza métodos que permite operar sobre as definições dos *schemas*.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoSchemaDefinitionService {
constructor(private poStorage: PoStorageService) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ import { PoSchemaService } from './po-schema.service';
import { PoSchemaUtil } from './po-schema-util/po-schema-util.model';
import { PoSyncSchema } from './../po-sync/interfaces/po-sync-schema.interface';

@Injectable()
@Injectable({
providedIn: 'root'
})
class PoStorageServiceMock extends PoStorageService {
constructor() {
super();
}
}

@Injectable()
@Injectable({
providedIn: 'root'
})
class PoSchemaDefinitionServiceMock extends PoSchemaDefinitionService {}

describe('PoSchemaService:', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import { PoSyncSchema } from '../po-sync/interfaces/po-sync-schema.interface';
*
* Serviço que realiza as operações nos `schemas`.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoSchemaService {
constructor(
private poSchemaDefinitionService: PoSchemaDefinitionService,
Expand Down
4 changes: 3 additions & 1 deletion projects/sync/src/lib/services/po-sync/po-sync.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import { PoSyncSchema } from './interfaces/po-sync-schema.interface';
* armazenadas *offline* vindas do servidor. Nele ocorre toda a preparação dos modelos de dados retornados por
* cada consulta.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoSyncService {
models: Array<PoEntity> = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Observable } from 'rxjs';

import { PoModalPasswordRecovery } from './interfaces/po-modal-password-recovery.interface';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoModalPasswordRecoveryService {
constructor(private http: HttpClient) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { Observable } from 'rxjs';

import { HttpClient, HttpResponse } from '@angular/common/http';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoPageChangePasswordService {
constructor(private http: HttpClient) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';

import { PoTableColumn } from '@po-ui/ng-components';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class SamplePoPageDynamicSearchHiringProcessesService {
filter(filters) {
let filteredItems = [...this.getItems()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ describe('PoPageDynamicTableComponent:', () => {

it('updateDataTable: should be called with the current parameters', () => {
const expectValue = { page: 1, search: 'test' };
component['quickSearchParam'] = null || undefined;
component['quickSearchParam'] = null;
component['currentPage'] = 1;
component['params'] = { [component.quickSearchParam]: 'test' };

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class SamplePoPageDynamicTableUsersService {
constructor(public http: HttpClient) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { PoLookupFilter } from '@po-ui/ng-components';

import { PoPageJobSchedulerService } from './po-page-job-scheduler.service';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoPageJobSchedulerLookupService implements PoLookupFilter {
constructor(private poPageJobSchedulerService: PoPageJobSchedulerService) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { PoDynamicFormField } from '@po-ui/ng-components';
import { PoJobScheduler } from './interfaces/po-job-scheduler.interface';
import { PoJobSchedulerInternal } from './interfaces/po-job-scheduler-internal.interface';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoPageJobSchedulerService {
readonly headers: HttpHeaders = new HttpHeaders({
'X-PO-SCREEN-LOCK': 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { Observable } from 'rxjs';
import { PoPageLogin } from './interfaces/po-page-login.interface';
import { PoPageLoginAuthenticationType } from './enums/po-page-login-authentication-type.enum';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoPageLoginService {
constructor(private http: HttpClient) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { PoAccordionItemComponent } from '../po-accordion-item/po-accordion-item
* Serviço para poder notificar o componente `po-accordion` quando um `po-accordion-item` for
* expandido/colapsado.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoAccordionService {
private subjectChild = new Subject<PoAccordionItemComponent>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ import { Observable } from 'rxjs';
* junto com a requisição.
*
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoBreadcrumbFavoriteService {
private _url: string;
private _bodyParams: object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const poCalendarRangeWidth = 600;
selector: 'po-calendar',
templateUrl: './po-calendar.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
providers,
standalone: false
})
export class PoCalendarComponent extends PoCalendarBaseComponent implements OnInit, OnChanges {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';

const poCalendarServiceFirstWeekDayDefault: number = 0;

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoCalendarService {
monthDates(year: any, month: any, dayFormatter: any = null, weekFormatter: any = null) {
if (typeof month !== 'number' || month < 0 || month > 11) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { Injectable } from '@angular/core';

import { PoTableColumn } from '@po-ui/ng-components';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class SampleDashboardService {
getColumns(): Array<PoTableColumn> {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { map } from 'rxjs/operators';

import { PoComboOption, PoTableColumn } from '@po-ui/ng-components';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class SamplePoDisclaimerGroupSwPlanetsService {
constructor(private http: HttpClient) {}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { map } from 'rxjs/operators';
import { PoDynamicFormField } from '../po-dynamic-form-field.interface';
import { PoDynamicFormOperation } from '../po-dynamic-form-operation/po-dynamic-form-operation';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoDynamicFormLoadService extends PoDynamicFormOperation {
constructor(http: HttpClient) {
super(http);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { PoDynamicFormFieldChanged } from './po-dynamic-form-field-changed.inter
import { PoDynamicFormOperation } from '../po-dynamic-form-operation/po-dynamic-form-operation';
import { PoDynamicFormValidation } from './po-dynamic-form-validation.interface';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoDynamicFormValidationService extends PoDynamicFormOperation {
constructor(http: HttpClient) {
super(http);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Injectable } from '@angular/core';

@Injectable()
@Injectable({
providedIn: 'root'
})
export class PoDynamicFormContainerService {
getCity(state: number) {
switch (state) {
Expand Down
Loading

0 comments on commit 3d5f325

Please sign in to comment.