Skip to content

Commit e395c01

Browse files
authored
Fix problems with namespace view (#47)
* Fix problems with namespace view * Update migrator.service.ts
1 parent 428a7bd commit e395c01

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

core/libs/migrator/src/lib/migrator.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const prefixesToMigrate = {
2727

2828
const newUrn = 'urn:samm:org.eclipse.esmf.samm';
2929
// eslint-disable-next-line no-useless-escape
30-
const oldUrnRegex = /@prefix\s+(\w+-?\w+:)\s+<urn:samm:io.openmanufacturing:([\w-]+):([\d\.]+)#>/gim;
30+
const oldUrnRegex = /@prefix\s+(\w+-?\w+:)\s+<urn:bamm:io.openmanufacturing:([\w-]+):([\d\.]+)#>/gim;
3131

3232
@Injectable({
3333
providedIn: 'root',

core/libs/namespace-manager/src/lib/namespace-exporter/components/select-namespaces/select-namespaces.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ export class SelectNamespacesComponent implements OnInit {
7272
}
7373

7474
validate() {
75-
const validatePayload = this.selectedNamespaces.map(namespace => ({namespace, files: this.namespacesDependencies[namespace].files}));
75+
const namespaces = Array.from(new Set(this.selectedNamespaces));
76+
const validatePayload = namespaces.map(namespace => ({namespace, files: this.namespacesDependencies[namespace].files}));
7677
this.namespacesManager.validateExport(validatePayload).subscribe();
7778
this.router.navigate([{outlets: {'export-namespaces': 'validate'}}]);
7879
}

core/libs/namespace-manager/src/lib/namespace-importer/components/summary/summary.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class ImportSummaryComponent {
4040
const {replace, keep} = this.importSession.conflictFiles;
4141
const toOverwrite = Array.from(new Set([...keep, ...replace])).map(namespace => ({
4242
namespace,
43-
files: files.filter(file => file.startsWith(namespace)).map(file => file.replace(namespace, '')),
43+
files: files.filter(file => file.startsWith(namespace)).map(file => file.replace(`${namespace}:`, '')),
4444
}));
4545

4646
this.modelApiService.replaceFiles(toOverwrite).subscribe({

0 commit comments

Comments
 (0)