Commit 6f27a219 by shabaz.khan

Initial Commit

parents
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries
# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support
# You can see what browsers were selected by your queries by running:
# npx browserslist
last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
# Editor configuration, see https://editorconfig.org
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.ts]
quote_type = single
[*.md]
max_line_length = off
trim_trailing_whitespace = false
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events*.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
# Demo
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.1.4.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Code scaffolding
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
## Build
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
## Running unit tests
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Running end-to-end tests
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"demo": {
"projectType": "application",
"schematics": {
"@schematics/angular:application": {
"strict": true
}
},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/demo",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css",
"./node_modules/bootstrap/dist/css/bootstrap.min.css",
"./node_modules/font-awesome/css/font-awesome.css",
"./node_modules/ngx-toastr/toastr.css"
],
"scripts": [
"./node_modules/bootstrap/dist/js/bootstrap.js"
]
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "4kb"
}
],
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "production"
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "demo:build:production"
},
"development": {
"browserTarget": "demo:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "demo:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css"
],
"scripts": []
}
}
}
}
},
"defaultProject": "demo"
}
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
},
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/demo'),
subdir: '.',
reporters: [
{ type: 'html' },
{ type: 'text-summary' }
]
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};
{
"name": "demo",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "~12.1.0",
"@angular/common": "~12.1.0",
"@angular/compiler": "~12.1.0",
"@angular/core": "~12.1.0",
"@angular/forms": "~12.1.0",
"@angular/platform-browser": "~12.1.0",
"@angular/platform-browser-dynamic": "~12.1.0",
"@angular/router": "~12.1.0",
"@ng-select/ng-select": "^7.2.0",
"angular-animations": "^0.11.0",
"bootstrap": "^5.0.2",
"font-awesome": "^4.7.0",
"ngx-spinner": "^12.0.0",
"ngx-toaster": "^1.0.1",
"ngx-toastr": "^14.1.0",
"rxjs": "~6.6.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.1.4",
"@angular/cli": "^6.1.1",
"@angular/compiler-cli": "~12.1.0",
"@types/jasmine": "~3.8.0",
"@types/node": "^12.11.1",
"jasmine-core": "~3.8.0",
"karma": "~6.3.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "~1.7.0",
"typescript": "~4.3.2"
}
}
<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
<p style="color: white">Please Wait. </p>
</ngx-spinner>
<!-- <h6 class="hed-color">Accept Merge Request</h6> -->
<!-- <div class="card">
<div class="card-body"> -->
<div class="form-group row row-pad">
<!-- <label for="inputPassword" class="col-sm-2 col-form-label hed-color">Create From</label> -->
<div class="col-sm-6">
<ng-select [(ngModel)]="mergeTitle" name="mergeTitle" (change)="selectChangeHandler($event)">
<ng-option *ngFor="let merge of mergeDetails;" id="mergeTitle" [value]="merge">
{{merge.title}}
</ng-option>
</ng-select>
</div>
<div class="col-sm-2" style="float: left;">
<button class="btn btn-success" type="submit" style="float: right;" *ngIf="mergeButton" (click)="merge()">Merge</button>
</div>
<div class="col-sm-4"></div>
</div>
<div class="form-group row row-pad" *ngIf="requestmerge">
<div class="col-sm-6" style="color: black;">
<label class="lab_font">Request to merge: </label> {{source}} <label class="lab_font">into</label> {{target}}
</div>
</div>
<div class="form-group row" *ngIf="conflictUrl">
<div class="col-sm-6" style="color: black;">
<a href="{{conflictUrl}}" target="_blank">{{conflictUrl}}</a>
</div>
</div>
<!-- <div class="row row-pad">
<div class="col-md-8"></div>
<div class="col-md-4">
<button class="btn btn-primary" type="submit" style="float: right;"
(click)="saveBranch(name,'branch.name')">Execute</button>
</div>
</div>] -->
<!-- </div>
</div> -->
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AcceptMergeRequestComponent } from './accept-merge-request.component';
describe('AcceptMergeRequestComponent', () => {
let component: AcceptMergeRequestComponent;
let fixture: ComponentFixture<AcceptMergeRequestComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AcceptMergeRequestComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(AcceptMergeRequestComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input, OnInit } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { AppService } from '../app.service';
@Component({
selector: 'app-accept-merge-request',
templateUrl: './accept-merge-request.component.html',
styleUrls: ['./accept-merge-request.component.css']
})
export class AcceptMergeRequestComponent implements OnInit {
mergeDetails: any; mergeTitle: any; conflict: string = ''; event: any;
mergeButton: boolean = false; merge_status: any; web_url: any; conflictUrl = false;
target: any; source: any; requestmerge = false; merge_id: any;status: any;
constructor(private _appservice: AppService, public toastr: ToastrService) { }
@Input() projectId;
ngOnInit(): void {
this._appservice.spinner();
this.getMergeData(this.projectId);
}
getMergeData(projectID) {
this._appservice.getOpenedRequest(this.projectId).subscribe(data => {
this.mergeDetails = data;
})
}
// onChange(event: any) {
// debugger
// this.firstparam = event.target.value;
// }
selectChangeHandler(event: any) {
this.conflict = event.merge_status;
this.conflictUrl = event.web_url;
this.source = event.source_branch;
this.target = event.target_branch;
this.merge_id = event.iid;
if (this.conflict == "cannot_be_merged") {
this.mergeButton = false;
this.conflictUrl;
} else {
this.mergeButton = true;
this.conflictUrl = false;
}
if (this.event != '') {
this.requestmerge = true;
}
}
merge() {
// let merge_status ='';
this.projectId = this.projectId;
this._appservice.mergeAccept(this.merge_id, this.projectId).subscribe(data => {
// if(this.status == 'can_be_merged'){
// console.log(data);
this.toastr.success('The changes were merged into: ' +this.target, 'Merging is Done', {
timeOut: 3000,
});
// }
this.clearData();
})
}
clearData() {
try {
this.event = ''
} catch (error) {
console.log(error);
}
}
}
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AcceptMergeRequestComponent } from './accept-merge-request/accept-merge-request.component';
import { BulkCreateBranchComponent } from './bulk-create-branch/bulk-create-branch.component';
import { BulkMergeRequestComponent } from './bulk-merge-request/bulk-merge-request.component';
import { BulkTagComponent } from './bulk-tag/bulk-tag.component';
import { CreateBranchComponent } from './create-branch/create-branch.component';
import { MergeRequestComponent } from './merge-request/merge-request.component';
import { TagComponent } from './tag/tag.component';
const routes: Routes = [
{
path: '',
redirectTo:'/create-branch',
pathMatch: 'full'
},
{
path:'create-branch',
component: CreateBranchComponent
},
{
path:'merge-branch',
component: MergeRequestComponent
},
{
path:'tag',
component: TagComponent
},
{
path:'accept-merge-request',
component: AcceptMergeRequestComponent
},
{
path:'bulk-create-branch',
component: BulkCreateBranchComponent
},
{
path:'bulk-tag',
component: BulkTagComponent
},
{
path:'bulk-merge-request',
component: BulkMergeRequestComponent
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
})
export class AppRoutingModule { }
<app-header></app-header>
<div class="container headerpad">
<div class="row row-pad">
<div class="col-md-12">
<div class="card shadow p-3 mb-5 bg-white rounded" style="background-color:#fff;">
<div class="card-body" style="color: black;">
<h6>Execute for All Projects:</h6>
<div class="row">
<div class="col-md-8">
<div class="btn-group" role="group" aria-label="Basic radio toggle button group">
<input type="radio" class="btn-check"
autocomplete="off" [checked]="bulkAction == 'bulk-create'">
<label class="btn btn-outline-primary btn-color" for='_cb'
(click)="createBulk('bulk-create')" (change)="onChange($event)">Create Branch</label>
<input type="radio" class="btn-check" name="btnradio" id="btnradio2" autocomplete="off">
<label class="btn btn-outline-primary btn-color" for="btnradio2"
(click)="createBulk('bulk-merge-request')">Merge Request</label>
<input type="radio" class="btn-check" name="btnradio" id="btnradio3" autocomplete="off">
<label class="btn btn-outline-primary btn-color" for="btnradio3"
(click)="createBulk('bulk-tag')">Tag</label>
</div>
<!-- <button type="button" class="btn btn-primary btn-floating" style="margin-right: 1rem;"> -->
<i class="fa fa-refresh" style="margin-left: 1rem;cursor: pointer;" (click)="refresh()"></i>
<!-- </button> -->
</div>
</div>
<div class="row">
<div class="col-md-12">
<ng-container *ngIf="bulkAction === 'bulk-create'">
<app-bulk-create-branch></app-bulk-create-branch>
</ng-container>
<ng-container *ngIf="bulkAction === 'bulk-tag'">
<app-bulk-tag></app-bulk-tag>
</ng-container>
<ng-container *ngIf="bulkAction === 'bulk-merge-request'">
<app-bulk-merge-request></app-bulk-merge-request>
</ng-container>
</div>
</div>
<div class="row row-pad">
<div class="col-md-12">
<div class="card shadow-sm p-3 mb-5 bg-white rounded" *ngFor="let project of projects">
<div class="card-body" style="color: #fff;">
<h6 class="hed-color">Project Name:
<label class="" style="font-weight: 400;" [(ngModel)]="projectId">{{project.name + ' : ' +
project.id}}</label>
<!-- Project ID:<label class="" style="font-weight: 400;">[{{project.id}}]</label> -->
</h6>
<div class="row row-pad">
<div class="col-md-8">
<div class="btn-group" role="group" aria-label="Basic radio toggle button group">
<input type="radio" class="btn-check" [name]="project.id + '_cb'" [id]="project.id + '_cb'"
autocomplete="off" [checked]="selectedAction == 'create'">
<label class="btn btn-outline-primary btn-color" for="project.id + '_cb'"
(click)="createBranch('create')" (change)="onChange($event)">Create Branch</label>
<input type="radio" class="btn-check" [name]="project.id + '_mb'" [id]="project.id + '_mb'"
autocomplete="off" [checked]="selectedAction == 'merge'">
<label class="btn btn-outline-primary btn-color" for="project.id + '_mb'"
(click)="createBranch('merge')">Merge Request</label>
<input type="radio" class="btn-check" [name]="project.id + '_tag'" [id]="project.id + '_tag'"
autocomplete="off" [checked]="selectedAction == 'tag'">
<label class="btn btn-outline-primary btn-color" for="project.id + '_tag' "
(click)="createBranch('tag')">Tag</label>
<input type="radio" class="btn-check" [name]="project.id + '_tag'" [id]="project.id + '_tag'"
autocomplete="off" [checked]="selectedAction == 'tag'">
<label class="btn btn-outline-primary btn-color" for="project.id + '_tag' "
(click)="createBranch('mergerequest')">Accept Merge Request</label>
</div>
</div>
<!-- <div class="col-md-4">
<button class="btn btn-primary" style="float: right;" (click)="saveBranch(project.id)">Execute</button>
</div> -->
</div>
<div class="row">
<div class="col-md-12">
<ng-container *ngIf="selectedAction === 'create'">
<app-create-branch [projectId]="project.id"></app-create-branch>
</ng-container>
<!-- <ng-container *ngIf="selectedAction === 'bulk-create'">
<app-bulk-create-branch></app-bulk-create-branch>
</ng-container> -->
<ng-container *ngIf="selectedAction === 'merge'">
<app-merge-request [projectId]="project.id"></app-merge-request>
</ng-container>
<ng-container *ngIf="selectedAction === 'tag'">
<app-tag [projectId]="project.id"></app-tag>
</ng-container>
<ng-container *ngIf="selectedAction === 'mergerequest'">
<app-accept-merge-request [projectId]="project.id"></app-accept-merge-request>
</ng-container>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- <div class="row row-pad">
<div class="col-md-12">
<div class="card bg-secondary">
<div class="card-body" style="color: white;">
Child One
</div>
</div>
</div>
</div>
<div class="row row-pad">
<div class="col-md-12">
<div class="card bg-secondary">
<div class="card-body" style="color: white;">
Child One
</div>
</div>
</div>
</div>
<div class="row row-pad">
<div class="col-md-12">
<div class="card bg-secondary">
<div class="card-body" style="color: white;">
Child One
</div>
</div>
</div>
</div>
<div class="row row-pad">
<div class="col-md-12">
<div class="card bg-secondary">
<div class="card-body" style="color: white;">
Child One
</div>
</div>
</div>
</div>
<div class="row row-pad">
<div class="col-md-12">
<div class="card bg-secondary">
<div class="card-body" style="color: white;">
Child One
</div>
</div>
</div>
</div> -->
</div>
</div>
</div>
</div>
</div>
<!-- <app-create-branch [parentId]='projectId'></app-create-branch> -->
<app-footer></app-footer>
\ No newline at end of file
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
});
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'demo'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('demo');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('demo app is running!');
});
});
import { Component } from '@angular/core';
import { Router } from '@angular/router';
import { NgxSpinnerService } from 'ngx-spinner';
import { AppService } from './app.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'demo';
projects: any; secondary: any; val: any; firstparam: any; projectId: any;
constructor(private _route: Router, private _appService: AppService,private _spinnerService: NgxSpinnerService) { }
public selectedAction: any = 'create';
public bulkAction:any = 'bulk-create'
ngOnInit(): void {
this._appService.spinner();
this.projectdata();
}
projectdata() {
// https://gitlab.knowledgelens.com/api/v4/groups/1819/projects/?private_token=h--4AGzP43TxxMkpWSXE&visibility=private&per_page=100
this._appService.getProjects().subscribe(
data => {
this.projects = data;
}
)
}
refresh(): void {
this.projectdata();
}
// createBulk(val){
// console.log(val);
// }
createBulk(val) {
this.bulkAction = val;
if(val == 'bulk-create'){
this._route.navigate(['/bulk-create-branch'])
}else if(val == 'bulk-tag'){
this._route.navigate(['/bulk-tag'])
}else if(val == 'bulk-merge-request'){
this._route.navigate(['/bulk-merge-request'])
}
}
createBranch(val) {
this.selectedAction = val;
if(val=='create')
{
this._route.navigate(['/create-branch']);
}else if(val=='merge'){
this._route.navigate(['/merge-branch']);
}else if(val=='tag'){
this._route.navigate(['/tag']);
}else if(val=='mergerequest'){
this._route.navigate(['/accept-merge-request']);
}
// else if(val=='bulk-create'){
// this._route.navigate(['/bulk-create-branch'])
// }
}
onChange(event: any) {
this.firstparam = event.target.value;
}
}
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { HeaderComponent } from './header/header.component';
import { FooterComponent } from './footer/footer.component';
import { CreateBranchComponent } from './create-branch/create-branch.component';
import { TagComponent } from './tag/tag.component';
import { HttpClientModule } from '@angular/common/http'
import { FormsModule } from '@angular/forms';
import { NgSelectModule } from '@ng-select/ng-select';
import { NgxSpinnerModule } from "ngx-spinner";
import { MergeRequestComponent } from './merge-request/merge-request.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { AcceptMergeRequestComponent } from './accept-merge-request/accept-merge-request.component';
import {ToastrModule} from 'ngx-toastr';
import { BulkCreateBranchComponent } from './bulk-create-branch/bulk-create-branch.component';
import { BulkTagComponent } from './bulk-tag/bulk-tag.component';
import { BulkMergeRequestComponent } from './bulk-merge-request/bulk-merge-request.component'
@NgModule({
declarations: [
AppComponent,
HeaderComponent,
FooterComponent,
CreateBranchComponent,
MergeRequestComponent,
TagComponent,
AcceptMergeRequestComponent,
BulkCreateBranchComponent,
BulkTagComponent,
BulkMergeRequestComponent
],
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
FormsModule,
NgSelectModule,
NgxSpinnerModule,
BrowserAnimationsModule,
ToastrModule.forRoot(),
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
import { TestBed } from '@angular/core/testing';
import { AppService } from './app.service';
describe('AppService', () => {
let service: AppService;
beforeEach(() => {
TestBed.configureTestingModule({});
service = TestBed.inject(AppService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
});
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { NgxSpinnerService } from 'ngx-spinner';
import { forkJoin, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
import { environment } from 'src/environments/environment';
import { branchInterface } from './branchinfo';
@Injectable({
providedIn: 'root'
})
export class AppService {
constructor(private _http: HttpClient, private _spinnerService: NgxSpinnerService) { }
private _url = environment.URL; private _userUrl:any;
// private _addApi = "https://gitlab.knowledgelens.com/api/v4/projects/4485/repository/branches";
getProjects(): Observable<branchInterface[]> {
this._url = "https://gitlab.knowledgelens.com/api/v4/groups/1974/projects/?private_token=h--4AGzP43TxxMkpWSXE&visibility=private&per_page=100";
// this._url = "https://gitlab.knowledgelens.com/api/v4/groups/1819/projects/?private_token=h--4AGzP43TxxMkpWSXE&visibility=private&per_page=100";
return this._http.get<branchInterface[]>(this._url);
}
getBranches(projectId) {
let _url = "https://gitlab.knowledgelens.com/api/v4/projects/" + projectId + "/repository/branches/?private_token=h--4AGzP43TxxMkpWSXE&visibility=private";
return this._http.get(_url);
}
getTag(projectId) {
let _tagurl = "https://gitlab.knowledgelens.com/api/v4/projects/" + projectId + "/repository/tags?private_token=h--4AGzP43TxxMkpWSXE&visibility=private";
return this._http.get(_tagurl);
}
addBranch(name1, branchdata, projectId) {
let formData: any = new FormData();
formData.append("ref", branchdata);
formData.append("branch", name1);
var headers = new Headers();
let _url = "https://gitlab.knowledgelens.com/api/v4/projects/" + projectId + "/repository/branches/?private_token=h--4AGzP43TxxMkpWSXE&visibility=private";
headers.append('Content-Type', 'application/json');
return this._http.post(_url, formData);
}
addTag(name,branchdata,message,projectId){
let formData:any = new FormData();
formData.append("ref",branchdata);
formData.append("tag_name",name);
formData.append("message",message);
var headers = new Headers();
let _url = "https://gitlab.knowledgelens.com/api/v4/projects/" + projectId + "/repository/tags/?private_token=h--4AGzP43TxxMkpWSXE&visibility=private";
headers.append('Content-Type', 'application/json');
return this._http.post(_url, formData);
}
getAssignees(){
let _url = "https://gitlab.knowledgelens.com/api/v4/users/?private_token=h--4AGzP43TxxMkpWSXE&visibility=private";
return this._http.get(_url);
}
addRequest(title,desc,assignee,sourceBranch,targetBranch,projectId){
let formData:any = new FormData();
formData.append("title",title);
formData.append("description",desc);
formData.append("assignee",assignee);
formData.append("source_branch",sourceBranch);
formData.append("target_branch",targetBranch);
var headers = new Headers();
let _url = "https://gitlab.knowledgelens.com/api/v4/projects/" +projectId+ "/merge_requests?private_token=h--4AGzP43TxxMkpWSXE&visibility=private";
headers.append('Content-Type', 'application/json');
return this._http.post(_url, formData);
}
mergeAccept(merge_id,projectId){
let formData:any = new FormData();
formData.append('iid',merge_id);
var headers = new Headers();
let _url ="https://gitlab.knowledgelens.com/api/v4/projects/"+projectId+"/merge_requests/"+merge_id+"/merge?private_token=h--4AGzP43TxxMkpWSXE&visibility=private";
headers.append('Content-Type', 'application/json');
return this._http.put(_url, formData);
}
spinner(){
this._spinnerService.show();
setTimeout(() => {
this._spinnerService.hide();
}, 500);
}
getOpenedRequest(projectId){
let _url = "https://gitlab.knowledgelens.com/api/v4/projects/" +projectId+ "/merge_requests?private_token=h--4AGzP43TxxMkpWSXE&visibility=private&state=opened";
return this._http.get(_url);
}
getUserName(){
let _userUrl = "https://gitlab.knowledgelens.com/api/v4/user/?private_token=h--4AGzP43TxxMkpWSXE&visibility=private";
return this._http.get(_userUrl);
}
}
export interface branchInterface {
id?: number;
name?: string;
}
\ No newline at end of file
<!-- <ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
<p style="color: white">Please Wait. </p>
</ngx-spinner> -->
<h6 class="hed-color">New Branch</h6>
<div class="card">
<div class="card-body">
<div class="form-group row row-pad">
<label for="name" class="col-sm-2 col-form-label hed-color">Branch Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="name" [(ngModel)]="name" name="name" placeholder="">
</div>
</div>
<div class="form-group row row-pad">
<label for="inputPassword" class="col-sm-2 col-form-label hed-color">Create From</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="createFrom" [(ngModel)]="createFrom" name="createFrom" placeholder="">
</div>
</div>
<div class="row row-pad">
<div class="col-md-8"></div>
<div class="col-md-4">
<button class="btn btn-primary" type="submit" style="float: right;"
(click)="saveBranch()">Execute</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BulkCreateBranchComponent } from './bulk-create-branch.component';
describe('BulkCreateBranchComponent', () => {
let component: BulkCreateBranchComponent;
let fixture: ComponentFixture<BulkCreateBranchComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BulkCreateBranchComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(BulkCreateBranchComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input, OnInit } from '@angular/core';
import { AppService } from '../app.service';
import { NgxSpinnerService } from 'ngx-spinner';
import { ToastrService } from 'ngx-toastr'
@Component({
selector: 'app-bulk-create-branch',
templateUrl: './bulk-create-branch.component.html',
styleUrls: ['./bulk-create-branch.component.css']
})
export class BulkCreateBranchComponent implements OnInit {
createFrom: any; name: any; projects: any; projectDetails: any;
constructor(private _appService: AppService, private _spinnerService: NgxSpinnerService, public toastr: ToastrService) { }
@Input() branchesData;
ngOnInit(): void {
this._appService.spinner();
this.projectdata();
}
projectdata() {
this._appService.getProjects().subscribe(
data => {
this.projectDetails = data;
}
)
}
async saveBranch() {
this._spinnerService.show();
let erromsg = false;
for (let i = 0; i < this.projectDetails.length; i++) {
this._appService.addBranch(this.name, this.createFrom, this.projectDetails[i]['id']).subscribe(data => {
console.log(data);
setTimeout(() => {
this._spinnerService.hide();
}, 500);
this.toastr.success('Branches Created Successfully', 'Branch', {
timeOut: 3000,
});
})
}
this.clearData();
}
clearData() {
try {
this.name = ''
this.createFrom = ''
} catch (error) {
console.log(error);
}
}
}
<!-- <ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
<p style="color: white">Please Wait. </p>
</ngx-spinner> -->
<h6 class="hed-color">Merge Branch</h6>
<div class="card">
<div class="card-body">
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Title</label>
<div class="col-sm-10">
<input type="text" class="form-control" [(ngModel)]="title" name="title">
</div>
</div>
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Description</label>
<div class="col-sm-10">
<textarea type="text" class="form-control" [(ngModel)]="desc" name="desc" rows="3"
placeholder=""></textarea>
</div>
</div>
<hr class="hed-color">
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Assignee</label>
<div class="col-sm-5">
<input type="text" class="form-control" [(ngModel)]="assigneeName" name="assigneeName">
</div>
</div>
<hr class="hed-color">
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Source Branch</label>
<div class="col-sm-5">
<input type="text" class="form-control" [(ngModel)]="sourceBranch" name="sourceBranch">
</div>
</div>
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Target Branch</label>
<div class="col-sm-5">
<input type="text" class="form-control" [(ngModel)]="targetBranch" name="targetBranch">
</div>
</div>
<div class="row row-pad">
<div class="col-md-8"></div>
<div class="col-md-4">
<button class="btn btn-primary" type="submit" style="float: right;"
(click)="mergeRequest()">Execute</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BulkMergeRequestComponent } from './bulk-merge-request.component';
describe('BulkMergeRequestComponent', () => {
let component: BulkMergeRequestComponent;
let fixture: ComponentFixture<BulkMergeRequestComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BulkMergeRequestComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(BulkMergeRequestComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { AppService } from '../app.service';
import { NgxSpinnerService } from 'ngx-spinner';
import { ToastrService } from 'ngx-toastr'
@Component({
selector: 'app-bulk-merge-request',
templateUrl: './bulk-merge-request.component.html',
styleUrls: ['./bulk-merge-request.component.css']
})
export class BulkMergeRequestComponent implements OnInit {
public assignees: any; branchesDetails: any; desc:any; title:any; assigneeName:any; sourceBranch:any;
targetBranch:any; mergeDetails:any;assignDetails:any;projectDetails:any;
constructor(private _appService: AppService, private _spinnerService: NgxSpinnerService, public toastr: ToastrService) { }
ngOnInit(): void {
this._appService.spinner();
this.projectData();
}
projectData(){
this._appService.getProjects().subscribe(data =>{
this.projectDetails = data;
})
}
mergeRequest(){
this._spinnerService.show();
for(let i=0; i<this.projectDetails.length; i++){
this._appService.addRequest(this.title,this.desc,this.assigneeName,this.sourceBranch,this.targetBranch,this.projectDetails[i]['id']).subscribe(data =>{
console.log(data);
setTimeout(() => {
this._spinnerService.hide();
}, 500);
this.toastr.success('Merge Request Done Successfully', 'Merge Request', {
timeOut: 3000,
});
})
}
this.clearData();
}
clearData() {
try {
this.title = ''
this.desc = ''
this.assigneeName = ''
this.sourceBranch = ''
this.targetBranch = ''
} catch (error) {
console.log(error);
}
}
}
<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
<p style="color: white">Please Wait. </p>
</ngx-spinner>
<h6 class="hed-color">Tag Branch</h6>
<div class="card">
<div class="card-body">
<div class="form-group row row-pad">
<label for="inputPassword" class="col-sm-2 col-form-label hed-color">Tag Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="tag_name" [(ngModel)]="tag_name" name="tag_name"
placeholder="">
</div>
</div>
<div class="form-group row row-pad">
<label for="inputPassword" class="col-sm-2 col-form-label hed-color">Create From</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="tag_name" [(ngModel)]="tag_from" name="tag_from"
placeholder="">
</div>
</div>
<div class="form-group row row-pad">
<label for="inputPassword" class="col-sm-2 col-form-label hed-color">Message</label>
<div class="col-sm-10">
<textarea type="text" class="form-control" id="message" [(ngModel)]="message" name="message" rows="5"
placeholder=""></textarea>
</div>
</div>
<div class="row row-pad">
<div class="col-md-8"></div>
<div class="col-md-4">
<button class="btn btn-primary" type="submit" style="float: right;"
(click)="saveTag()">Execute</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { BulkTagComponent } from './bulk-tag.component';
describe('BulkTagComponent', () => {
let component: BulkTagComponent;
let fixture: ComponentFixture<BulkTagComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ BulkTagComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(BulkTagComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input, OnInit } from '@angular/core';
import { AppService } from '../app.service';
import { NgxSpinnerService } from 'ngx-spinner';
import { ToastrService } from 'ngx-toastr'
@Component({
selector: 'app-bulk-tag',
templateUrl: './bulk-tag.component.html',
styleUrls: ['./bulk-tag.component.css']
})
export class BulkTagComponent implements OnInit {
projectDetails : any; tag_name:any;tag_from:any;branchName:any; message:any; release:any; branchData: any; tagsDetails:any; results:any; tagDetails:any;tagName:any;
tagData:any;
constructor(private _appService: AppService, private _spinnerService: NgxSpinnerService, public toastr: ToastrService) { }
ngOnInit(): void {
this._appService.spinner();
this.projectData();
}
projectData(){
this._appService.getProjects().subscribe(data =>{
this.projectDetails = data;
})
}
saveTag(){
this._spinnerService.show();
for(let i=0; i<this.projectDetails.length; i++){
this._appService.addTag(this.tag_name,this.tag_from,this.message,this.projectDetails[i]['id']).subscribe(data =>{
console.log(data);
setTimeout(() => {
this._spinnerService.hide();
}, 500);
this.toastr.success('Tags Created Successfully', 'Tag', {
timeOut: 3000,
});
})
}
this.clearData();
}
clearData() {
try {
this.tag_name = ''
this.tag_from = ''
this.message = ''
} catch (error) {
console.log(error);
}
}
}
<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
<p style="color: white">Please Wait. </p>
</ngx-spinner>
<h6 class="hed-color">New Branch</h6>
<div class="card">
<div class="card-body">
<div class="form-group row row-pad">
<label for="name" class="col-sm-2 col-form-label hed-color">Branch Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="name" [(ngModel)]="name" name="name" placeholder="">
</div>
</div>
<div class="form-group row row-pad">
<label for="inputPassword" class="col-sm-2 col-form-label hed-color">Create From</label>
<div class="col-sm-10">
<ng-select [(ngModel)]="branchName" name="branchName">
<ng-option *ngFor="let branch of branchesDetails;" id="branchName" [value]="branch.name">{{branch.name}}
<div class="row">
<div class="col-md-12">
<ng-container *ngIf="bulkData">
<app-bulk-create-branch [branchesData]="branch.name"></app-bulk-create-branch>
</ng-container>
</div>
</div>
</ng-option>
<ng-option *ngFor="let tag of tagsDetails;" id="tagName" [value]="tag.name">{{tag.name}}
</ng-option>
</ng-select>
</div>
</div>
<div class="row row-pad">
<div class="col-md-8"></div>
<div class="col-md-4">
<button class="btn btn-primary" type="submit" style="float: right;"
(click)="saveBranch(name,'branch.name')">Execute</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CreateBranchComponent } from './create-branch.component';
describe('CreateBranchComponent', () => {
let component: CreateBranchComponent;
let fixture: ComponentFixture<CreateBranchComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CreateBranchComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(CreateBranchComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit, Input } from '@angular/core';
import { NgForm } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { NgxSpinnerService } from 'ngx-spinner';
import { AppService } from '../app.service';
import {ToastrService} from 'ngx-toastr'
@Component({
selector: 'app-create-branch',
templateUrl: './create-branch.component.html',
styleUrls: ['./create-branch.component.css']
})
export class CreateBranchComponent implements OnInit {
public projects: any;
branchName: any; branchesDetails: any; value: any; id: any; name: any; name1: any; dropdowndata: any; group: any;
branchdata: any; addDetails: any;tagsDetails:any;bulkData = false;branchesData: any;tagsData:any;finalDetails:any;
constructor(private _appService: AppService, private _route: ActivatedRoute, private _spinnerService: NgxSpinnerService,
public toastr: ToastrService) { }
@Input() projectId;
ngOnInit(): void {
this._appService.spinner();
this.groupbranchData(this.projectId);
this.grouptagData(this.projectId);
}
groupbranchData(projectId) {
this._appService.getBranches(projectId).subscribe(
data => {
this.branchesDetails = data;
for(var i=0; i<this.branchesDetails.length; i++){
this.branchesData = this.branchesDetails[i].name;
}
}
)
}
grouptagData(projectId) {
this._appService.getTag(projectId).subscribe(
data => {
this.tagsDetails = data;
for(var i=0;i<this.tagsDetails.length; i++){
this.tagsData = this.tagsDetails[i].name;
}
}
)
}
saveBranch(name, branchName) {
this._spinnerService.show();
this.name1 = this.name;
this.branchdata = this.branchName;
this.projectId = this.projectId;
this._appService.addBranch(this.name1, this.branchdata, this.projectId).subscribe(data => {
this.addDetails = data;
setTimeout(() => {
this._spinnerService.hide();
}, 500);
this.toastr.success('Branch Created Successfully', 'Branch', {
timeOut: 3000,
});
})
this.clearData();
// this.groupbranchData(this.projectId);
// this.grouptagData(this.projectId);
}
clearData() {
try {
this.name = ''
this.branchName = ''
} catch (error) {
console.log(error);
}
}
}
<!-- Footer -->
<footer class="page-footer font-small footer" style="background: #2972DC;padding-top: .1rem;padding-bottom: .1rem;">
<div class="footer-copyright text-center py-1">© 2021 Copyright:
<a href="https://knowledgelens.com/" style="color: #fff;"> KnowledgeLens.com</a>
</div>
</footer>
<!-- Footer -->
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FooterComponent } from './footer.component';
describe('FooterComponent', () => {
let component: FooterComponent;
let fixture: ComponentFixture<FooterComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ FooterComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(FooterComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-footer',
templateUrl: './footer.component.html',
styleUrls: ['./footer.component.css']
})
export class FooterComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
<!-- <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<a class="navbar-brand" href="#"><h5>{{name}}</h5></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a href="#" style="float: right;" src="images/DigitalPondlogo.png"></a>
</nav> -->
<nav class="navbar sticky-top navbar-light" style="background: #2972DC;padding-top: .1rem;padding-bottom: .1rem;">
<a class="navbar-brand logo" href="#" style="margin-left: 15px; color: white;"><label style="font-size: 2rem;;">{{firstName}}</label><label style="font-size: 1rem;;">{{lastName}}</label></a>
<div class="btn-group" style="margin-right: 2rem;">
<div class="">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
<img src="{{avatar_url}}" alt="Girl in a jacket" style="margin-right: 0.5rem;cursor: pointer; border-radius: 15px;" width="30" height="30">
</button>
<ul class="dropdown-menu dropdown-menu-lg-end">
<li><a class="dropdown-item" href="#">{{username}}</a></li>
<li><a class="dropdown-item" href="#">{{email}}</a></li>
</ul>
</div>
</div>
<!-- <i class="fa fa-twitter fa-5x"></i> -->
</nav>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HeaderComponent } from './header.component';
describe('HeaderComponent', () => {
let component: HeaderComponent;
let fixture: ComponentFixture<HeaderComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ HeaderComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(HeaderComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit } from '@angular/core';
import { AppService } from '../app.service';
@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.css']
})
export class HeaderComponent implements OnInit {
public firstName = "GITEX" ;users:any;username:any;email:any;avatar_url:any;
public lastName ="101"
constructor(private _appService: AppService) { }
ngOnInit(): void {
this.userName();
}
userName(){
this._appService.getUserName().subscribe(data =>{
debugger
this.users = data;
console.log(this.users);
this.username = this.users.name;
this.email = this.users.email;
this.avatar_url = this.users.avatar_url
})
}
}
<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
<p style="color: white">Please Wait. </p>
</ngx-spinner>
<h6 class="hed-color">Merge Branch</h6>
<div class="card">
<div class="card-body">
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Title</label>
<div class="col-sm-10">
<input type="text" class="form-control" [(ngModel)]="title" name="title">
</div>
</div>
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Description</label>
<div class="col-sm-10">
<textarea type="text" class="form-control" [(ngModel)]="desc" name="desc" rows="3"
placeholder=""></textarea>
</div>
</div>
<hr class="hed-color">
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Assignee</label>
<div class="col-sm-5">
<ng-select [(ngModel)]="assigneeName" name="assigneeName">
<ng-option *ngFor="let assign of assignees;" id="assigneeName" [value]="assign.name">{{assign.name}}
</ng-option>
</ng-select>
</div>
</div>
<!-- <div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Milestone</label>
<div class="col-sm-5">
<select name="cars" id="cars" class="form-control" disabled>
<option value="">--Select--</option>
<option value="Master">No Milestone</option>
<option value="Devlopment">Create</option>
</select>
</div>
</div>
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Labels</label>
<div class="col-sm-5">
<select name="cars" id="cars" class="form-control" disabled>
<option value="">--Select--</option>
<option value="Master">No Label</option>
<option value="Devlopment">Create Label</option>
</select>
</div>
</div> -->
<hr class="hed-color">
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Source Branch</label>
<div class="col-sm-5">
<ng-select [(ngModel)]="sourceBranch" name="sourceBranch">
<ng-option *ngFor="let source of branchesDetails;" id="sourceBranch" [value]="source.name">
{{source.name}}
</ng-option>
</ng-select>
</div>
</div>
<div class="form-group row row-pad">
<label for="input" class="col-sm-2 col-form-label hed-color">Target Branch</label>
<div class="col-sm-5">
<ng-select [(ngModel)]="targetBranch" name="targetBranch">
<ng-option *ngFor="let target of branchesDetails;" id="targetBranch" [value]="target.name">
{{target.name}}
</ng-option>
</ng-select>
</div>
</div>
<div class="row row-pad">
<div class="col-md-8"></div>
<div class="col-md-4">
<button class="btn btn-primary" type="submit" style="float: right;"
(click)="mergeRequest(title,desc,'source.name','target.name')">Execute</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MergeRequestComponent } from './merge-request.component';
describe('MergeBranchComponent', () => {
let component: MergeRequestComponent;
let fixture: ComponentFixture<MergeRequestComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ MergeRequestComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(MergeRequestComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, Input, OnInit } from '@angular/core';
import { NgxSpinnerService } from 'ngx-spinner';
import { ToastrService } from 'ngx-toastr';
import { AppService } from '../app.service';
@Component({
selector: 'app-merge-request',
templateUrl: './merge-request.component.html',
styleUrls: ['./merge-request.component.css']
})
export class MergeRequestComponent implements OnInit {
public assignees: any; branchesDetails: any; desc:any; title:any; assigneeName:any; sourceBranch:any; targetBranch:any; mergeDetails:any;assignDetails:any;
constructor(private _appService: AppService,private _spinnerService: NgxSpinnerService,
public toastr: ToastrService) { }
@Input() projectId;
ngOnInit(): void {
this._appService.spinner();
this.getAssigneeData();
this.getBranchData(this.projectId);
}
getAssigneeData() {
this._appService.getAssignees().subscribe(data => {
this.assignees = data;
this.assignDetails = this.assignees.name;
});
}
getBranchData(projectId) {
this._appService.getBranches(projectId).subscribe(data => {
this.branchesDetails = data;
});
}
mergeRequest(title,desc,sourceBranch,targetBranch){
this._spinnerService.show();
this.title = this.title;
this.desc = this.desc;
this.sourceBranch = this.sourceBranch;
this.targetBranch = this.targetBranch;
this._appService.addRequest(this.title,this.desc,this.assigneeName,this.sourceBranch,this.targetBranch,this.projectId).subscribe(data =>{
this.mergeDetails = data;
setTimeout(() => {
this._spinnerService.hide();
}, 500);
this.toastr.success('Merge Request Done Successfully', 'Merge Request', {
timeOut: 3000,
});
});
this.clearData();
}
clearData() {
try {
this.title = ''
this.desc = ''
this.sourceBranch = ''
this.targetBranch = ''
this.assigneeName = ''
} catch (error) {
console.log(error);
}
}
}
<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="default" type="ball-spin-clockwise">
<p style="color: white">Please Wait. </p>
</ngx-spinner>
<h6 class="hed-color">Tag Branch</h6>
<div class="card">
<div class="card-body">
<div class="form-group row row-pad">
<label for="inputPassword" class="col-sm-2 col-form-label hed-color">Tag Name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="tag_name" [(ngModel)]="tag_name" name="tag_name"
placeholder="">
</div>
</div>
<div class="form-group row row-pad">
<label for="inputPassword" class="col-sm-2 col-form-label hed-color">Create From</label>
<div class="col-sm-10">
<ng-select [(ngModel)]="branchName" name="branchName">
<ng-option *ngFor="let branch of branchesDetails" id="banchName" [value]="branch.name">
{{branch.name}}</ng-option>
<hr>
<ng-option *ngFor="let tag of tagsDetails;" id="tagName" [value]="tag.name">{{tag.name}}
</ng-option>
</ng-select>
</div>
</div>
<div class="form-group row row-pad">
<label for="inputPassword" class="col-sm-2 col-form-label hed-color">Message</label>
<div class="col-sm-10">
<textarea type="text" class="form-control" id="message" [(ngModel)]="message" name="message" rows="5"
placeholder=""></textarea>
</div>
</div>
<div class="row row-pad">
<div class="col-md-8"></div>
<div class="col-md-4">
<button class="btn btn-primary" type="submit" style="float: right;"
(click)="saveTag(tag_name,'branch.name','tag.name',message)">Execute</button>
</div>
</div>
</div>
</div>
\ No newline at end of file
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TagComponent } from './tag.component';
describe('TagComponent', () => {
let component: TagComponent;
let fixture: ComponentFixture<TagComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ TagComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(TagComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
import { Component, OnInit,Input } from '@angular/core';
import { NgxSpinnerService } from 'ngx-spinner';
import { ToastrService } from 'ngx-toastr';
import { AppService } from '../app.service';
@Component({
selector: 'app-tag',
templateUrl: './tag.component.html',
styleUrls: ['./tag.component.css']
})
export class TagComponent implements OnInit {
branchesDetails : any; tag_name:any;branchName:any; message:any; release:any; branchData: any; tagsDetails:any; results:any; tagDetails:any;tagName:any;
tagData:any;
constructor(private _appService: AppService,private _spinnerService: NgxSpinnerService,public toastr: ToastrService) { }
@Input() projectId;
ngOnInit(): void {
this._appService.spinner();
this.groupbranchData(this.projectId);
this.grouptagData(this.projectId);
}
groupbranchData(projectId) {
this._appService.getBranches(projectId).subscribe(
data => {
this.branchesDetails = data;
}
)
}
grouptagData(projectId) {
this._appService.getTag(projectId).subscribe(
data => {
this.tagsDetails = data;
}
)
}
saveTag(tag_name,branchName,tagName,message){
this._spinnerService.show();
this.branchData = this.branchName;
this.tagData = this.tagName;
// this.projectId = this.projectId;
this._appService.addTag(this.tag_name,this.branchData,this.message,this.projectId).subscribe(data =>{
this.tagDetails = data;
setTimeout(() => {
this._spinnerService.hide();
}, 500);
this.toastr.success('Tag Created Successfully', 'Tag', {
timeOut: 3000,
});
})
this.clearData();
}
clearData() {
try {
this.tag_name = ''
this.branchName = ''
this.message = ''
this.release = ''
} catch (error) {
console.log(error);
}
}
}
export const environment = {
production: true
};
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
export const environment = {
URL: "https://gitlab.knowledgelens.com/",
production: false
};
/*
* For easier debugging in development mode, you can import the following file
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
*
* This import should be commented out in production mode because it will have a negative impact
* on performance if an error is thrown.
*/
// import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
File added
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Demo</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<app-root></app-root>
</body>
</html>
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
*
* This file is divided into 2 sections:
* 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
* 2. Application imports. Files imported after ZoneJS that should be loaded before your main
* file.
*
* The current setup is for so-called "evergreen" browsers; the last versions of browsers that
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
*
* Learn more in https://angular.io/guide/browser-support
*/
/***************************************************************************************************
* BROWSER POLYFILLS
*/
/**
* IE11 requires the following for NgClass support on SVG elements
*/
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**
* Web Animations `@angular/platform-browser/animations`
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
*/
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
* user can disable parts of macroTask/DomEvents patch by setting following flags
* because those flags need to be set before `zone.js` being loaded, and webpack
* will put import in the top of bundle, so user need to create a separate file
* in this directory (for example: zone-flags.ts), and put the following flags
* into that file, and then add the following code before importing zone.js.
* import './zone-flags';
*
* The flags allowed in zone-flags.ts are listed here.
*
* The following flags will work for all browsers.
*
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
*
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
* with the following flag, it will bypass `zone.js` patch for IE/Edge
*
* (window as any).__Zone_enable_cross_context_check = true;
*
*/
/***************************************************************************************************
* Zone JS is required by default for Angular itself.
*/
import 'zone.js'; // Included with Angular CLI.
/***************************************************************************************************
* APPLICATION IMPORTS
*/
/* You can add global styles to this file, and also import other style files */
@import "~@ng-select/ng-select/themes/default.theme.css";
.headerpad
{
padding-top: 25px;
}
.row-pad
{
padding-top: 15px;
padding-bottom: 15px;
}
/* footer {
position: fixed;
height: 100px;
bottom: 0;
width: 100%;
} */
.footer {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: red;
color: white;
text-align: center;
}
.hed-color
{
color: #000000 !important;
}
/* .logo{
background-image: url(chrome://new-tab-page/icons/google_logo.svg);
} */
.lab_font{
font-weight: 600 !important;
}
\ No newline at end of file
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"types": []
},
"files": [
"src/main.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.d.ts"
]
}
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"noImplicitAny": false,
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2017",
"module": "es2020",
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine"
]
},
"files": [
"src/test.ts",
"src/polyfills.ts"
],
"include": [
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
Markdown is supported
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