iptdevs-design-system 2.7.164 → 2.7.166

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -833,6 +833,10 @@ class UserService extends IPTGeneralService {
833
833
  this.generateRequestParams(userToken);
834
834
  return this.http.post(serviceUrl, this.httpOptions);
835
835
  }
836
+ getUserRoleByCode(codeRole) {
837
+ let serviceUrl = this.SERVICE_URL + 'get/obtain/user/role/by/code/' + codeRole;
838
+ return this.http.get(serviceUrl);
839
+ }
836
840
  }
837
841
  UserService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: UserService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
838
842
  UserService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: UserService, providedIn: 'root' });
@@ -2215,9 +2219,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
2215
2219
  }]
2216
2220
  }] });
2217
2221
 
2222
+ class MediaService extends IPTGeneralService {
2223
+ constructor(http) {
2224
+ super();
2225
+ this.http = http;
2226
+ this.SERVICE_URL = 'media/api/';
2227
+ this.SERVICE_URL = this.baseUrl() + this.SERVICE_URL;
2228
+ }
2229
+ createMedia(request) {
2230
+ let serviceUrl = this.SERVICE_URL + 'post/media';
2231
+ this.generateRequestParams(request);
2232
+ return this.http.post(serviceUrl, this.httpOptions);
2233
+ }
2234
+ getAllDataMedia() {
2235
+ let serviceUrl = this.SERVICE_URL + 'get/media/all';
2236
+ return this.http.get(serviceUrl);
2237
+ }
2238
+ getMediaByCode(idCode) {
2239
+ let serviceUrl = this.SERVICE_URL + 'get/media/code/' + idCode;
2240
+ return this.http.get(serviceUrl);
2241
+ }
2242
+ }
2243
+ MediaService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: MediaService, deps: [{ token: i1$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
2244
+ MediaService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: MediaService, providedIn: 'root' });
2245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: MediaService, decorators: [{
2246
+ type: Injectable,
2247
+ args: [{
2248
+ providedIn: 'root'
2249
+ }]
2250
+ }], ctorParameters: function () { return [{ type: i1$2.HttpClient }]; } });
2251
+
2218
2252
  class CodDocumentsSectionComponent {
2219
- constructor(fb) {
2253
+ constructor(fb, mediaService, userService, baseService) {
2220
2254
  this.fb = fb;
2255
+ this.mediaService = mediaService;
2256
+ this.userService = userService;
2257
+ this.baseService = baseService;
2221
2258
  this.docStudent = false;
2222
2259
  this.docAgreement = false;
2223
2260
  this.docParent = false;
@@ -2225,12 +2262,7 @@ class CodDocumentsSectionComponent {
2225
2262
  this.idPdf = [];
2226
2263
  this.numDoc = -1;
2227
2264
  this.value = false;
2228
- this.documentState = {
2229
- doc_student: this.value,
2230
- doc_agreement: this.value,
2231
- doc_parent: this.value,
2232
- doc_confanorte: this.value,
2233
- };
2265
+ this.nameUserRole = '';
2234
2266
  this.documentsForm = this.fb.group({
2235
2267
  doc_student: ['', [Validators.required], []],
2236
2268
  doc_agreement: [''],
@@ -2244,22 +2276,7 @@ class CodDocumentsSectionComponent {
2244
2276
  }
2245
2277
  catchDocument(event, visible) {
2246
2278
  this.numDoc++;
2247
- switch (visible) {
2248
- case 'doc_student':
2249
- this.docStudent = true;
2250
- break;
2251
- case 'doc_agreement':
2252
- this.docAgreement = true;
2253
- break;
2254
- case 'doc_parent':
2255
- this.docParent = true;
2256
- break;
2257
- case 'doc_confanorte':
2258
- this.docConfanorte = true;
2259
- break;
2260
- default:
2261
- break;
2262
- }
2279
+ this.validateVisibility(visible, true);
2263
2280
  const fileCatched = event.target.files[0];
2264
2281
  let reader = new FileReader();
2265
2282
  reader.onload = (e) => {
@@ -2279,34 +2296,57 @@ class CodDocumentsSectionComponent {
2279
2296
  this.documentsForm.controls['doc_agreement'].setValue(null);
2280
2297
  this.documentsForm.controls['doc_parent'].setValue(null);
2281
2298
  this.documentsForm.controls['doc_confanorte'].setValue(null);
2299
+ this.docStudent = false;
2300
+ this.docAgreement = false;
2301
+ this.docParent = false;
2302
+ this.docConfanorte = false;
2282
2303
  }
2283
2304
  clearDocStudent(typeDoc) {
2284
2305
  this.documentsForm.controls[typeDoc].setValue(null);
2285
- this.docStudent = false;
2286
- switch (typeDoc) {
2306
+ this.validateVisibility(typeDoc, false);
2307
+ }
2308
+ validateVisibility(compVisivility, value) {
2309
+ switch (compVisivility) {
2287
2310
  case 'doc_student':
2288
- this.docStudent = false;
2311
+ this.docStudent = value;
2289
2312
  break;
2290
2313
  case 'doc_agreement':
2291
- this.docAgreement = false;
2314
+ this.docAgreement = value;
2292
2315
  break;
2293
2316
  case 'doc_parent':
2294
- this.docParent = false;
2317
+ this.docParent = value;
2295
2318
  break;
2296
2319
  case 'doc_confanorte':
2297
- this.docConfanorte = false;
2320
+ this.docConfanorte = value;
2298
2321
  break;
2299
2322
  default:
2300
2323
  break;
2301
2324
  }
2302
2325
  }
2326
+ getAllMedia() {
2327
+ this.mediaService.getAllDataMedia().subscribe((response) => {
2328
+ console.log(response.data);
2329
+ });
2330
+ }
2331
+ getUserRole() {
2332
+ this.userService.getUserRoleByCode(1).subscribe((response) => {
2333
+ this.nameUserRole = response.data[0];
2334
+ });
2335
+ }
2336
+ saveDocuments() {
2337
+ let request = {
2338
+ name: 'jhhgh',
2339
+ link: 'khkhk',
2340
+ user_autor: 2,
2341
+ };
2342
+ }
2303
2343
  }
2304
- CodDocumentsSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodDocumentsSectionComponent, deps: [{ token: i1$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
2344
+ CodDocumentsSectionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodDocumentsSectionComponent, deps: [{ token: i1$1.FormBuilder }, { token: MediaService }, { token: UserService }, { token: BaseService }], target: i0.ɵɵFactoryTarget.Component });
2305
2345
  CodDocumentsSectionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CodDocumentsSectionComponent, selector: "ipt-cod-documents-section", ngImport: i0, template: "<div class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\n\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">Documentos del COD</span>\n\n <div class=\"document_item flex flex-column align-items-center p-2 border-round\">\n <div class=\"ml-auto\">\n <div class=\"inp w-10\">\n <ipt-input\n [inputType]=\"'file'\"\n [placeHolder]=\"'Doc. Estudiante'\"\n [control]=\"documentsForm.controls['doc_student']\"\n (change)=\"catchDocument($event, 'doc_student')\"\n ></ipt-input>\n </div>\n <div class=\"btn flex justify-content-center flex-wrap w-8 p-2\" *ngIf=\"docStudent\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\" (click)=\"showIdDocument()\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\" (click)=\"clearDocStudent('doc_student')\"></button>\n </div>\n </div>\n </div>\n\n <div class=\"document_item flex flex-column align-items-center p-2 border-round\">\n <div class=\"ml-auto\">\n <div class=\"inp w-10\">\n <ipt-input\n [inputType]=\"'file'\"\n [placeHolder]=\"'Doc. Convenio'\"\n [control]=\"documentsForm.controls['doc_agreement']\"\n (change)=\"catchDocument($event, 'doc_agreement')\"\n ></ipt-input>\n </div>\n <div class=\"btn flex justify-content-center flex-wrap w-8 p-2\" *ngIf=\"docAgreement\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\" (click)=\"showIdDocument()\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\" (click)=\"clearDocStudent('doc_agreement')\"></button>\n </div>\n </div>\n </div>\n\n <div class=\"document_item flex flex-column align-items-center p-2 border-round\">\n <div class=\"ml-auto\">\n <div class=\"inp w-10\">\n <ipt-input\n [inputType]=\"'file'\"\n [placeHolder]=\"'Doc. Acudiente'\"\n [control]=\"documentsForm.controls['doc_parent']\"\n (change)=\"catchDocument($event, 'doc_parent')\"\n ></ipt-input>\n </div>\n <div class=\"btn flex justify-content-center flex-wrap w-8 p-2\" *ngIf=\"docParent\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\" (click)=\"showIdDocument()\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\" (click)=\"clearDocStudent('doc_parent')\"></button>\n </div>\n </div>\n </div>\n\n <div class=\"document_item flex flex-column align-items-center p-2 border-round\">\n <div class=\"ml-auto\">\n <div class=\"inp w-10\">\n <ipt-input\n [inputType]=\"'file'\"\n [placeHolder]=\"'Doc. Confanorte'\"\n [control]=\"documentsForm.controls['doc_confanorte']\"\n (change)=\"catchDocument($event, 'doc_confanorte')\"\n ></ipt-input>\n </div>\n <div class=\"btn flex justify-content-center flex-wrap w-8 p-2\" *ngIf=\"docConfanorte\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\" (click)=\"showIdDocument()\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\" (click)=\"clearDocStudent('doc_confanorte')\"></button>\n </div>\n </div>\n </div>\n\n <hr>\n <button pButton pRipple type=\"button\" icon=\"pi pi-plus\" label=\"Agregar\" class=\"p-button-rounded p-button-sm ml-auto mt-2\" (click)=\"filesUploaded()\"></button>\n\n</div>\n", styles: [".document_item{transition:.15s;gap:1rem;max-height:150px}.document_item:hover{cursor:pointer;box-shadow:#64646f33 0 7px 29px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: InputComponent, selector: "ipt-input", inputs: ["inputType", "placeHolder", "validateText", "withPipe", "list", "iconUrl", "control", "prefix", "thousands", "decimal"], outputs: ["dateSelected"] }, { kind: "directive", type: i7$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }] });
2306
2346
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CodDocumentsSectionComponent, decorators: [{
2307
2347
  type: Component,
2308
2348
  args: [{ selector: 'ipt-cod-documents-section', template: "<div class=\"container flex flex-column bg-white border-round-2xl p-3 container animate__animated animate__fadeInUp\">\n\n <span class=\"bg-primary p-2 border-round mb-2 w-auto text-lg font-semibold\">Documentos del COD</span>\n\n <div class=\"document_item flex flex-column align-items-center p-2 border-round\">\n <div class=\"ml-auto\">\n <div class=\"inp w-10\">\n <ipt-input\n [inputType]=\"'file'\"\n [placeHolder]=\"'Doc. Estudiante'\"\n [control]=\"documentsForm.controls['doc_student']\"\n (change)=\"catchDocument($event, 'doc_student')\"\n ></ipt-input>\n </div>\n <div class=\"btn flex justify-content-center flex-wrap w-8 p-2\" *ngIf=\"docStudent\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\" (click)=\"showIdDocument()\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\" (click)=\"clearDocStudent('doc_student')\"></button>\n </div>\n </div>\n </div>\n\n <div class=\"document_item flex flex-column align-items-center p-2 border-round\">\n <div class=\"ml-auto\">\n <div class=\"inp w-10\">\n <ipt-input\n [inputType]=\"'file'\"\n [placeHolder]=\"'Doc. Convenio'\"\n [control]=\"documentsForm.controls['doc_agreement']\"\n (change)=\"catchDocument($event, 'doc_agreement')\"\n ></ipt-input>\n </div>\n <div class=\"btn flex justify-content-center flex-wrap w-8 p-2\" *ngIf=\"docAgreement\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\" (click)=\"showIdDocument()\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\" (click)=\"clearDocStudent('doc_agreement')\"></button>\n </div>\n </div>\n </div>\n\n <div class=\"document_item flex flex-column align-items-center p-2 border-round\">\n <div class=\"ml-auto\">\n <div class=\"inp w-10\">\n <ipt-input\n [inputType]=\"'file'\"\n [placeHolder]=\"'Doc. Acudiente'\"\n [control]=\"documentsForm.controls['doc_parent']\"\n (change)=\"catchDocument($event, 'doc_parent')\"\n ></ipt-input>\n </div>\n <div class=\"btn flex justify-content-center flex-wrap w-8 p-2\" *ngIf=\"docParent\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\" (click)=\"showIdDocument()\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\" (click)=\"clearDocStudent('doc_parent')\"></button>\n </div>\n </div>\n </div>\n\n <div class=\"document_item flex flex-column align-items-center p-2 border-round\">\n <div class=\"ml-auto\">\n <div class=\"inp w-10\">\n <ipt-input\n [inputType]=\"'file'\"\n [placeHolder]=\"'Doc. Confanorte'\"\n [control]=\"documentsForm.controls['doc_confanorte']\"\n (change)=\"catchDocument($event, 'doc_confanorte')\"\n ></ipt-input>\n </div>\n <div class=\"btn flex justify-content-center flex-wrap w-8 p-2\" *ngIf=\"docConfanorte\">\n <button pButton pRipple type=\"button\" icon=\"pi pi-eye\" class=\"p-button-rounded p-button-sm ml-auto mr-1\" (click)=\"showIdDocument()\"></button>\n <button pButton pRipple type=\"button\" icon=\"pi pi-trash\" class=\"p-button-rounded p-button-sm p-button-danger ml-auto\" (click)=\"clearDocStudent('doc_confanorte')\"></button>\n </div>\n </div>\n </div>\n\n <hr>\n <button pButton pRipple type=\"button\" icon=\"pi pi-plus\" label=\"Agregar\" class=\"p-button-rounded p-button-sm ml-auto mt-2\" (click)=\"filesUploaded()\"></button>\n\n</div>\n", styles: [".document_item{transition:.15s;gap:1rem;max-height:150px}.document_item:hover{cursor:pointer;box-shadow:#64646f33 0 7px 29px}\n"] }]
2309
- }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }]; } });
2349
+ }], ctorParameters: function () { return [{ type: i1$1.FormBuilder }, { type: MediaService }, { type: UserService }, { type: BaseService }]; } });
2310
2350
 
2311
2351
  class LocalStorageCODService {
2312
2352
  constructor() { }