Commit 76ae8163 authored by Hamza HRAMCHI's avatar Hamza HRAMCHI
Browse files

FIX #18428 TIME 0:30 add splitLoginPwd pipe

parent f117932b
......@@ -15,6 +15,6 @@
<img src="assets/spinner.gif"/>
</div>
</app-root>
<script src="runtime-es2015.4ac42fef445445e6f3d0.js" type="module"></script><script src="runtime-es5.4ac42fef445445e6f3d0.js" nomodule defer></script><script src="polyfills-es5.8c2a86db22bc37211976.js" nomodule defer></script><script src="polyfills-es2015.f8f86766446f4344eec7.js" type="module"></script><script src="scripts.3f995a62571f9f668311.js" defer></script><script src="main-es2015.163c246e40ad05d914a9.js" type="module"></script><script src="main-es5.163c246e40ad05d914a9.js" nomodule defer></script></body>
<script src="runtime-es2015.4ac42fef445445e6f3d0.js" type="module"></script><script src="runtime-es5.4ac42fef445445e6f3d0.js" nomodule defer></script><script src="polyfills-es5.8c2a86db22bc37211976.js" nomodule defer></script><script src="polyfills-es2015.f8f86766446f4344eec7.js" type="module"></script><script src="scripts.3f995a62571f9f668311.js" defer></script><script src="main-es2015.d5ac382f0a85d78fe18d.js" type="module"></script><script src="main-es5.d5ac382f0a85d78fe18d.js" nomodule defer></script></body>
</html>
\ No newline at end of file
......@@ -11,6 +11,7 @@ import { LatinisePipe } from 'ngx-pipes';
import { CookieService } from 'ngx-cookie-service';
import { SortPipe } from '@plugins/sorting.pipe';
import { HighlightPipe } from '@plugins/highlight.pipe';
import { SplitLoginPwd } from '@plugins/splitLoginPwd.pipe';
@NgModule({
imports: [
......@@ -24,7 +25,8 @@ import { HighlightPipe } from '@plugins/highlight.pipe';
SortPipe,
TimeAgoPipe,
TimeLimitPipe,
HighlightPipe
HighlightPipe,
SplitLoginPwd
],
exports: [
NgStringPipesModule,
......@@ -35,7 +37,8 @@ import { HighlightPipe } from '@plugins/highlight.pipe';
SortPipe,
TimeAgoPipe,
TimeLimitPipe,
HighlightPipe
HighlightPipe,
SplitLoginPwd
],
entryComponents: [
],
......
......@@ -95,7 +95,7 @@
[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}}
{{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 { SplitLoginPwd } 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, SplitLoginPwd],
})
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: SplitLoginPwd
) { }
async ngOnInit(): Promise<void> {
......@@ -568,7 +570,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';
import { LatinisePipe } from 'ngx-pipes';
@Pipe({
name: 'splitLoginPwd'
})
export class SplitLoginPwd implements PipeTransform {
constructor(private latinisePipe: LatinisePipe) { }
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;
}
}
}
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