Skip to content

Commit

Permalink
Merge branch 'release/6.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
olliefreeman committed Sep 2, 2021
2 parents cc13ab4 + 682e28f commit 393efdb
Show file tree
Hide file tree
Showing 26 changed files with 363 additions and 239 deletions.
90 changes: 86 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,74 @@ pipeline {
}
}
}
post{
always{
recordIssues tools: [esLint(pattern: '**/eslint_report.xml')]
post {
always {
recordIssues qualityGates: [[threshold: 1, type: 'TOTAL', unstable: true]], tools: [esLint(pattern: '**/eslint_report.xml')]
}
}
}

stage('Distribution Build') {
steps {
nvm('') {
catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') {
sh 'npm run dist'
}
}
}
}

// Deploy develop branch even if tests fail if the code builds, as it'll be an unstable snapshot but we should still deploy
stage('Deploy develop to Artifactory') {
when {
branch 'develop'
}
steps {
rtUpload(
serverId: 'cs-artifactory',
spec: '''{
"files": [
{
"pattern": "dist/mdm-ui-*.tgz",
"target": "artifacts-snapshots/mauroDataMapper/mdm-ui/"
}
]
}''',
)
rtPublishBuildInfo(
serverId: 'cs-artifactory',
)
}
}

stage('Deploy main to Artifactory') {
when {
allOf {
branch 'main'
expression {
currentBuild.currentResult == 'SUCCESS'
}
}

}
steps {
rtUpload(
serverId: 'cs-artifactory',
spec: '''{
"files": [
{
"pattern": "dist/mdm-ui-*.tgz",
"target": "artifacts/mauroDataMapper/mdm-ui/"
}
]
}''',
)
rtPublishBuildInfo(
serverId: 'cs-artifactory',
)
}
}

stage('Sonarqube') {
when {
branch 'develop'
Expand All @@ -95,6 +156,28 @@ pipeline {
}
}
}

stage('Continuous Deployment') {
when {
allOf {
branch 'develop'
expression {
currentBuild.currentResult == 'SUCCESS'
}
}
}
steps {
script {
try {
println("Triggering the [continuous-deployment] job")
build quietPeriod: 300, wait: false, job: 'continuous-deployment'
} catch (hudson.AbortException ignored) {
println("Cannot trigger the [continuous-deployment] job as it doesn't exist")
}
}
}
}

}
post {
always {
Expand All @@ -108,7 +191,6 @@ pipeline {
reportTitles : 'Test'
])
outputTestResults()
slackNotification()
zulipNotification(topic: 'mdm-ui')
}
}
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mdm-ui",
"version": "6.5.0",
"version": "6.6.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
Expand All @@ -12,8 +12,8 @@
"test-watch": "jest --watch",
"test-clearCache": "jest --clearCache",
"lint": "ng lint",
"eslint": "tsc --noEmit && eslint . --ext ts --quiet --fix",
"eslint-nofix": "tsc --noEmit && eslint . --ext ts --quiet",
"eslint": "tsc --noEmit && eslint . --ext ts --fix",
"eslint-nofix": "tsc --noEmit && eslint . --ext ts",
"eslint-report": "eslint . --ext ts --format checkstyle -o eslint_report.xml",
"e2e": "ng e2e",
"postinstall": "ngcc",
Expand All @@ -38,7 +38,7 @@
"@bpmn-io/dmn-migrate": "^0.4.3",
"@ctrl/ngx-codemirror": "4.0.1",
"@fortawesome/fontawesome-free": "5.15.1",
"@maurodatamapper/mdm-resources": "git+https://github.com/MauroDataMapper/mdm-resources.git#4.9.0",
"@maurodatamapper/mdm-resources": "git+https://github.com/MauroDataMapper/mdm-resources.git#4.10.0",
"@uirouter/angular": "7.0.0",
"@uirouter/core": "6.0.6",
"@uirouter/rx": "0.6.5",
Expand Down
140 changes: 70 additions & 70 deletions src/app/admin/api-property/api-property.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,76 +87,6 @@ export class ApiPropertyComponent implements OnInit {
}
}

private createFormGroup() {
this.formGroup = new FormGroup({
key: new FormControl(this.property.metadata.key, [Validators.required]), // eslint-disable-line @typescript-eslint/unbound-method
category: new FormControl(this.property.metadata.category, [Validators.required]), // eslint-disable-line @typescript-eslint/unbound-method
publiclyVisible: new FormControl({ value: this.property.metadata.publiclyVisible, disabled: this.property.metadata.isSystem }),
value: new FormControl(this.property.original?.value, [Validators.required]) // eslint-disable-line @typescript-eslint/unbound-method
});
}

private getBlankMetadata() {
return {
key: '',
category: '',
publiclyVisible: false,
editType: ApiPropertyEditType.Value,
isSystem: false
};
}

private loadExistingProperty() {
this.resources.apiProperties
.get(this.id)
.pipe(
map((response: ApiPropertyResponse): ApiPropertyEditableState => {
const original = response.body;
const metadata = propertyMetadata.find(p => p.key === original.key) ?? {
key: original.key,
category: original.category,
isSystem: false,
publiclyVisible: original.publiclyVisible,
editType: ApiPropertyEditType.Value
};

return {
metadata,
original
};
}),
catchError(errors => {
this.messageHandler.showError('There was a problem getting the property.', errors);
return [];
})
)
.subscribe((data: ApiPropertyEditableState) => {
this.property = data;
this.createFormGroup();
});
}

private loadAvailableSystemProperties() {
this.resources.apiProperties
.list()
.pipe(
map((response: ApiPropertyIndexResponse) => {
return response.body.items;
}),
catchError(errors => {
this.messageHandler.showError('There was a problem getting the properties.', errors);
return [];
})
)
.subscribe((data: ApiProperty[]) => {
this.systemProperties = propertyMetadata.filter(m => data.every(p => p.key !== m.key));
this.property = {
metadata: this.getBlankMetadata()
};
this.createFormGroup();
});
}

systemPropertyChanged(change: MatSelectChange) {
if (change.value) {
this.property.metadata = propertyMetadata.find(m => m.key === change.value);
Expand Down Expand Up @@ -243,6 +173,76 @@ export class ApiPropertyComponent implements OnInit {
}
}

private createFormGroup() {
this.formGroup = new FormGroup({
key: new FormControl(this.property.metadata.key, [Validators.required]), // eslint-disable-line @typescript-eslint/unbound-method
category: new FormControl(this.property.metadata.category, [Validators.required]), // eslint-disable-line @typescript-eslint/unbound-method
publiclyVisible: new FormControl({ value: this.property.metadata.publiclyVisible, disabled: this.property.metadata.isSystem }),
value: new FormControl(this.property.original?.value, [Validators.required]) // eslint-disable-line @typescript-eslint/unbound-method
});
}

private getBlankMetadata() {
return {
key: '',
category: '',
publiclyVisible: false,
editType: ApiPropertyEditType.Value,
isSystem: false
};
}

private loadExistingProperty() {
this.resources.apiProperties
.get(this.id)
.pipe(
map((response: ApiPropertyResponse): ApiPropertyEditableState => {
const original = response.body;
const metadata = propertyMetadata.find(p => p.key === original.key) ?? {
key: original.key,
category: original.category,
isSystem: false,
publiclyVisible: original.publiclyVisible,
editType: ApiPropertyEditType.Value
};

return {
metadata,
original
};
}),
catchError(errors => {
this.messageHandler.showError('There was a problem getting the property.', errors);
return [];
})
)
.subscribe((data: ApiPropertyEditableState) => {
this.property = data;
this.createFormGroup();
});
}

private loadAvailableSystemProperties() {
this.resources.apiProperties
.list()
.pipe(
map((response: ApiPropertyIndexResponse) => {
return response.body.items;
}),
catchError(errors => {
this.messageHandler.showError('There was a problem getting the properties.', errors);
return [];
})
)
.subscribe((data: ApiProperty[]) => {
this.systemProperties = propertyMetadata.filter(m => data.every(p => p.key !== m.key));
this.property = {
metadata: this.getBlankMetadata()
};
this.createFormGroup();
});
}

private navigateToParent() {
this.editing.stop();
this.stateHandler.Go(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { MatSort, SortDirection } from '@angular/material/sort';
import { MatTableDataSource } from '@angular/material/table';
import { Title } from '@angular/platform-browser';
import { ModulesResponse, OpenIdConnectProvider, OpenIdConnectProvidersIndexResponse } from '@maurodatamapper/mdm-resources';
import { OpenIdConnectModuleName } from '@mdm/model/openid-connect.model';
import { openIdConnectModuleName } from '@mdm/model/openid-connect.model';
import { MdmResourcesService } from '@mdm/modules/resources';
import { GridService, MessageHandlerService, SharedService, StateHandlerService } from '@mdm/services';
import { MdmPaginatorComponent } from '@mdm/shared/mdm-paginator/mdm-paginator';
Expand Down Expand Up @@ -78,7 +78,7 @@ export class OpenidConnectProviderTableComponent implements OnInit, AfterViewIni
finalize(() => this.loading = false)
)
.subscribe((response: ModulesResponse) => {
this.moduleLoaded = response.body.findIndex(module => module.name === OpenIdConnectModuleName) !== -1;
this.moduleLoaded = response.body.findIndex(module => module.name === openIdConnectModuleName) !== -1;
if (this.moduleLoaded) {
this.initialise();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,6 @@ export class SubscribedCatalogueComponent implements OnInit {
});
}

private navigateToParent() {
this.editingService.stop();
this.stateHandler.Go('appContainer.adminArea.subscribedCatalogues');
}

validate() {
let isValid = true;
this.errors = {};
Expand All @@ -144,4 +139,9 @@ export class SubscribedCatalogueComponent implements OnInit {

return isValid;
}

private navigateToParent() {
this.editingService.stop();
this.stateHandler.Go('appContainer.adminArea.subscribedCatalogues');
}
}
Loading

0 comments on commit 393efdb

Please sign in to comment.