23 Commits

Author SHA1 Message Date
rajukottedi 3be0d38cf1 Merge pull request 'refactor: streamline Jenkinsfile by using helper methods for environment variables and agent labels' (#10) from develop into prod
bangararaju.kottedi.in/admin/admin-prod/pipeline/head Build queued...
Reviewed-on: #10
2026-02-16 20:33:10 +05:30
rajukottedi a0e56f6a89 refactor: streamline Jenkinsfile by using helper methods for environment variables and agent labels
bangararaju.kottedi.in/admin/admin-prod/pipeline/head This commit looks good
bangararaju.kottedi.in/admin/admin-uat/pipeline/head This commit looks good
2026-02-16 20:28:02 +05:30
rajukottedi 7cf7246abd Merge pull request 'develop' (#9) from develop into prod
bangararaju.kottedi.in/admin/admin-prod/pipeline/head This commit looks good
Reviewed-on: #9
2026-02-16 20:05:59 +05:30
rajukottedi 8885e288ed removed test file
bangararaju.kottedi.in/admin/admin-uat/pipeline/head This commit looks good
bangararaju.kottedi.in/admin/admin-prod/pipeline/head This commit looks good
2026-02-16 20:05:39 +05:30
rajukottedi a888636487 webhook test
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head This commit looks good
bangararaju.kottedi.in/admin/admin-prod/pipeline/head This commit looks good
2026-02-16 19:57:11 +05:30
rajukottedi dad46d788d webhook test
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head This commit looks good
2026-02-16 19:45:15 +05:30
rajukottedi 3619e33f44 webhook test
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head This commit looks good
2026-02-16 19:31:46 +05:30
rajukottedi cf8e3b880c fix: add sudo to systemctl reload command in deployment stage
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head This commit looks good
2026-02-16 19:13:30 +05:30
rajukottedi a6e48d6b2b fix: remove redundant ownership change command in deployment stage
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
2026-02-16 18:39:34 +05:30
rajukottedi 06a64fa018 fix: add npm install step before building Angular
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
2026-02-16 18:28:53 +05:30
rajukottedi 1bec713692 fix: ensure cleanup of deployment directory before building Angular
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
2026-02-16 18:11:14 +05:30
rajukottedi cea6d218f8 feat: add Jenkins pipeline for automated deployment
bangararaju.kottedi.in/admin/admin-uat-new/pipeline/head There was a failure building this commit
2026-02-16 17:40:09 +05:30
rajukottedi 9065626d40 Merge pull request 'develop' (#8) from develop into master
Reviewed-on: #8
2026-02-16 10:40:47 +05:30
rajukottedi 3dbecd171f Merge pull request 'fix: enhance OTP sending logic and add success message display' (#7) from task/popup-for-dynamic-form into develop
Reviewed-on: #7
2026-02-16 10:03:02 +05:30
rajukottedi bdba683f00 fix: enhance OTP sending logic and add success message display 2026-02-16 10:02:26 +05:30
rajukottedi 15ad26c505 Merge pull request 'fix: update project categories check and adjust border style in project detail popup' (#6) from task/popup-for-dynamic-form into develop
Reviewed-on: #6
2026-02-16 09:26:17 +05:30
rajukottedi e529f101b7 fix: update project categories check and adjust border style in project detail popup 2026-02-16 09:24:45 +05:30
rajukottedi 2bed3b6438 Merge pull request 'fix: update logout navigation to use navigateByUrl for cleaner routing' (#5) from task/popup-for-dynamic-form into develop
Reviewed-on: #5
2026-02-15 20:43:55 +05:30
rajukottedi 7d63845951 fix: update logout navigation to use navigateByUrl for cleaner routing 2026-02-15 20:36:16 +05:30
rajukottedi 7d707051d5 Merge pull request 'fix: update returnUrl handling and navigation in OtpComponent' (#4) from task/popup-for-dynamic-form into develop
Reviewed-on: #4
2026-02-15 15:24:29 +05:30
rajukottedi 9a90903b33 fix: update returnUrl handling and navigation in OtpComponent 2026-02-15 15:23:57 +05:30
rajukottedi 1147a5a10a Merge pull request 'fix: update auth guard to redirect to login without admin prefix' (#3) from task/popup-for-dynamic-form into develop
Reviewed-on: #3
2026-02-15 15:09:35 +05:30
rajukottedi 2108a89505 fix: update auth guard to redirect to login without admin prefix 2026-02-15 15:09:07 +05:30
10 changed files with 232 additions and 58 deletions
Vendored
+113
View File
@@ -0,0 +1,113 @@
pipeline {
agent none
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
}
environment {
DEPLOY_PATH = getDeployPath()
ENV_FILE_ID = getEnvFileId()
TARGET_URL = getHealthUrl()
}
stages {
stage('Checkout') {
agent { label getAgentLabel() }
steps {
checkout scm
}
}
stage('Inject Environment File') {
agent { label getAgentLabel() }
steps {
configFileProvider(
[configFile(
fileId: ENV_FILE_ID,
targetLocation: 'src/environments/environment.ts',
replaceTokens: true
)]
) {
echo "Environment file injected for ${env.BRANCH_NAME}"
}
}
}
stage('Build Angular') {
agent { label getAgentLabel() }
steps {
sh '''
npm install
ng build --configuration production --base-href /admin/
'''
}
}
stage('Deploy') {
agent { label getAgentLabel() }
steps {
sh '''
rm -rf $DEPLOY_PATH/*
cp -r dist/portfolio-admin/browser/* $DEPLOY_PATH/
sudo /usr/bin/systemctl reload nginx
'''
}
}
stage('Health Check') {
agent { label getAgentLabel() }
steps {
sh """
sleep 2
curl -f ${TARGET_URL}
"""
}
}
}
post {
failure {
echo "Deployment failed!"
}
success {
echo "Deployment successful!"
}
}
}
// -------- Helper Methods --------
def getAgentLabel() {
if (env.BRANCH_NAME == 'prod') {
return 'oracle-node'
} else {
return 'built-in' // for develop
}
}
def getEnvFileId() {
if (env.BRANCH_NAME == 'prod') {
return 'admin-prod-properties'
} else {
return 'admin-uat-properties'
}
}
def getDeployPath() {
if (env.BRANCH_NAME == 'prod') {
return "/var/www/bangararaju.kottedi.in/admin"
} else {
return "/var/www/bangararaju.kottedi.in/admin"
}
}
def getHealthUrl() {
if (env.BRANCH_NAME == 'prod') {
return "https://bangararaju.kottedi.in/admin"
} else {
return "https://bangararaju-uat.kottedi.in/admin"
}
}
@@ -88,7 +88,7 @@
</div>
}
@if (project.categories?.length) {
@if (project.categories.length) {
<div class="detail-section">
<h4>Categories</h4>
<div class="tag-list">
@@ -4,7 +4,7 @@
max-height: 80vh;
overflow-y: auto;
background: var(--eerie-black-2, #1e1e1e);
border: 1px solid var(--jet, #383838);
border: 1.2px solid hsla(45, 100%, 72%, 0.45);
border-radius: 14px;
}
+1 -1
View File
@@ -111,7 +111,7 @@ export class AuthService {
this.http.post<void>(this.api('/api/v1/auth/logout'), {}).subscribe();
this.accessToken = null;
this.safeRemoveToken();
this.router.navigate(['/admin/login']);
this.router.navigateByUrl('login');
}
refreshToken(): Observable<RefreshTokenResponse> {
+16 -12
View File
@@ -2,11 +2,11 @@
<div class="verify-card">
@if(!isOtpSent()){
<h2 class="title">🔐 Login</h2>
<h2 class="title">🔐 Login</h2>
}
@if(isOtpSent() && !isVerified()){
<h2 class="title">🔐 OTP Verification</h2>
<h2 class="title">🔐 OTP Verification</h2>
}
<!-- Step 1: Enter Email -->
@@ -21,19 +21,9 @@
<!-- Step 2: OTP Input -->
@if (isOtpSent() && !isVerified()) {
<div class="otp-section">
<p class="info-text">
OTP sent to <b>{{ emailForm.value.email }}</b>
</p>
<form [formGroup]="otpForm" (ngSubmit)="verifyOtp()">
<label for="otp">Enter 6-digit OTP</label>
<input id="otp" type="text" maxlength="6" formControlName="otp" placeholder="123456" />
@if (isError()) {
<div class="error-banner">
<i class="fa-solid fa-circle-exclamation"></i>
<span>{{ message() }}</span>
</div>
}
<button type="submit" [disabled]="otpForm.invalid">
Verify OTP
</button>
@@ -47,5 +37,19 @@
</button>
</div>
}
@if (isError()) {
<div class="error-banner">
<i class="fa-solid fa-circle-exclamation"></i>
<span>{{ message() }}</span>
</div>
}
@if (!isError() && isOtpSent() && !isVerified()) {
<div class="success-banner">
<i class="fa-solid fa-circle-check"></i>
<span>{{ message() }}</span>
</div>
}
</div>
</div>
+20
View File
@@ -171,3 +171,23 @@ button {
font-size: 14px;
margin-bottom: 10px;
}
/* Success banner for OTP sent */
.success-banner {
display: flex;
align-items: center;
gap: 8px;
background: rgba(120, 255, 140, 0.07);
border: 1px solid rgba(120, 255, 140, 0.25);
border-radius: 8px;
padding: 10px 14px;
margin: 10px 0 10px;
color: #78ff8c;
font-size: 13px;
i {
font-size: 15px;
flex-shrink: 0;
color: #78ff8c;
}
}
+20 -8
View File
@@ -19,7 +19,7 @@ export class OtpComponent implements OnInit {
message = signal('');
countdown = signal(0);
timer: NodeJS.Timeout | undefined;
returnUrl = '/';
returnUrl = '';
fb: FormBuilder = inject(FormBuilder);
authService: AuthService = inject(AuthService);
router: Router = inject(Router);
@@ -35,28 +35,40 @@ export class OtpComponent implements OnInit {
});
if(this.authService.isLoggedIn()){
this.router.navigateByUrl('/');
this.router.navigate(['']);
}
}
ngOnInit() {
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || '/';
this.returnUrl = this.route.snapshot.queryParamMap.get('returnUrl') || '';
}
sendOtp() {
if (this.emailForm.invalid) return;
const email = this.emailForm.value.email;
this.authService.sendOtp(email).subscribe(() => {
this.isOtpSent.set(true);
this.message.set('OTP sent successfully!');
this.startTimer(30); // 30 seconds countdown
this.authService.sendOtp(email).subscribe({
next: () => {
this.isOtpSent.set(true);
this.isError.set(false);
this.message.set(`OTP sent to ${email}.`);
this.startTimer(30); // 30 seconds countdown
},
error: (err) => {
this.isError.set(true);
if (err.status === 404) {
this.message.set('Email not found. Please check and try again.');
} else {
this.message.set('Failed to send OTP. Please try again.');
}
}
});
}
}
resendOtp() {
if (this.countdown() > 0) return;
this.otpForm.reset();
this.sendOtp();
}
+1 -1
View File
@@ -16,5 +16,5 @@ export const authGuard: CanActivateFn = (route, state) => {
return auth.currentToken
? true
: router.parseUrl(`/admin/login?returnUrl=${state.url}`);
: router.parseUrl(`login?returnUrl=${state.url}`);
};
+55 -29
View File
@@ -1,41 +1,65 @@
/* Dynamic form spacing and material tweaks to match popup theme */
.full-width { width: 100%; display: block; }
.full-width {
width: 100%;
display: block;
}
mat-form-field.full-width { margin-bottom: 12px; }
mat-form-field.full-width {
margin-bottom: 12px;
}
/* Reduce label size slightly to fit popup */
mat-form-field .mat-form-field-label { font-size: 0.95rem; color: var(--light-gray-70); }
mat-form-field .mat-form-field-label {
font-size: 0.95rem;
color: var(--light-gray-70);
}
/* Make input text contrast better */
.mat-input-element,
input.mat-mdc-input-element,
textarea.mat-mdc-input-element,
.mat-mdc-input-element {
color: var(--white-1) !important;
color: var(--white-1) !important;
}
/* Smaller helper/hint text */
.mat-hint { color: var(--light-gray-70); font-size: 0.85rem; }
.mat-hint {
color: var(--light-gray-70);
font-size: 0.85rem;
}
/* Error styling consistent with theme */
mat-error { color: #ff8a80; font-size: 0.9rem; }
mat-error {
color: #ff8a80;
font-size: 0.9rem;
}
/* Outline border always visible, highlight on focus */
::ng-deep .mdc-notched-outline__leading,
::ng-deep .mdc-notched-outline__notch,
::ng-deep .mdc-notched-outline__trailing {
border-color: var(--light-gray-70) !important;
border-color: var(--light-gray-70) !important;
}
::ng-deep .mat-mdc-form-field.mat-focused .mdc-notched-outline__leading,
::ng-deep .mat-mdc-form-field.mat-focused .mdc-notched-outline__notch,
::ng-deep .mat-mdc-form-field.mat-focused .mdc-notched-outline__trailing {
border-color: var(--orange-yellow-crayola) !important;
border-color: var(--orange-yellow-crayola) !important;
}
/* Make array item fields inline on larger screens */
.array-item-fields { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.array-item-fields mat-form-field { flex: 1 1 auto; margin-bottom: 0; min-width: 120px; }
.array-item-fields {
display: flex;
gap: 12px;
align-items: baseline;
flex-wrap: wrap;
}
.array-item-fields mat-form-field {
flex: 1 1 auto;
margin-bottom: 0;
min-width: 120px;
}
/* Stack array item fields vertically on small screens */
@media (max-width: 580px) {
@@ -52,37 +76,38 @@ mat-error { color: #ff8a80; font-size: 0.9rem; }
/* Hide subscript wrapper inside array items so fields align */
.array-item ::ng-deep .mat-mdc-form-field-subscript-wrapper {
display: none;
display: none;
}
/* Remove link at bottom-right of each array card */
.array-item-actions {
display: flex;
justify-content: center;
margin-top: 4px;
display: flex;
justify-content: center;
margin-top: 4px;
}
.remove-link {
background: none;
border: none;
color: rgba(255, 255, 255, 0.35);
font-size: 0.8rem;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 5px;
padding: 4px 8px;
border-radius: 4px;
transition: color 0.2s ease, background 0.2s ease;
background: none;
border: none;
color: rgba(255, 255, 255, 0.35);
font-size: 0.8rem;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 5px;
padding: 4px 8px;
border-radius: 4px;
transition: color 0.2s ease, background 0.2s ease;
&:hover {
color: hsl(0deg 75% 60%);
background: rgba(255, 70, 70, 0.1);
}
&:hover {
color: hsl(0deg 75% 60%);
background: rgba(255, 70, 70, 0.1);
}
}
/* Force material label/input colors to match dark popup theme (covers MDC + legacy classes) */
.themed-popup {
::ng-deep .mat-form-field-label,
::ng-deep .mat-mdc-floating-label,
::ng-deep .mat-form-field .mat-form-field-label {
@@ -107,6 +132,7 @@ mat-error { color: #ff8a80; font-size: 0.9rem; }
opacity: 1 !important;
}
}
.form-array {
margin-bottom: 20px;
padding: 10px 0;
+4 -5
View File
@@ -507,9 +507,9 @@
.mat-mdc-text-field.mat-mdc-focused .mat-mdc-notched-outline .mat-mdc-notched-outline-path {
stroke: var(--orange-yellow-crayola) !important;
border-color: var(--orange-yellow-crayola) !important;
}
/* Additional overrides: set MDC theme variables and force a gold focus ring */
.themed-popup {
// .themed-popup {
/* Override MDC primary color used by many Material components */
--mdc-theme-primary: var(--orange-yellow-crayola);
--mdc-theme-on-primary: var(--smoky-black);
@@ -529,10 +529,9 @@
.mat-mdc-text-field.mat-mdc-focused .mat-mdc-notched-outline-path {
stroke: var(--orange-yellow-crayola) !important;
}
}
box-shadow: 0 6px 18px rgba(36,26,18,0.12) !important;
// }
// box-shadow: 0 6px 18px rgba(36,26,18,0.12) !important;
}
}
.contacts-list {
display: grid;