Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cassiopee/nghyd
1 result
Show changes
Commits on Source (10)
......@@ -11,6 +11,7 @@
# dependencies
/node_modules
/src/date_revision.ts
/ngsw-config.json
# IDEs and editors
/.idea
......
......@@ -91,7 +91,7 @@ build:
paths:
- dist/
script:
- npm run build -- --base-href=/cassiopee/$CI_COMMIT_REF_NAME/
- npm run build
clean-stale-branches:
stage: clean-stale-branches
......
......@@ -354,7 +354,8 @@ export class CalculatorPage {
// for "var" mode, close the modal
if (mode === "var") {
await browser.sleep(500); // wait for the modal to appear
await element(by.css("dialog-edit-param-values .mat-dialog-actions button")).click();
//await element(by.css("dialog-edit-param-values .mat-dialog-actions button")).click(); // clique "annuler" et non "valider" :
await element(by.css("dialog-edit-param-values .mat-dialog-actions button.mat-warn")).click();
await browser.sleep(500); // wait for the navbar to reappear after modal dismissal
}
}
......
......@@ -137,7 +137,7 @@ describe("ngHyd − save and load sessions", () => {
expect(fileContent).toContain(`{"symbol":"Ks","mode":"SINGLE","value":42}`);
});
it("select value must be recovered when loading a session file", async () => {
xit("select value must be recovered when loading a session file", async () => {
// start page
await startPage.navigateTo();
await browser.sleep(200);
......
File moved
......@@ -17,7 +17,7 @@
"mkdocs": "bash scripts/prepare_mkdocs.sh; cd build; python3 -m mkdocs build -f mkdocs-fr.yml && python3 -m mkdocs build -f mkdocs-en.yml && cd .. && node scripts/mkdocs-postprocess.js",
"mkdocs2pdf": "node scripts/extract-nghyd-version.js build/cassiopee_version.tex && python3 scripts/mkdocs2pdf.py && node scripts/mkdocs2pdf-postprocess.js",
"clean": "rm -rf build dist release src/date_revision.ts src/assets/docs",
"preprocess": "mkdir -p build; node scripts/preprocessors.js",
"preprocess": "mkdir -p build; node scripts/preprocessors.js; npm run service-worker-version",
"start": "npm run preprocess && npm run mkdocs && npm run ng serve -- --host 0.0.0.0 --poll 5000",
"build-no-pdf": "npm run preprocess && npm run mkdocs && npm run ng build -- --configuration production",
"build": "npm run preprocess && npm run mkdocs && npm run ng build -- --configuration production && npm run mkdocs2pdf",
......@@ -32,8 +32,9 @@
"release-all": "node scripts/clean_release.js && npm run build-no-pdf && npm run update-dist-index-mimetypes && \"node_modules/.bin/electron-builder\" && \"node_modules/.bin/electron-builder\" --mac && \"node_modules/.bin/electron-builder\" --win",
"compodoc": "node \"node_modules/@compodoc/compodoc/bin/index-cli.js\" -p src/tsconfig.app.json -s --language fr-FR -d compodoc-fr",
"viz": "tsviz -recursive src/ nghyd_class_diagram.png",
"webapp-nocompile" : "\"node_modules/.bin/http-server\" dist",
"webapp" : "npm run build-no-pdf && npm run webapp-nocompile"
"webapp-nocompile": "\"node_modules/.bin/http-server\" dist",
"webapp": "npm run build-no-pdf && npm run webapp-nocompile",
"service-worker-version": "./scripts/update-service-worker-config.sh"
},
"private": true,
"dependencies": {
......
......@@ -19,6 +19,9 @@ then
exit 1
fi
# Angular service worker configuration file
NGSW_CONF=ngsw-config.json
# 0. changelog
read -p "Avez-vous rempli jalhyd_branch, et les CHANGELOG de JaLHyd et NgHyd pour la version $VERSION ? (o/N) " -n 1 -r
echo
......@@ -28,8 +31,8 @@ then
exit 2
fi
if [[ ! -f ngsw-config.json ]]; then
echo "Fichier de configuration du service worker ngsw-config.json non trouvé" >&2
if [[ ! -f $NGSW_CONF ]]; then
echo "Fichier de configuration du service worker $NGSW_CONF non trouvé" >&2
exit 1
fi
......@@ -73,11 +76,7 @@ git push --tags --force
echo "BUILDING NGHYD"
cd ..
# 2.1 service worker configuration (application version)
sed -i "/\"version\": \"/s/\": \".*/\": \"$VERSION\"/" ngsw-config.json
# 2.2 update Git repository
# 2.1 update Git repository
git checkout master
git pull --rebase
npm install
......@@ -87,7 +86,7 @@ then
git commit -a -m "verify dependencies (npm install) before deploying version $VERSION"
fi
# 2.3 version in package.*
# 2.2 version in package.*
npm version "$VERSION" --allow-same-version --git-tag-version=false
if [ ! -z "$(git status --untracked-files=no --porcelain)" ]
then
......@@ -95,13 +94,13 @@ then
git commit -a -m "update package.* to version $VERSION"
fi
# 2.4 tags
# 2.3 tags
echo "setting tags to $VERSION version"
git tag -fa stable -m "stable version"
sleep 1
git tag -fa "$VERSION" -m "release version $VERSION"
# 2.5 push code, push tags
# 2.4 push code, push tags
git push
git push --tags --force
......
......@@ -15,19 +15,43 @@ LOGIN="$2"
HOST="$3"
DIR="$4"
LOCAL_DIR=dist
function display_local_href()
{
echo "base href in local index.html :"
grep "\<base" $LOCAL_DIR/index.html
}
function display_remote_href()
{
local dir=$1
echo "base href in deployed index.html (host=$HOST) :"
ssh $LOGIN@$HOST "grep \<base $dir/index.html"
}
echo "$(basename $0): deploying version $VERSION in $LOGIN@$HOST:$DIR"
if [[ $VERSION == "prod" || $VERSION == "prod-devel" ]]; then
display_local_href
# Modification du dossier base href -> /
echo "updating index.html base href to /"
sed -i '/<base/s/href="[^"]*"/href="\/"/' $LOCAL_DIR/index.html
# Copie de la branche production
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" dist/ ${LOGIN}@${HOST}:${DIR}/
# Modification du dossier base href
echo "updating index.html"
if [[ $VERSION == "prod" ]]; then
ssh $LOGIN@$HOST "sed -i 's:/cassiopee/stable/:/:g' $DIR/index.html"
else
ssh $LOGIN@$HOST "sed -i 's:/cassiopee/devel/:/:g' $DIR/index.html"
fi
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" $LOCAL_DIR/ ${LOGIN}@${HOST}:${DIR}/
display_remote_href $DIR
else
display_local_href
# Modification du dossier base href -> /cassiopee/version/
echo "updating index.html base href to /cassiopee/$VERSION/"
sed -i "/<base/s/href=\"[^\"]*\"/href=\"\/cassiopee\/$VERSION\/\"/" $LOCAL_DIR/index.html
# Copie de la branche / du tag
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" "dist/" "$LOGIN@$HOST:$DIR/$VERSION"
rsync -a --delete --exclude=cassiopee-releases -e "ssh -o StrictHostKeyChecking=no" $LOCAL_DIR/ "$LOGIN@$HOST:$DIR/$VERSION"
display_remote_href $DIR/$VERSION
fi
#!/bin/bash
# update ngsw-config.json from template and "git describe" output
# error on unset variables
set -o nounset
# exit on error
set -o errexit
# Angular service worker configuration file
NGSW_CONF=ngsw-config.json
# Angular service worker configuration template
NGSW_CONF_TMPL=ngsw-config-template.json
echo "updating version in Angular service worker configuration" >&2
VERSION=$(git describe)
cp $NGSW_CONF_TMPL $NGSW_CONF
sed -i "/\"version\": \"/s/\": \".*/\": \"$VERSION\"/" $NGSW_CONF
# check
if [[ -z $(grep version $NGSW_CONF | grep $VERSION) ]]; then
echo "error updating version in service worker configuration file $NGSW_CONF" >&2
exit 1
fi
......@@ -10,6 +10,7 @@ import { NgParameter } from "../../formulaire/elements/ngparam";
import { capitalize, Result, ResultElement } from "jalhyd";
import { sprintf } from "sprintf-js";
import { PressureLoss } from "jalhyd";
@Component({
selector: "fixed-results",
......@@ -256,10 +257,20 @@ export class FixedResultsComponent extends ResultsComponentDirective {
if (sn.parent) {
ct = sn.parent.calcType;
}
const cn = capitalize(this.intlService.childName(c));
let label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn)
+ (c.findPositionInParent() + 1) + " : "
+ this.formService.expandVariableNameAndUnit(ct, k);
// do not display child rank in case of pressure loss law
const displayChildRank = !(sn instanceof PressureLoss);
let label: string;
if (displayChildRank) {
const cn = capitalize(this.intlService.childName(c));
label = sprintf(this.intlService.localizeText("INFO_STUFF_N"), cn) + (c.findPositionInParent() + 1);
}
else {
label = capitalize(this.intlService.childName(c));
}
label += " : ";
label += this.formService.expandVariableNameAndUnit(ct, k);
label += this._fixedResults.getHelpLink(k);
data.push({
label: label,
......
......@@ -11,49 +11,49 @@
"src": "assets/icons/favicon-72x72.png",
"sizes": "72x72",
"type": "image/png",
"purpose": "maskable any"
"purpose": "any"
},
{
"src": "assets/icons/favicon-96x96.png",
"sizes": "96x96",
"type": "image/png",
"purpose": "maskable any"
"purpose": "any"
},
{
"src": "assets/icons/favicon-128x128.png",
"sizes": "128x128",
"type": "image/png",
"purpose": "maskable any"
"purpose": "any"
},
{
"src": "assets/icons/favicon-144x144.png",
"sizes": "144x144",
"type": "image/png",
"purpose": "maskable any"
"purpose": "any"
},
{
"src": "assets/icons/favicon-152x152.png",
"sizes": "152x152",
"type": "image/png",
"purpose": "maskable any"
"purpose": "any"
},
{
"src": "assets/icons/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable any"
"purpose": "any"
},
{
"src": "assets/icons/favicon-384x384.png",
"sizes": "384x384",
"type": "image/png",
"purpose": "maskable any"
"purpose": "any"
},
{
"src": "assets/icons/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable any"
"purpose": "any"
}
]
}