Commit 9d05404a authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #18428 TIME 0:10 add splitLoginPwd pipe

parent 040a0dc2
......@@ -10,6 +10,7 @@ import { NgStringPipesModule } from 'ngx-pipes';
import { LatinisePipe } from 'ngx-pipes';
import { SortPipe } from '@plugins/sorting.pipe';
import { HighlightPipe } from '@plugins/highlight.pipe';
import { SplitLoginPwdPipe } from '@plugins/splitLoginPwd.pipe';
@NgModule({
imports: [
......@@ -23,7 +24,8 @@ import { HighlightPipe } from '@plugins/highlight.pipe';
SortPipe,
TimeAgoPipe,
TimeLimitPipe,
HighlightPipe
HighlightPipe,
SplitLoginPwdPipe
],
exports: [
NgStringPipesModule,
......@@ -34,7 +36,8 @@ import { HighlightPipe } from '@plugins/highlight.pipe';
SortPipe,
TimeAgoPipe,
TimeLimitPipe,
HighlightPipe
HighlightPipe,
SplitLoginPwdPipe
],
entryComponents: [
],
......
......@@ -99,8 +99,8 @@
<mat-list-item class="contact-item" *ngIf="!functionsService.empty(contact.communicationMeans.url)"
[title]="'lang.communicationMean' | translate">
<mat-icon mat-list-icon class="contact-group fas fa-hashtag"></mat-icon>
<p mat-line class="contact-content" [class.newData]="isNewValue('communicationMeans.url')" [title]="contact.communicationMeans.url">
{{contact.communicationMeans.url}}
<p mat-line class="contact-content" [class.newData]="isNewValue('communicationMeans.url')" [title]="contact.communicationMeans.url | splitLoginPwd">
{{contact.communicationMeans.url | splitLoginPwd}}
</p>
</mat-list-item>
<mat-list-item class="contact-item" *ngIf="!functionsService.empty(contact.communicationMeans.email)"
......
......@@ -13,12 +13,13 @@ import { HeaderService } from '@service/header.service';
import { StripTagsPipe, ReversePipe } from 'ngx-pipes';
import { Observable, of } from 'rxjs';
import { environment } from '../../../environments/environment';
import { SplitLoginPwdPipe } from '@plugins/splitLoginPwd.pipe';
@Component({
selector: 'app-sent-numeric-package-page',
templateUrl: './sent-numeric-package-page.component.html',
styleUrls: ['./sent-numeric-package-page.component.scss'],
providers: [ContactService, StripTagsPipe, ReversePipe],
providers: [ContactService, StripTagsPipe, ReversePipe, SplitLoginPwdPipe],
})
export class SentNumericPackagePageComponent implements OnInit {
......@@ -93,6 +94,7 @@ export class SentNumericPackagePageComponent implements OnInit {
public headerService: HeaderService,
private stringPipe: StripTagsPipe,
private reversePipe: ReversePipe,
private splitLoginPwd: SplitLoginPwdPipe
) { }
async ngOnInit(): Promise<void> {
......@@ -549,7 +551,7 @@ export class SentNumericPackagePageComponent implements OnInit {
getCommunicationMean(value: any) {
if (!this.functions.empty(value.url)) {
return value.url;
return this.splitLoginPwd.transform(value.url);
} else if (!this.functions.empty(value.email)) {
return value.email;
}
......
import { Pipe, PipeTransform } from '@angular/core';
@Pipe({
name: 'splitLoginPwd'
})
export class SplitLoginPwdPipe implements PipeTransform {
constructor() { }
transform(url: string): string {
if (url.indexOf('@') > -1) {
const protocole: string = url.substring(0, url.indexOf('://'));
const serverName: string = url.substring(url.indexOf('@') + 1, url.length)
const URL: string = protocole.concat('://').concat(serverName);
return URL;
} else {
return url;
}
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment