Skip to content

Commit

Permalink
#2014 added access modifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Viktor Patraboi committed Mar 21, 2023
1 parent e6ea06c commit ca4294c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 51 deletions.
8 changes: 4 additions & 4 deletions src/app/shared/services/codeficator/codeficator.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class CodeficatorService {
* This method to get all Codeficators from the database
* @param settlement string
*/
searchCodeficator(settlement: string, categories?: CodeficatorCategories[]): Observable<Codeficator[]> {
public searchCodeficator(settlement: string, categories?: CodeficatorCategories[]): Observable<Codeficator[]> {
if(!categories){
return this.http.get<Codeficator[]>(`/api/v1/Codeficator/search?Name=${settlement}`);
} else {
Expand All @@ -29,15 +29,15 @@ export class CodeficatorService {
* This method to get Codeficator by id
* @param id number
*/
getCodeficatorById(id: number): Observable<Codeficator> {
public getCodeficatorById(id: number): Observable<Codeficator> {
return this.http.get<Codeficator>(`/api/v1/Codeficator/${id}/parents`);
}

/**
* This method to get all Codeficator City Districts from the database
* @param id number
*/
searchCodeficatorCityDistrict(id: number): Observable<CodeficatorCityDistrict[]> {
public searchCodeficatorCityDistrict(id: number): Observable<CodeficatorCityDistrict[]> {
return this.http.get<CodeficatorCityDistrict[]>(`/api/v1/Codeficator/children?id=${id}`);
}

Expand All @@ -46,7 +46,7 @@ export class CodeficatorService {
* @param lat number
* @param lon number
*/
getNearestByCoordinates(lat: number, lon: number): Observable<Codeficator> {
public getNearestByCoordinates(lat: number, lon: number): Observable<Codeficator> {
let params = new HttpParams().set('Lat', lat.toString()).set('Lon', lon.toString());

return this.http.get<Codeficator>('/api/v1/Codeficator/NearestByCoordinates', { params });
Expand Down
14 changes: 7 additions & 7 deletions src/app/shared/services/region-admin/region-admin.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,54 +19,54 @@ export class RegionAdminService extends BaseAdminService {
/**
* This method get Profile of authorized RegionAdmin
*/
getAdminProfile(): Observable<RegionAdmin> {
public getAdminProfile(): Observable<RegionAdmin> {
return <Observable<RegionAdmin>>super.getAdminProfile();
}

/**
* This method get Region Admin by Id
* * @param regionAdminId: string
*/
getAdminById(regionAdminId: string): Observable<RegionAdmin> {
public getAdminById(regionAdminId: string): Observable<RegionAdmin> {
return <Observable<RegionAdmin>>super.getAdminById(regionAdminId);
}

/**
* This method get All Region Admins
*/
getAllAdmin(parameters: RegionAdminParameters): Observable<SearchResponse<RegionAdmin[]>> {
public getAllAdmin(parameters: RegionAdminParameters): Observable<SearchResponse<RegionAdmin[]>> {
return <Observable<SearchResponse<RegionAdmin[]>>>super.getAllAdmin(parameters);
}

/**
* This method create Region Admin
* @param regionAdmin: RegionAdmin
*/
createAdmin(regionAdmin: RegionAdmin): Observable<RegionAdmin> {
public createAdmin(regionAdmin: RegionAdmin): Observable<RegionAdmin> {
return <Observable<RegionAdmin>>super.createAdmin(regionAdmin);
}

/**
* This method delete Region Admin by id
* @param regionAdminId: string
*/
deleteAdmin(regionAdminId: string): Observable<void> {
public deleteAdmin(regionAdminId: string): Observable<void> {
return super.deleteAdmin(regionAdminId);
}

/**
* This method block Region Admin
* @param regionAdminId: string
*/
blockAdmin(regionAdminId: string, isBlocked: boolean): Observable<void> {
public blockAdmin(regionAdminId: string, isBlocked: boolean): Observable<void> {
return super.blockAdmin(regionAdminId, isBlocked);
}

/**
* This method update Region Admin
* @param regionAdmin: RegionAdmin
*/
updateAdmin(regionAdmin: RegionAdmin): Observable<RegionAdmin> {
public updateAdmin(regionAdmin: RegionAdmin): Observable<RegionAdmin> {
return <Observable<RegionAdmin>>super.updateAdmin(regionAdmin);
}
}
52 changes: 26 additions & 26 deletions src/app/shell/admin-tools/data/admins/admins.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,36 @@ import { BlockAdminById, DeleteAdminById, GetAllAdmins } from 'shared-store/admi
styleUrls: ['./admins.component.scss']
})
export class AdminsComponent implements OnInit, OnDestroy {
readonly noAdmins = NoResultsTitle.noAdmins;
readonly AdminRolesTitles = AdminRolesTitles;
readonly AdminRoles = AdminRoles;
readonly Role = Role;
readonly statusesTitles = UserStatusesTitles;
public readonly noAdmins = NoResultsTitle.noAdmins;
public readonly AdminRolesTitles = AdminRolesTitles;
public readonly AdminRoles = AdminRoles;
public readonly Role = Role;
public readonly statusesTitles = UserStatusesTitles;

@Select(AdminState.admins)
admins$: Observable<SearchResponse<BaseAdmin[]>>;
private admins$: Observable<SearchResponse<BaseAdmin[]>>;
@Select(AdminState.isLoading)
isLoadingCabinet$: Observable<boolean>;
public isLoadingCabinet$: Observable<boolean>;
@Select(RegistrationState.role)
role$: Observable<string>;

tabIndex: number;
filterFormControl: FormControl = new FormControl('');
adminsTable: UsersTable[];
role: Role;
destroy$: Subject<boolean> = new Subject<boolean>();
totalEntities: number;
currentPage: PaginationElement = PaginationConstants.firstPage;
displayedColumns: string[] = ['pib', 'email', 'phone', 'institution', 'status'];
adminParams: MinistryAdminParameters = {
private role$: Observable<string>;

public tabIndex: number;
public filterFormControl: FormControl = new FormControl('');
public adminsTable: UsersTable[];
public role: Role;
public destroy$: Subject<boolean> = new Subject<boolean>();
public totalEntities: number;
public currentPage: PaginationElement = PaginationConstants.firstPage;
public displayedColumns: string[] = ['pib', 'email', 'phone', 'institution', 'status'];
public adminParams: MinistryAdminParameters = {
searchString: '',
tabTitle: null,
size: PaginationConstants.TABLE_ITEMS_PER_PAGE
};

constructor(private store: Store, private router: Router, private route: ActivatedRoute, protected matDialog: MatDialog) {}

ngOnInit(): void {
public ngOnInit(): void {
this.setTabOptions();
this.getAdmins();
this.setDisplayedColumns();
Expand Down Expand Up @@ -93,7 +93,7 @@ export class AdminsComponent implements OnInit, OnDestroy {
* This method filter admins according to selected tab
* @param event: MatTabChangeEvent
*/
onTabChange(event: MatTabChangeEvent): void {
public onTabChange(event: MatTabChangeEvent): void {
this.currentPage = PaginationConstants.firstPage;
this.filterFormControl.reset("", { emitEvent: false });
this.adminParams.searchString = '';
Expand Down Expand Up @@ -147,7 +147,7 @@ export class AdminsComponent implements OnInit, OnDestroy {
/**
* This method block, unBlock Admin By Id
*/
onBlock(admin: BlockData): void {
public onBlock(admin: BlockData): void {
const dialogRef = this.matDialog.open(ConfirmationModalWindowComponent, {
width: Constants.MODAL_SMALL,
data: {
Expand All @@ -173,7 +173,7 @@ export class AdminsComponent implements OnInit, OnDestroy {
/**
* This method delete Admin By Id
*/
onDelete(admin: UsersTable): void {
public onDelete(admin: UsersTable): void {
const dialogRef = this.matDialog.open(ConfirmationModalWindowComponent, {
width: Constants.MODAL_SMALL,
data: {
Expand All @@ -191,7 +191,7 @@ export class AdminsComponent implements OnInit, OnDestroy {
this.store.dispatch(new DeleteAdminById(id, admin));
}

onUpdate(admin: UsersTable): void {
public onUpdate(admin: UsersTable): void {
this.router.navigate([`update-admin/${this.adminParams.tabTitle}/${admin.id}`]);
}

Expand All @@ -206,17 +206,17 @@ export class AdminsComponent implements OnInit, OnDestroy {
]);
}

onPageChange(page: PaginationElement): void {
public onPageChange(page: PaginationElement): void {
this.currentPage = page;
this.getAdmins();
}

onItemsPerPageChange(itemsPerPage: number): void {
public onItemsPerPageChange(itemsPerPage: number): void {
this.adminParams.size = itemsPerPage;
this.getAdmins();
}

ngOnDestroy(): void {
public ngOnDestroy(): void {
this.destroy$.next(true);
this.destroy$.unsubscribe();
this.store.dispatch(new PopNavPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,23 @@ const defaultValidators: ValidatorFn[] = [
styleUrls: ['./create-admin.component.scss']
})
export class CreateAdminComponent extends CreateFormComponent implements OnInit, OnDestroy {
readonly validationConstants = ValidationConstants;
public readonly validationConstants = ValidationConstants;
public readonly noSettlement = Constants.NO_SETTLEMENT;

readonly phonePrefix = Constants.PHONE_PREFIX;
readonly mailFormPlaceholder = Constants.MAIL_FORMAT_PLACEHOLDER;
readonly adminsRole = AdminRoles;
public readonly phonePrefix = Constants.PHONE_PREFIX;
public readonly mailFormPlaceholder = Constants.MAIL_FORMAT_PLACEHOLDER;

@Select(MetaDataState.institutions)
institutions$: Observable<Institution[]>;
public institutions$: Observable<Institution[]>;
@Select(AdminState.selectedAdmin)
selectedAdmin$: Observable<BaseAdmin>;
public selectedAdmin$: Observable<BaseAdmin>;
@Select(MetaDataState.codeficatorSearch)
codeficatorSearch$: Observable<Codeficator[]>;
public codeficatorSearch$: Observable<Codeficator[]>;

AdminFormGroup: FormGroup;
adminRole: AdminRoles;
adminId: string;
formTitle: string;
public AdminFormGroup: FormGroup;
public adminRole: AdminRoles;
public adminId: string;
public formTitle: string;

constructor(
protected store: Store,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Workshop } from '../../../shared/models/workshop.model';
import { ProviderDetailsComponent } from './provider-details.component';
import { TranslateModule } from '@ngx-translate/core';

fdescribe('ProviderDetailsComponent', () => {
describe('ProviderDetailsComponent', () => {
let component: ProviderDetailsComponent;
let fixture: ComponentFixture<ProviderDetailsComponent>;

Expand Down
2 changes: 1 addition & 1 deletion src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@
"DELETE_ADMIN": "Are you sure you want to delete an administrator?",
"BLOCK_ADMIN": "Are you sure you want to block the administrator?",
"UNBLOCK_ADMIN": "Are you sure you want to unblock administrator?",
"CREATE_ADMIN": "Are you sure you want to add a ministry administrator?",
"CREATE_ADMIN": "Are you sure you want to add a administrator?",
"UPDATE_ADMIN": "Are you sure you want to edit the administrator?",
"LICENSE_APPROVED": "Are you sure you want to confirm the provider's license?",
"TITLES": {
Expand Down
2 changes: 1 addition & 1 deletion src/assets/i18n/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@
"DELETE_ADMIN": "Ви впевнені, що хочете видалити адміністратора?",
"BLOCK_ADMIN": "Ви впевнені, що хочете заблокувати адміністратора?",
"UNBLOCK_ADMIN": "Ви впевнені, що хочете розблокувати адміністратора?",
"CREATE_ADMIN": "Ви впевнені, що хочете додати адміна міністерства?",
"CREATE_ADMIN": "Ви впевнені, що хочете додати адміністратора?",
"UPDATE_ADMIN": "Ви впевнені, що хочете редагувати адміністратора?",
"LICENSE_APPROVED": "Ви впевнені, що хочете підтвердити ліцензію закладу?",
"TITLES": {
Expand Down

0 comments on commit ca4294c

Please sign in to comment.