Skip to content

Commit

Permalink
updating main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
aAmitSengar committed Feb 21, 2022
1 parent f4d75be commit 178d3af
Show file tree
Hide file tree
Showing 705 changed files with 40,209 additions and 4,656 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN npm run compress:brotli
#RUN npm run compress:gzip

WORKDIR /app/dist
COPY assets/iGOT/client-assets/dist www/en/assets
RUN npm install --production
EXPOSE 3004

Expand Down
19 changes: 19 additions & 0 deletions Dockerfile.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:10

WORKDIR /app
COPY . .

#RUN npm i yarn
#RUN yarn global add @angular/cli@latest

RUN yarn && yarn add moment && yarn add vis-util && npm run build-benchmark --prod --build-optimizer
#RUN ng build --prod --outputPath=dist/www/en --baseHref=/ --i18nLocale=en --verbose=true
RUN npm run compress:brotli
#RUN npm run compress:gzip

WORKDIR /app/dist
RUN npm install --production
EXPOSE 3024

CMD [ "npm", "run", "serve:prod" ]

18 changes: 18 additions & 0 deletions Dockerfile.np
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:10

WORKDIR /app
COPY . .

#RUN npm i yarn
#RUN yarn global add @angular/cli@latest

RUN yarn && yarn add moment && yarn add vis-util && npm run build-np --prod --build-optimizer
#RUN ng build --prod --outputPath=dist/www/en --baseHref=/ --i18nLocale=en --verbose=true
RUN npm run compress:brotli
#RUN npm run compress:gzip

WORKDIR /app/dist
RUN npm install --production
EXPOSE 3004

CMD [ "npm", "run", "serve:prod" ]
11 changes: 6 additions & 5 deletions Jenkinsfile-sun
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,20 @@ node('build-slave') {
build_tag = sh(script: "echo " + params.github_release_tag.split('/')[-1] + "_" + commit_hash + "_" + env.BUILD_NUMBER, returnStdout: true).trim()
echo "build_tag: " + build_tag

stage('assets-pull') {
stage('assets-pull') {

dir("${env.WORKSPACE}/assets") {
checkout scm: [$class: 'GitSCM', branches: [[name: assets_repo_branch]], extensions: [[$class: 'CloneOption', depth: 1, noTags: true, reference: '', shallow: true]], userRemoteConfigs: [[credentialsId: asset_repo_credentials, url: assets_repo_url]]]
sh('mv client-assets/assets/configurations/cbc_3000 client-assets/assets/configurations/cbc.igot-dev.in')
}
}
sh('cd iGOT/client-assets && docker build -t assets . && docker run --name assets assets && docker cp assets:/usr/src/app/dist.zip . && docker rm -f assets && docker rmi -f assets && unzip dist.zip')
}
}

stage('Build') {
// Docker build
env.NODE_ENV = "build"
print "Environment will be : ${env.NODE_ENV}"
sh('chmod 777 build.sh')
sh("bash -x build.sh ${build_tag} ${env.NODE_NAME} ${docker_server}")
sh("bash -x build.sh ${build_tag} ${env.NODE_NAME} ${hub_org}")
}


Expand Down
136 changes: 58 additions & 78 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"assets": [
"src/favicon.ico",
"src/favicon.png",
"src/fusion-assets",
"src/fusion-assets/icons/",
"src/fusion-assets/images/",
"src/dashboard-assets/",
{
"glob": "**/*.*",
"input": "./node_modules/@sunbird-cb/discussions-ui-v8/assets",
Expand All @@ -41,46 +43,6 @@
"src/styles/mat-typography.scss",
"src/styles/styles.scss",
"node_modules/shepherd.js/dist/css/shepherd.css",
{
"input": "src/themes/theme-deep-purple.scss",
"bundleName": "theme-deep-purple",
"lazy": true
},
{
"input": "src/themes/theme-grey.scss",
"bundleName": "theme-grey",
"lazy": true
},
{
"input": "src/themes/theme-indigo.scss",
"bundleName": "theme-indigo",
"lazy": true
},
{
"input": "src/themes/theme-lite-blue.scss",
"bundleName": "theme-lite-blue",
"lazy": true
},
{
"input": "src/themes/theme-orange.scss",
"bundleName": "theme-orange",
"lazy": true
},
{
"input": "src/themes/theme-teal.scss",
"bundleName": "theme-teal",
"lazy": true
},
{
"input": "src/themes/theme-blue.scss",
"bundleName": "theme-blue",
"lazy": true
},
{
"input": "src/themes/theme-deep-blue.scss",
"bundleName": "theme-deep-blue",
"lazy": true
},
{
"input": "src/themes/theme-igot.scss",
"bundleName": "theme-igot",
Expand All @@ -89,11 +51,12 @@
"node_modules/pdfjs-dist/web/pdf_viewer.css",
"src/fusion-assets/fonts/lato/stylesheet.css",
"src/fusion-assets/fonts/montserrat/stylesheet.css",
"node_modules/@sunbird-cb/discussions-ui-v8/assets/styles/global.scss"
"node_modules/@sunbird-cb/discussions-ui-v8/assets/styles/global.scss",
"src/dashboard-assets/fonts/lato/stylesheet.css",
"src/dashboard-assets/fonts/montserrat/stylesheet.css"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"src/fusion-assets/telemetry.min.js",
"node_modules/shepherd.js/dist/js/shepherd.min.js",
"node_modules/@project-sunbird/telemetry-sdk/index.js"
]
Expand Down Expand Up @@ -122,6 +85,32 @@
"maximumError": "15mb"
}
],
"serviceWorker": true,
"ngswConfigPath": "ngsw-config.json"
},
"np": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.np.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "4mb",
"maximumError": "15mb"
}
],
"serviceWorker": false,
"ngswConfigPath": "ngsw-config.json"
},
Expand Down Expand Up @@ -176,6 +165,32 @@
],
"serviceWorker": false,
"ngswConfigPath": "ngsw-config.json"
},
"benchmark": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.bm.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "5mb",
"maximumError": "20mb"
}
],
"serviceWorker": false,
"ngswConfigPath": "ngsw-config.json"
}
}
},
Expand Down Expand Up @@ -319,41 +334,6 @@
}
}
},
"@ws/admin": {
"projectType": "library",
"root": "project/ws/admin",
"sourceRoot": "project/ws/admin/src",
"prefix": "ws-admin",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "project/ws/admin/tsconfig.lib.json",
"project": "project/ws/admin/ng-package.json"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "project/ws/admin/src/test.ts",
"tsConfig": "project/ws/admin/tsconfig.spec.json",
"karmaConfig": "project/ws/admin/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"project/ws/admin/tsconfig.lib.json",
"project/ws/admin/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"@ws/analytics": {
"projectType": "library",
"root": "project/ws/analytics",
Expand Down
4 changes: 3 additions & 1 deletion browserslist
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@
# not dead
# not IE 9-11 # For IE 9-11 support, remove 'not'.

last 2 Chrome versions
last 2 Chrome major versions
last 2 iOS major versions
last 2 Safari major versions
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ name='ui-static'
node=$2
org=$3

docker build -f ${dockerfile} --label commitHash=$(git rev-parse --short HEAD) -t ${org}/${name}:${build_tag} .
docker build -f Dockerfile --label commitHash=$(git rev-parse --short HEAD) -t ${org}/${name}:${build_tag} .
echo {\"image_name\" : \"${name}\", \"image_tag\" : \"${build_tag}\", \"node_name\" : \"$node\"} > metadata.json
12 changes: 8 additions & 4 deletions dist/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@ var app = express()
var proxy = httpProxy.createProxyServer({
timeout: 10000,
})
app.use(timeout('100s'))

app.use('/healthcheck', healthcheck({
healthy() {
return { everything: 'is ok' }
},
}))
app.use(timeout('100s'))

// Add required helmet configurations
app.use(
helmet({
Expand Down Expand Up @@ -62,7 +64,8 @@ serveAssets('/ja')
function serveAssets(hostPath) {
app.use(
`${hostPath}/assets`,
proxyCreator(express.Router(), CONSTANTS.WEB_HOST_PROXY + '/web-hosted/client-assets/dist'),
// proxyCreator(express.Router(), CONSTANTS.WEB_HOST_PROXY + '/web-hosted/client-assets/dist'),
express.static(path.join(__dirname, `${hostPath}`, `assets`)) // "public" off of current is root
)
}

Expand Down Expand Up @@ -101,7 +104,8 @@ function uiHostCreator(hostPath, hostFolderName) {
)
app.get(`${hostPath}/*`, (req, res) => {
if (req.url.startsWith('/assets/')) {
res.status(404).send('requested asset is not available')
res.sendFile(path.join(__dirname, `www/${hostFolderName}/${req.url}`))
// res.status(404).send('requested asset is not available')
} else {
res.sendFile(path.join(__dirname, `www/${hostFolderName}/index.html`))
}
Expand All @@ -110,4 +114,4 @@ function uiHostCreator(hostPath, hostFolderName) {

function haltOnTimedOut(req, _res, next) {
if (!req.timedout) next()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Component, OnInit, Input } from '@angular/core'
styleUrls: ['./avatar-photo.component.scss'],
})
export class AvatarPhotoComponent implements OnInit {
@Input() datalen: any

@Input()
public photoUrl!: string
Expand Down Expand Up @@ -45,6 +46,11 @@ export class AvatarPhotoComponent implements OnInit {
if (!this.initials) {
this.createInititals()
}
if (this.datalen === 1) {
this.randomcolors = [
'#006400', // green
]
}
const randomIndex = Math.floor(Math.random() * Math.floor(this.colors.length))
this.circleColor = this.colors[randomIndex]
if (this.randomColor) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<mat-card class="no-shadow">
<button mat-icon-button class="close-button" [mat-dialog-close]="true">
<mat-icon class="close-icon" color="warn">close</mat-icon>
</button>
<mat-card-title>
<span i18n>Download Certificate</span>
</mat-card-title>
<mat-card-content>
<img [src]="url| pipeSafeSanitizer: 'url'" alt="Certificate" role="image" class="certificate-banner-image">
</mat-card-content>
<mat-card-actions class="flex flex-row-reverse">
<a mat-button (click)='dwonloadCert()' class="ws-mat-accent-border-active mat-accent">
<mat-icon class="mat-icon material-icons-outlined download_icon margin-right-xs">cloud_download</mat-icon>
Download
</a>
</mat-card-actions>
</mat-card>
Loading

0 comments on commit 178d3af

Please sign in to comment.