altinn-studio icon indicating copy to clipboard operation
altinn-studio copied to clipboard

Create a new data model from stand alone version of Model Editor

Open RonnyB71 opened this issue 4 years ago • 4 comments

Description

Create a version of the Model Editor that can run in stand alone mode i.e. without an app context. Data modelling mode is perhaps a better description. This means that Studio needs to recognize that a repository is of a given type and not assume that is is an app repository.

UPDATE sep-2022: Find out how much is missing from this implementation, and get it working again. Standalone (not app specific) model editor is located in the dashboard code.

Development tasks

  • Check if the file .altinnstudio/settings.json exists and there is a repo.type setting which equals to datamodels and use that to render the Model Editor without the app context. If the settings.json file doesn't exist or the repotype setting isn't there it should fallback to showing the application editor as today.

Acceptance criteria

  • Verify that the Model Editor opens in stand alone mode given the repotype setting exists
  • Verify that if either settings.json or repotype settings doesn't exists Studio falls back to assuming it's an app repository and open the application editor.

Changes to the above spec

After the issue, we have concluded with a solution that works contrary of the spec:

  • [x] Repos ending in '-datamodels', should lead to the standalone version.
  • [x] Repos not ending in '-datamodels', should lead to standard app-development.

Testing

  • [ ] All functionality works as before or better when changing the url hash to #/datamodelling (create new, delete, etc.)
  • [ ] Clicking on repo on the dashboard that has a name ending in -datamodels will send the client to a standalone version
  • [ ] The standalone version should work as the in-app-version.

RonnyB71 avatar May 20 '21 06:05 RonnyB71

@RonnyB71 After discussing the sister/backend-task for this issue, I'm checking the ending of the repository name instead of parsing a settings.json file. As far as i understand all "datamodels" repos should have a "-datamodels" suffix, so I can mock up a concept where this is a reserved word. (A new repo name cannot end with "-datamodels" input by the user, but maybe select the ending from a drop-down?)

mjulstein avatar Jun 07 '21 14:06 mjulstein

https://github.com/Altinn/altinn-studio/blob/7907d6274acb130a9e0753fa39b551e8a8013227/src/studio/src/designer/frontend/dashboard/features/createService/createNewService.tsx#L50

And for backend, we should still add the settings file to all datamodel-repos we create, be able to easily distinguish repos in the future.

altinnadmin avatar Jun 08 '21 06:06 altinnadmin

@mjulstein yep, I've followed the discussion on the side. Makes sense, otherwise we would have to open every repo to parse the file. And yes @altinnadmin the file will be added as part of another task where @SandGrainOne is creating the folder structure and checking in the migrated schemas.

RonnyB71 avatar Jun 08 '21 07:06 RonnyB71

@mjulstein can you take a look at this issue and see if it's implemented or if there is still tasks that needs to ben done? @lvbachmann Moving it to the backlog (or setting Q3 as the milestone is probably a more correct term).

RonnyB71 avatar Sep 15 '21 06:09 RonnyB71