From 728998bc1fe95eba7613a8cd44e2115a4acc788f Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 14 Feb 2025 12:56:03 +0100 Subject: [PATCH 1/7] Add two get endpoints --- .../Controllers/DatamodelsController.cs | 48 ++++++++++++++++--- .../GitRepository/AltinnAppGitRepository.cs | 15 +++++- .../Implementation/SchemaModelService.cs | 12 ++++- .../Interfaces/ISchemaModelService.cs | 12 ++++- .../AltinnAppGitRepositoryTests.cs | 12 ++--- .../Services/SchemaModelServiceTests.cs | 12 ++--- frontend/packages/shared/src/api/paths.js | 4 +- 7 files changed, 90 insertions(+), 25 deletions(-) diff --git a/backend/src/Designer/Controllers/DatamodelsController.cs b/backend/src/Designer/Controllers/DatamodelsController.cs index e6b0f444456..28ef54f12a6 100644 --- a/backend/src/Designer/Controllers/DatamodelsController.cs +++ b/backend/src/Designer/Controllers/DatamodelsController.cs @@ -120,12 +120,12 @@ public async Task Delete(string org, string repository, [FromQuer [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status302Found)] - [Route("all-json")] - public ActionResult> GetDataModels(string org, string repository) + [Route("org/all-json")] + public ActionResult> GetAllJsonDataModels(string org, string repository) { var developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); var editingContext = AltinnRepoEditingContext.FromOrgRepoDeveloper(org, repository, developer); - var schemaFiles = _schemaModelService.GetSchemaFiles(editingContext); + var schemaFiles = _schemaModelService.GetAllSchemaFiles(editingContext); return Ok(schemaFiles); } @@ -138,12 +138,48 @@ public ActionResult> GetDataModels(string org, strin [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status302Found)] - [Route("all-xsd")] - public ActionResult> GetXSDDataModels(string org, string repository) + [Route("org/all-xsd")] + public ActionResult> GetAllXsdDataModels(string org, string repository) { string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); var editingContext = AltinnRepoEditingContext.FromOrgRepoDeveloper(org, repository, developer); - IList schemaFiles = _schemaModelService.GetSchemaFiles(editingContext, true); + IList schemaFiles = _schemaModelService.GetAllSchemaFiles(editingContext, true); + + return Ok(schemaFiles); + } + + /// + /// Method that returns all JSON schema data models within App/models. + /// + /// the org owning the models repo + /// the model repos + [HttpGet] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status302Found)] + [Route("app-json")] + public ActionResult> GetAppJsonDataModels(string org, string repository) + { + var developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); + var editingContext = AltinnRepoEditingContext.FromOrgRepoDeveloper(org, repository, developer); + var schemaFiles = _schemaModelService.GetAppSchemaFiles(editingContext); + + return Ok(schemaFiles); + } + + /// + /// Method that returns all xsd models within App/models. + /// + /// the org owning the models repo + /// the model repos + [HttpGet] + [ProducesResponseType(StatusCodes.Status200OK)] + [ProducesResponseType(StatusCodes.Status302Found)] + [Route("app-xsd")] + public ActionResult> GetAppXsdDataModels(string org, string repository) + { + string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); + var editingContext = AltinnRepoEditingContext.FromOrgRepoDeveloper(org, repository, developer); + IList schemaFiles = _schemaModelService.GetAppSchemaFiles(editingContext, true); return Ok(schemaFiles); } diff --git a/backend/src/Designer/Infrastructure/GitRepository/AltinnAppGitRepository.cs b/backend/src/Designer/Infrastructure/GitRepository/AltinnAppGitRepository.cs index b22ae0e210c..56625ff06c6 100644 --- a/backend/src/Designer/Infrastructure/GitRepository/AltinnAppGitRepository.cs +++ b/backend/src/Designer/Infrastructure/GitRepository/AltinnAppGitRepository.cs @@ -977,10 +977,23 @@ public List GetAllImageFileNames() return allFilePaths; } + /// + /// Finds all schema files in repository. + /// + public IList GetAllSchemaFiles(bool xsd = false) + { + string schemaFilesPattern = xsd ? SchemaFilePatternXsd : SchemaFilePatternJson; + + var schemaFiles = FindFiles(new[] { schemaFilesPattern }); + var altinnCoreSchemaFiles = MapFilesToAltinnCoreFiles(schemaFiles); + + return altinnCoreSchemaFiles; + } + /// /// Finds all schema files in App/models directory. /// - public IList GetSchemaFiles(bool xsd = false) + public IList GetAppSchemaFiles(bool xsd = false) { string schemaFilesPattern = xsd ? SchemaFilePatternXsd : SchemaFilePatternJson; string schemaFilesPath = Path.Combine(ModelFolderPath, schemaFilesPattern); diff --git a/backend/src/Designer/Services/Implementation/SchemaModelService.cs b/backend/src/Designer/Services/Implementation/SchemaModelService.cs index 23f33e92be5..64faa13271b 100644 --- a/backend/src/Designer/Services/Implementation/SchemaModelService.cs +++ b/backend/src/Designer/Services/Implementation/SchemaModelService.cs @@ -80,11 +80,19 @@ public SchemaModelService( } /// - public IList GetSchemaFiles(AltinnRepoEditingContext altinnRepoEditingContext, bool xsd = false) + public IList GetAllSchemaFiles(AltinnRepoEditingContext altinnRepoEditingContext, bool xsd = false) { var altinnAppGitRepository = _altinnGitRepositoryFactory.GetAltinnAppGitRepository(altinnRepoEditingContext.Org, altinnRepoEditingContext.Repo, altinnRepoEditingContext.Developer); - return altinnAppGitRepository.GetSchemaFiles(xsd); + return altinnAppGitRepository.GetAllSchemaFiles(xsd); + } + + /// + public IList GetAppSchemaFiles(AltinnRepoEditingContext altinnRepoEditingContext, bool xsd = false) + { + var altinnAppGitRepository = _altinnGitRepositoryFactory.GetAltinnAppGitRepository(altinnRepoEditingContext.Org, altinnRepoEditingContext.Repo, altinnRepoEditingContext.Developer); + + return altinnAppGitRepository.GetAppSchemaFiles(xsd); } /// diff --git a/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs b/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs index 16cc0a91f34..f7a602ec929 100644 --- a/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs +++ b/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs @@ -16,12 +16,20 @@ namespace Altinn.Studio.Designer.Services.Interfaces public interface ISchemaModelService { /// - /// Gets a list of the schema files within the repository. + /// Gets a list of all the schema files within the repository. /// /// /// An . /// Value to indicate if schema files should be XSDs or not /// A total list of schema files within the repository, regardless of location. - IList GetSchemaFiles(AltinnRepoEditingContext altinnRepoEditingContext, bool xsd = false); + IList GetAllSchemaFiles(AltinnRepoEditingContext altinnRepoEditingContext, bool xsd = false); + + /// + /// Gets a list of the schema files within App/models directory. + /// + /// /// An . + /// Value to indicate if schema files should be XSDs or not + /// A total list of schema files within the repository, regardless of location. + IList GetAppSchemaFiles(AltinnRepoEditingContext altinnRepoEditingContext, bool xsd = false); /// /// Gets the JSON content of the specified schema file. diff --git a/backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs b/backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs index db6855e5d3f..286257e7ac1 100644 --- a/backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs +++ b/backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs @@ -389,19 +389,19 @@ public async Task CreateOrOverwriteOptions_WithAppThatHasOptionLists_ShouldOverw [InlineData("ttd", "apps-test", "testUser", 0)] [InlineData("ttd", "ttd-datamodels", "testUser", 0)] [InlineData("ttd", "hvem-er-hvem", "testUser", 7)] - public async Task GetSchemaFiles_FilesExist_ShouldReturnFiles(string org, string repository, string developer, int expectedSchemaFiles) + public async Task GetAppSchemaFiles_FilesExist_ShouldReturnFiles(string org, string repository, string developer, int expectedSchemaFiles) { string targetRepository = TestDataHelper.GenerateTestRepoName(); await TestDataHelper.CopyRepositoryForTest(org, repository, developer, targetRepository); AltinnAppGitRepository altinnAppGitRepository = PrepareRepositoryForTest(org, targetRepository, developer); - var files = altinnAppGitRepository.GetSchemaFiles(); + var files = altinnAppGitRepository.GetAppSchemaFiles(); Assert.Equal(expectedSchemaFiles, files.Count); } [Fact] - public async Task GetSchemaFiles_FilesExist_ShouldReturnFilesWithCorrectProperties() + public async Task GetAppSchemaFiles_FilesExist_ShouldReturnFilesWithCorrectProperties() { string org = "ttd"; string repository = "hvem-er-hvem"; @@ -411,14 +411,14 @@ public async Task GetSchemaFiles_FilesExist_ShouldReturnFilesWithCorrectProperti await TestDataHelper.CopyRepositoryForTest(org, repository, developer, targetRepository); AltinnAppGitRepository altinnAppGitRepository = PrepareRepositoryForTest(org, targetRepository, developer); - var file = altinnAppGitRepository.GetSchemaFiles().First(f => f.FileName == "HvemErHvem_ExternalTypes.schema.json"); + var file = altinnAppGitRepository.GetAppSchemaFiles().First(f => f.FileName == "HvemErHvem_ExternalTypes.schema.json"); Assert.Equal(".json", file.FileType); Assert.Equal(@"/App/models/HvemErHvem_ExternalTypes.schema.json", file.RepositoryRelativeUrl); } [Fact] - public async Task GetSchemaFiles_FilesExistOutsideModelsFolder_ShouldNotReturnFiles() + public async Task GetAppSchemaFiles_FilesExistOutsideModelsFolder_ShouldNotReturnFiles() { string org = "ttd"; string repository = "app-with-misplaced-datamodels"; @@ -428,7 +428,7 @@ public async Task GetSchemaFiles_FilesExistOutsideModelsFolder_ShouldNotReturnFi await TestDataHelper.CopyRepositoryForTest(org, repository, developer, targetRepository); AltinnAppGitRepository altinnAppGitRepository = PrepareRepositoryForTest(org, targetRepository, developer); - var files = altinnAppGitRepository.GetSchemaFiles(); + var files = altinnAppGitRepository.GetAppSchemaFiles(); Assert.Empty(files); } diff --git a/backend/tests/Designer.Tests/Services/SchemaModelServiceTests.cs b/backend/tests/Designer.Tests/Services/SchemaModelServiceTests.cs index 925ac8e3a6f..bdf0356eafb 100644 --- a/backend/tests/Designer.Tests/Services/SchemaModelServiceTests.cs +++ b/backend/tests/Designer.Tests/Services/SchemaModelServiceTests.cs @@ -45,7 +45,7 @@ public async Task DeleteSchema_AppRepo_ShouldDelete() await TestDataHelper.CopyRepositoryForTest(org, sourceRepository, developer, targetRepository); try { - var schemaFiles = _schemaModelService.GetSchemaFiles(editingContext); + var schemaFiles = _schemaModelService.GetAllSchemaFiles(editingContext); Assert.Equal(7, schemaFiles.Count); var altinnAppGitRepository = _altinnGitRepositoryFactory.GetAltinnAppGitRepository(org, targetRepository, developer); @@ -57,7 +57,7 @@ public async Task DeleteSchema_AppRepo_ShouldDelete() await _schemaModelService.DeleteSchema(editingContext, schemaToDelete.RepositoryRelativeUrl); // Assert - schemaFiles = _schemaModelService.GetSchemaFiles(editingContext); + schemaFiles = _schemaModelService.GetAllSchemaFiles(editingContext); Assert.Equal(6, schemaFiles.Count); applicationMetadata = await altinnAppGitRepository.GetApplicationMetadata(); Assert.Single(applicationMetadata.DataTypes); @@ -83,7 +83,7 @@ public async Task DeleteSchema_AppRepoWithLayoutSets_ShouldDelete() { string dataModelName = "datamodel"; - var schemaFiles = _schemaModelService.GetSchemaFiles(editingContext); + var schemaFiles = _schemaModelService.GetAllSchemaFiles(editingContext); Assert.Single(schemaFiles); var altinnAppGitRepository = _altinnGitRepositoryFactory.GetAltinnAppGitRepository(org, targetRepository, developer); @@ -95,7 +95,7 @@ public async Task DeleteSchema_AppRepoWithLayoutSets_ShouldDelete() await _schemaModelService.DeleteSchema(editingContext, schemaToDelete.RepositoryRelativeUrl); // Assert - schemaFiles = _schemaModelService.GetSchemaFiles(editingContext); + schemaFiles = _schemaModelService.GetAllSchemaFiles(editingContext); Assert.Empty(schemaFiles); var applicationMetadataAfter = await altinnAppGitRepository.GetApplicationMetadata(); Assert.Equal(applicationMetadataBefore.DataTypes.Count - 1, applicationMetadataAfter.DataTypes.Count); @@ -124,7 +124,7 @@ public async Task DeleteSchema_ModelsRepo_ShouldDelete() try { - var schemaFiles = _schemaModelService.GetSchemaFiles(editingContext); + var schemaFiles = _schemaModelService.GetAllSchemaFiles(editingContext); Assert.Equal(7, schemaFiles.Count); // Act @@ -132,7 +132,7 @@ public async Task DeleteSchema_ModelsRepo_ShouldDelete() await _schemaModelService.DeleteSchema(editingContext, schemaToDelete.RepositoryRelativeUrl); // Assert - schemaFiles = _schemaModelService.GetSchemaFiles(editingContext); + schemaFiles = _schemaModelService.GetAllSchemaFiles(editingContext); Assert.Equal(6, schemaFiles.Count); } finally diff --git a/frontend/packages/shared/src/api/paths.js b/frontend/packages/shared/src/api/paths.js index c9d654ded04..441e226f6b0 100644 --- a/frontend/packages/shared/src/api/paths.js +++ b/frontend/packages/shared/src/api/paths.js @@ -31,8 +31,8 @@ export const dataModelPath = (org, app, modelPath, saveOnly = false) => saveOnly, })}`; // Get, Put, Delete export const dataTypePath = (org, app, dataModelName) => `${basePath}/${org}/${app}/datamodels/datamodel/${dataModelName}/dataType`; // Get, Put -export const dataModelsPath = (org, app) => `${basePath}/${org}/${app}/datamodels/all-json`; // Get -export const dataModelsXsdPath = (org, app) => `${basePath}/${org}/${app}/datamodels/all-xsd`; // Get +export const dataModelsPath = (org, app) => `${basePath}/${org}/${app}/datamodels/app-json`; // Get +export const dataModelsXsdPath = (org, app) => `${basePath}/${org}/${app}/datamodels/app-xsd`; // Get export const dataModelsUploadPath = (org, app) => `${basePath}/${org}/${app}/datamodels/upload`; // Post export const dataModelAddXsdFromRepoPath = (org, app, filePath) => `${basePath}/${org}/${app}/datamodels/xsd-from-repo?${s({ filePath })}`; // Post From 69c69e994ec2e5358ff38d739ee900990321b482 Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 14 Feb 2025 13:03:51 +0100 Subject: [PATCH 2/7] add additional tests --- .../AltinnAppGitRepositoryTests.cs | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs b/backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs index 286257e7ac1..594cffb2549 100644 --- a/backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs +++ b/backend/tests/Designer.Tests/Infrastructure/GitRepository/AltinnAppGitRepositoryTests.cs @@ -385,6 +385,54 @@ public async Task CreateOrOverwriteOptions_WithAppThatHasOptionLists_ShouldOverw Assert.Equal(newOptionsListString, savedOptionsList); } + [Theory] + [InlineData("ttd", "apps-test", "testUser", 0)] + [InlineData("ttd", "ttd-datamodels", "testUser", 0)] + [InlineData("ttd", "hvem-er-hvem", "testUser", 7)] + public async Task GetAllSchemaFiles_FilesExist_ShouldReturnFiles(string org, string repository, string developer, int expectedSchemaFiles) + { + string targetRepository = TestDataHelper.GenerateTestRepoName(); + await TestDataHelper.CopyRepositoryForTest(org, repository, developer, targetRepository); + AltinnAppGitRepository altinnAppGitRepository = PrepareRepositoryForTest(org, targetRepository, developer); + + var files = altinnAppGitRepository.GetAllSchemaFiles(); + + Assert.Equal(expectedSchemaFiles, files.Count); + } + + [Fact] + public async Task GetAllSchemaFiles_FilesExist_ShouldReturnFilesWithCorrectProperties() + { + string org = "ttd"; + string repository = "hvem-er-hvem"; + string developer = "testUser"; + string targetRepository = TestDataHelper.GenerateTestRepoName(); + + await TestDataHelper.CopyRepositoryForTest(org, repository, developer, targetRepository); + AltinnAppGitRepository altinnAppGitRepository = PrepareRepositoryForTest(org, targetRepository, developer); + + var file = altinnAppGitRepository.GetAllSchemaFiles().First(f => f.FileName == "HvemErHvem_ExternalTypes.schema.json"); + + Assert.Equal(".json", file.FileType); + Assert.Equal(@"/App/models/HvemErHvem_ExternalTypes.schema.json", file.RepositoryRelativeUrl); + } + + [Fact] + public async Task GetAllSchemaFiles_FilesExistOutsideModelsFolder_ShouldReturnFiles() + { + string org = "ttd"; + string repository = "app-with-misplaced-datamodels"; + string developer = "testUser"; + string targetRepository = TestDataHelper.GenerateTestRepoName(); + + await TestDataHelper.CopyRepositoryForTest(org, repository, developer, targetRepository); + AltinnAppGitRepository altinnAppGitRepository = PrepareRepositoryForTest(org, targetRepository, developer); + + var files = altinnAppGitRepository.GetAllSchemaFiles(); + + Assert.Single(files); + } + [Theory] [InlineData("ttd", "apps-test", "testUser", 0)] [InlineData("ttd", "ttd-datamodels", "testUser", 0)] From 0a4912a94a4de28062acf07d4101ab8a8ee76920 Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 14 Feb 2025 13:12:12 +0100 Subject: [PATCH 3/7] update endpoint paths --- backend/src/Designer/Controllers/DatamodelsController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/Designer/Controllers/DatamodelsController.cs b/backend/src/Designer/Controllers/DatamodelsController.cs index 28ef54f12a6..d2f87887b2c 100644 --- a/backend/src/Designer/Controllers/DatamodelsController.cs +++ b/backend/src/Designer/Controllers/DatamodelsController.cs @@ -120,7 +120,7 @@ public async Task Delete(string org, string repository, [FromQuer [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status302Found)] - [Route("org/all-json")] + [Route("all-json")] public ActionResult> GetAllJsonDataModels(string org, string repository) { var developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); @@ -138,7 +138,7 @@ public ActionResult> GetAllJsonDataModels(string org [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status302Found)] - [Route("org/all-xsd")] + [Route("all-xsd")] public ActionResult> GetAllXsdDataModels(string org, string repository) { string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); From 364b6efe88dcb5fadbe90eb70fb5b60b010d120a Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 14 Feb 2025 13:19:22 +0100 Subject: [PATCH 4/7] update frontend paths --- frontend/packages/shared/src/api/paths.js | 4 ++-- frontend/packages/shared/src/api/queries.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/packages/shared/src/api/paths.js b/frontend/packages/shared/src/api/paths.js index 441e226f6b0..4a0e18f630c 100644 --- a/frontend/packages/shared/src/api/paths.js +++ b/frontend/packages/shared/src/api/paths.js @@ -31,8 +31,8 @@ export const dataModelPath = (org, app, modelPath, saveOnly = false) => saveOnly, })}`; // Get, Put, Delete export const dataTypePath = (org, app, dataModelName) => `${basePath}/${org}/${app}/datamodels/datamodel/${dataModelName}/dataType`; // Get, Put -export const dataModelsPath = (org, app) => `${basePath}/${org}/${app}/datamodels/app-json`; // Get -export const dataModelsXsdPath = (org, app) => `${basePath}/${org}/${app}/datamodels/app-xsd`; // Get +export const dataModelsAppJsonPath = (org, app) => `${basePath}/${org}/${app}/datamodels/app-json`; // Get +export const dataModelsAppXsdPath = (org, app) => `${basePath}/${org}/${app}/datamodels/app-xsd`; // Get export const dataModelsUploadPath = (org, app) => `${basePath}/${org}/${app}/datamodels/upload`; // Post export const dataModelAddXsdFromRepoPath = (org, app, filePath) => `${basePath}/${org}/${app}/datamodels/xsd-from-repo?${s({ filePath })}`; // Post diff --git a/frontend/packages/shared/src/api/queries.ts b/frontend/packages/shared/src/api/queries.ts index 18941a258f3..9cb64912329 100644 --- a/frontend/packages/shared/src/api/queries.ts +++ b/frontend/packages/shared/src/api/queries.ts @@ -8,8 +8,8 @@ import { branchStatusPath, dataModelMetadataPath, dataModelPath, - dataModelsPath, - dataModelsXsdPath, + dataModelsAppJsonPath, + dataModelsAppXsdPath, deployPermissionsPath, deploymentsPath, envConfigPath, @@ -110,8 +110,8 @@ export const getAppVersion = (org: string, app: string) => get(appVe export const getBranchStatus = (owner: string, app: string, branch: string) => get(branchStatusPath(owner, app, branch)); export const getDataModel = (owner: string, app: string, modelPath: string) => get(dataModelPath(owner, app, modelPath)); export const getDataModelMetadata = (owner: string, app: string, layoutSetName: string, dataModelName: string) => get(dataModelMetadataPath(owner, app, layoutSetName, dataModelName)); -export const getDataModelsJson = (owner: string, app: string) => get(dataModelsPath(owner, app)); -export const getDataModelsXsd = (owner: string, app: string) => get(dataModelsXsdPath(owner, app)); +export const getDataModelsJson = (owner: string, app: string) => get(dataModelsAppJsonPath(owner, app)); +export const getDataModelsXsd = (owner: string, app: string) => get(dataModelsAppXsdPath(owner, app)); export const getDataType = (org: string, app: string, dataModelName: string) => get(dataTypePath(org, app, dataModelName)); export const getDeployPermissions = (owner: string, app: string) => get(deployPermissionsPath(owner, app)); export const getDeployments = (owner: string, app: string) => get(deploymentsPath(owner, app, 'Descending')); From 7616767bb8c1dc65cb76a8e323b6be4c20b4be2d Mon Sep 17 00:00:00 2001 From: Erling Hauan Date: Fri, 14 Feb 2025 13:22:06 +0100 Subject: [PATCH 5/7] add paths to be used in next PR --- frontend/packages/shared/src/api/paths.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/frontend/packages/shared/src/api/paths.js b/frontend/packages/shared/src/api/paths.js index 4a0e18f630c..0a9de88e81d 100644 --- a/frontend/packages/shared/src/api/paths.js +++ b/frontend/packages/shared/src/api/paths.js @@ -31,6 +31,8 @@ export const dataModelPath = (org, app, modelPath, saveOnly = false) => saveOnly, })}`; // Get, Put, Delete export const dataTypePath = (org, app, dataModelName) => `${basePath}/${org}/${app}/datamodels/datamodel/${dataModelName}/dataType`; // Get, Put +export const dataModelsAllJsonPath = (org, app) => `${basePath}/${org}/${app}/datamodels/all-json`; // Get +export const dataModelsAllXsdPath = (org, app) => `${basePath}/${org}/${app}/datamodels/all-xsd`; // Get export const dataModelsAppJsonPath = (org, app) => `${basePath}/${org}/${app}/datamodels/app-json`; // Get export const dataModelsAppXsdPath = (org, app) => `${basePath}/${org}/${app}/datamodels/app-xsd`; // Get export const dataModelsUploadPath = (org, app) => `${basePath}/${org}/${app}/datamodels/upload`; // Post From 807b0240ca3929542f94618d2ee9cad3e5a330ef Mon Sep 17 00:00:00 2001 From: Erling Hauan <148075168+ErlingHauan@users.noreply.github.com> Date: Fri, 14 Feb 2025 13:42:57 +0100 Subject: [PATCH 6/7] Update backend/src/Designer/Services/Interfaces/ISchemaModelService.cs Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../src/Designer/Services/Interfaces/ISchemaModelService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs b/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs index f7a602ec929..9e224b1168b 100644 --- a/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs +++ b/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs @@ -26,9 +26,10 @@ public interface ISchemaModelService /// /// Gets a list of the schema files within App/models directory. /// - /// /// An . + /// An . /// Value to indicate if schema files should be XSDs or not - /// A total list of schema files within the repository, regardless of location. +- /// A total list of schema files within the repository, regardless of location. ++ /// A list of schema files within the App/models directory. IList GetAppSchemaFiles(AltinnRepoEditingContext altinnRepoEditingContext, bool xsd = false); /// From ff70fe4e096dc963161c68d2c8f42acb240f8283 Mon Sep 17 00:00:00 2001 From: Erling Hauan <148075168+ErlingHauan@users.noreply.github.com> Date: Fri, 14 Feb 2025 13:43:58 +0100 Subject: [PATCH 7/7] Update ISchemaModelService.cs --- .../src/Designer/Services/Interfaces/ISchemaModelService.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs b/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs index 9e224b1168b..f6296bac880 100644 --- a/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs +++ b/backend/src/Designer/Services/Interfaces/ISchemaModelService.cs @@ -28,8 +28,7 @@ public interface ISchemaModelService /// /// An . /// Value to indicate if schema files should be XSDs or not -- /// A total list of schema files within the repository, regardless of location. -+ /// A list of schema files within the App/models directory. + /// A list of schema files within the App/models directory. IList GetAppSchemaFiles(AltinnRepoEditingContext altinnRepoEditingContext, bool xsd = false); ///