utn-cli 2.1.35 → 2.1.37
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.
- package/commands/update.js +14 -4
- package/index.js +3 -2
- package/package.json +1 -1
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.css +23 -2
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.html +6 -1
- package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.ts +1 -0
package/commands/update.js
CHANGED
|
@@ -6,7 +6,16 @@ import { updateDb } from './db.js';
|
|
|
6
6
|
import { closeReadLine, hacerPreguntaTrim } from '../utils/index.js';
|
|
7
7
|
import { execSync } from 'child_process';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function resolverRamaPrincipal(fullPath) {
|
|
10
|
+
try {
|
|
11
|
+
const ramas = execSync('git branch -r', { cwd: fullPath }).toString();
|
|
12
|
+
if (ramas.includes('origin/main')) return 'main';
|
|
13
|
+
if (ramas.includes('origin/master')) return 'master';
|
|
14
|
+
} catch (_) {}
|
|
15
|
+
return 'main';
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function runGlobalUpdate({ usarPrincipal = false } = {}) {
|
|
10
19
|
const currentDir = process.cwd();
|
|
11
20
|
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
|
12
21
|
|
|
@@ -37,11 +46,12 @@ export async function runGlobalUpdate() {
|
|
|
37
46
|
// Ignorar si no se puede obtener la URL
|
|
38
47
|
}
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
const rama = usarPrincipal ? resolverRamaPrincipal(fullPath) : 'desarrollo';
|
|
50
|
+
console.log(`[${dir.name}] Asegurando rama '${rama}'...`);
|
|
41
51
|
try {
|
|
42
|
-
execSync(
|
|
52
|
+
execSync(`git checkout ${rama}`, { stdio: 'inherit' });
|
|
43
53
|
} catch (error) {
|
|
44
|
-
console.error(`Error al cambiar a la rama '
|
|
54
|
+
console.error(`Error al cambiar a la rama '${rama}' en ${dir.name}. Continuando...`);
|
|
45
55
|
}
|
|
46
56
|
|
|
47
57
|
console.log(`[${dir.name}] Ejecutando git pull...`);
|
package/index.js
CHANGED
|
@@ -102,8 +102,9 @@ program.command('frontend')
|
|
|
102
102
|
// Define 'update' command
|
|
103
103
|
program.command('update')
|
|
104
104
|
.description('Recorre los directorios y actualiza proyectos de backend (si el nombre contiene "back") y frontend (si el nombre contiene "front").')
|
|
105
|
-
.
|
|
106
|
-
|
|
105
|
+
.option('--principal', 'Usa la rama principal (main/master) en lugar de desarrollo.')
|
|
106
|
+
.action(async (options) => {
|
|
107
|
+
await runGlobalUpdate({ usarPrincipal: !!options.principal });
|
|
107
108
|
});
|
|
108
109
|
|
|
109
110
|
// Define 'pull' command
|
package/package.json
CHANGED
package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.css
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
.modulo-card {
|
|
6
6
|
position: relative;
|
|
7
7
|
width: 300px;
|
|
8
|
-
|
|
8
|
+
/* Reduced from 380px */
|
|
9
9
|
height: 220px;
|
|
10
10
|
border-radius: 25px;
|
|
11
11
|
overflow: hidden;
|
|
@@ -38,13 +38,34 @@
|
|
|
38
38
|
position: relative;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
.modulo-tipo-container {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
align-items: flex-start;
|
|
45
|
+
gap: 6px;
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
.modulo-tipo {
|
|
42
49
|
color: #3e5a7a;
|
|
43
50
|
font-size: 1.2rem;
|
|
44
51
|
font-weight: 500;
|
|
45
52
|
letter-spacing: 1px;
|
|
46
53
|
margin-top: 5px;
|
|
47
|
-
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.modulo-cantidad-badge {
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
align-items: center;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
background-color: #dce8fb;
|
|
61
|
+
color: #0B4FCE;
|
|
62
|
+
font-size: 0.7rem;
|
|
63
|
+
font-weight: 700;
|
|
64
|
+
min-width: 20px;
|
|
65
|
+
height: 20px;
|
|
66
|
+
padding: 0 5px;
|
|
67
|
+
border-radius: 10px;
|
|
68
|
+
line-height: 1;
|
|
48
69
|
}
|
|
49
70
|
|
|
50
71
|
.pin-container {
|
package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.html
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<div class="modulo-card" (click)="onClick()">
|
|
2
2
|
<div class="modulo-card-header">
|
|
3
|
-
<
|
|
3
|
+
<div class="modulo-tipo-container">
|
|
4
|
+
<span class="modulo-tipo">{{ modulo.Tipo | uppercase }}</span>
|
|
5
|
+
@if(cantidad !== undefined && cantidad > 0) {
|
|
6
|
+
<span class="modulo-cantidad-badge">{{ cantidad }}</span>
|
|
7
|
+
}
|
|
8
|
+
</div>
|
|
4
9
|
<div class="pin-container" (click)="alternarFavorito($event)" [ngClass]="{ 'pinned': estaEnFavoritos() }">
|
|
5
10
|
<span class="material-icons pin-icon">
|
|
6
11
|
push_pin
|
package/templates/frontend/src/app/Componentes/Nucleo/tarjeta-modulo/tarjeta-modulo.component.ts
CHANGED
|
@@ -11,6 +11,7 @@ import { MiscelaneosService } from '../../../miscelaneos.service';
|
|
|
11
11
|
})
|
|
12
12
|
export class TarjetaModuloComponent {
|
|
13
13
|
@Input() modulo!: any;
|
|
14
|
+
@Input() cantidad?: number;
|
|
14
15
|
@Output() moduloSeleccionado = new EventEmitter<any>();
|
|
15
16
|
@Output() favoritoToggled = new EventEmitter<string>();
|
|
16
17
|
|