Skip to content

Commit

Permalink
align naming of Implementations, IAs, and DAs
Browse files Browse the repository at this point in the history
  • Loading branch information
lharzenetter committed Jun 30, 2021
1 parent c007c1c commit 46a87c7
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
16 changes: 14 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
<!-- describe the changes you have made here: what, why, ... -->
Use the following template for the PR title and delete this line: [WIP] Title of the thesis/work/target

- [ ] Ensure that you followed our [toolchain guide](https://github.com/eclipse/winery/blob/master/docs/dev/github-workflow.md#github---prepare-final-pull-request). Especially, we require **a single commit**
<!-- Replace this placeholder by a short description of the aim -->

- Start and end date: <!-- 2017-01-01 to 2017-08-01 -->
- Contributor: <!-- full name plus GitHub name -- e.g., Lukas Harzenetter, @lharzenetter -->
- Supervisor: <!-- full name plus GitHub name -- e.g., Karoline Saatkamp, @saatkamp -->

<!--
Replace this placeholder by a short description of the current state. What is done? What are the next steps?
Please update this description regularly.
-->

- [ ] Ensure that you followed our [toolchain guide](https://github.com/eclipse/winery/blob/master/docs/dev/github-workflow.md#github---prepare-final-pull-request).
- [ ] Branch name checked. That means, the branch name starts with `thesis/`, `fix/`, ...
- [ ] Ensure that the commit message is [a good commit message](https://github.com/joelparkerhenderson/git_commit_message)
- [ ] Ensure to use auto format in **all** files
- [ ] Ensure that you appear in `NOTICE` at Copyright Holders
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class ImplementationsComponent implements OnInit {

// region ######## table methods ########
onCellSelected(data: WineryRowData) {
if (!isNullOrUndefined(data)) {
if (data) {
this.selectedCell = data.row;
}
}
Expand All @@ -70,9 +70,7 @@ export class ImplementationsComponent implements OnInit {
}

onRemoveClick(data: ImplementationAPIData) {
if (isNullOrUndefined(data)) {
return;
} else {
if (data) {
this.elementToRemove = data;
this.confirmDeleteModal.show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,14 @@ export class WineryArtifactComponent implements OnInit {
this.artifact.name = this.nodeTypeName;
this.artifact.toscaType = ToscaTypes.ArtifactTemplate;
this.existCheck();
this.addComponentData.createArtifactName(this.sharedData.toscaComponent, this.nodeType,
this.selectedOperation, this.isImplementationArtifact, this.nodeTypeName);
this.addComponentData.createArtifactName(
this.sharedData.toscaComponent,
this.nodeType,
this.selectedInterface ? this.selectedInterface.text : null,
this.selectedOperation,
this.isImplementationArtifact,
this.nodeTypeName
);
this.addArtifactModal.show();
}

Expand Down Expand Up @@ -448,10 +454,10 @@ export class WineryArtifactComponent implements OnInit {
interfaceAndOperation() {
if (this.isImplementationArtifact) {
this.addComponentData.createArtifactName(this.sharedData.toscaComponent, this.nodeType,
this.selectedOperation, this.isImplementationArtifact, this.nodeTypeName);
this.selectedInterface.text, this.selectedOperation, this.isImplementationArtifact, this.nodeTypeName);
} else {
this.addComponentData.createArtifactName(this.sharedData.toscaComponent, this.nodeType,
this.newArtifact.artifactName, this.isImplementationArtifact, this.nodeTypeName);
null, this.newArtifact.artifactName, this.isImplementationArtifact, this.nodeTypeName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,29 +167,30 @@ export class WineryAddComponentDataComponent {

createNoteTypeImplementationName(fullName: SelectData) {
const version = Utils.getVersionFromString(fullName.text);
this.newComponentVersion.componentVersion = version ? version.toString() : '';
this.newComponentVersion.componentVersion = version ? version.getComponentVersion() : '';
// we need to set both as it is required in the determineFinalName
this.newComponentFinalName = this.newComponentName = Utils.getNameWithoutVersion(fullName.text) + '-Impl';
this.newComponentFinalName = this.newComponentName = Utils.getNameWithoutVersion(fullName.text) + '-Implementation';
this.determineFinalName();
}

createArtifactName(toscaComponent: ToscaComponent, nodeTypeQName: string, operation: string,
createArtifactName(toscaComponent: ToscaComponent, nodeTypeQName: string, interfaceName: string, operation: string,
isImplementationArtifact: boolean, nodeType: string) {
const artifactType = isImplementationArtifact ? 'IA' : 'DA';
const wineryVersion = Utils.getVersionFromString(nodeTypeQName);
const newVersion = WineryVersion.WINERY_VERSION_PREFIX + 1 + WineryVersion.WINERY_VERSION_SEPARATOR + WineryVersion.WINERY_WORK_IN_PROGRESS_PREFIX + 1;
this.newComponentFinalName = nodeType;
if (operation) {
if (isImplementationArtifact) {
const readableInterfaceName = interfaceName && interfaceName.includes('/')
? interfaceName.substring(interfaceName.lastIndexOf('/') + 1)
: interfaceName ? interfaceName : '';
this.newComponentVersion.componentVersion = (wineryVersion && wineryVersion.componentVersion
? wineryVersion.componentVersion + WineryVersion.WINERY_VERSION_SEPARATOR
: '')
+ operation
+ (isImplementationArtifact ? '' : '-' + artifactType);
+ (operation && operation.length > 0 ? operation : readableInterfaceName);
} else {
this.newComponentVersion.componentVersion = (wineryVersion && wineryVersion.getComponentVersion()
? wineryVersion.componentVersion + WineryVersion.WINERY_VERSION_SEPARATOR
: '')
+ artifactType;
: '-')
+ 'DA';
}
this.newComponentFinalName += (this.newComponentVersion.componentVersion ? WineryVersion.WINERY_NAME_FROM_VERSION_SEPARATOR
+ this.newComponentVersion.componentVersion : '')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export class WineryAddComponent {
}

onAdd(componentType?: SelectData) {
debugger
const typesUrl = Utils.getTypeOfTemplateOrImplementation(this.toscaType);
this.addModalType = Utils.getToscaTypeNameFromToscaType(this.toscaType);
this.useStartNamespace = !(this.namespace && this.namespace.length > 0);
Expand Down

0 comments on commit 46a87c7

Please sign in to comment.