Skip to content

Commit

Permalink
Merge pull request #807 from adessoSE/minorQualityUpdates
Browse files Browse the repository at this point in the history
Minor quality updates
  • Loading branch information
sMeilbeck authored Dec 20, 2024
2 parents 5492854 + ee58290 commit 64048ef
Show file tree
Hide file tree
Showing 34 changed files with 97 additions and 220 deletions.
1 change: 1 addition & 0 deletions backend/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"quotes": ["error", "single"],
"comma-dangle": ["error", "never"],
"no-duplicate-imports": "error",
"no-underscore-dangle": "off",
"no-tabs": ["error", { "allowIndentationTabs": true }]
}
}
5 changes: 1 addition & 4 deletions backend/src/serverHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ async function deleteFeatureFile(storyTitle, storyId) {
function getSettings(scenario, globalSettings) {
const finalSettings = {
browser: scenario.browser || 'chrome',
waitTime: scenario.stepWaitTime || 0,
daisyAutoLogout: scenario.daisyAutoLogout || false
waitTime: scenario.stepWaitTime || 0
};

// if globalSettings are activated, then use global values
Expand Down Expand Up @@ -299,8 +298,6 @@ function scenarioPrep(scenarios, driver, globalSettings) {
if (!scenario.stepWaitTime) scenario.stepWaitTime = 0;
// eslint-disable-next-line no-param-reassign
if (!scenario.browser) scenario.browser = 'chrome';
// eslint-disable-next-line no-param-reassign
if (!scenario.daisyAutoLogout) scenario.daisyAutoLogout = false;

const additionalParams = getSettings(scenario, globalSettings);

Expand Down
24 changes: 17 additions & 7 deletions backend/src/serverRouter/storyRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ router.get('/issueKey/:issue_key', async (req, res) => {
// create Story
router.post('/', async (req, res) => {
try {
const db_id = await mongo.createStory(req.body.title, req.body.description, req.body._id);
await mongo.insertStoryIdIntoRepo(db_id, req.body._id);
helper.updateFeatureFile(db_id);
res.status(200).json(db_id);
const dbId = await mongo.createStory(req.body.title, req.body.description, req.body._id);
await mongo.insertStoryIdIntoRepo(dbId, req.body._id);
helper.updateFeatureFile(dbId);
res.status(200).json(dbId);
} catch (e) {
handleError(res, e, e, 500);
}
Expand Down Expand Up @@ -175,7 +175,12 @@ router.delete('/:repo_id/:_id', async (req, res) => {
router.post('/upload/import/', upload.single('file'), async (req, res) => {
try {
if (req.query.projectName) {
const result = pmHelper.importProject(req.file, req.query.repo_id, req.query.projectName, req.query.importMode);
const result = pmHelper.importProject(
req.file,
req.query.repo_id,
req.query.projectName,
req.query.importMode
);
res.status(200).json(result);
} else res.status(200).json('');
} catch (error) {
Expand All @@ -187,7 +192,12 @@ router.post('/upload/import/', upload.single('file'), async (req, res) => {
router.put('/upload/import/', upload.single('file'), async (req, res) => {
try {
if (req.query.repo_id) {
const result = pmHelper.importProject(req.file, req.query.repo_id, req.query.projectName, req.query.importMode);
const result = pmHelper.importProject(
req.file,
req.query.repo_id,
req.query.projectName,
req.query.importMode
);
res.status(200).json(result);
} else res.status(200).json('');
} catch (error) {
Expand Down Expand Up @@ -297,7 +307,7 @@ router.delete('/scenario/:story_id/:_id', async (req, res) => {
}

if (!dbError && !xrayError) res.status(200).json({ text: 'Scenario successfully deleted.' });
else {
else {
let errorMessage = 'Error during deletion: ';
if (dbError) errorMessage += 'Database error. ';
if (xrayError) errorMessage += 'Error deleting XRay step.';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ h2, h1{
margin-left: 5px;;
}

.customRepoContainer{
.projectListItem{
display: flex;
justify-content: flex-start;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2 class="LargeHeadline3">Seed-Test Account</h2>
<label class="MediumHeadline5">Custom Projects:</label>
<ul class="uk-list">
<ng-container *ngFor="let repository of repositories; let i = index">
<li class="customRepoContainer" *ngIf="this.apiService.isCustomRepo(repository)">
<li class="projectListItem" *ngIf="this.apiService.isCustomRepo(repository)">
<div class="db-item-list">
<img class="repo_img" *ngIf="this.apiService.isCustomRepo(repository)"
src="../assets/database-5-32.png">
Expand Down Expand Up @@ -127,10 +127,14 @@ <h2 class="LargeHeadline3" [ngStyle]="{ 'opacity': clientId==='undefined' ? '0.5
<label class="MediumHeadline5">Github Projects:</label>
<ul class="uk-list">
<ng-container *ngFor="let repository of repositories; let i = index">
<li *ngIf="this.apiService.isGithubRepo(repository)">
<img class="repo_img" *ngIf="this.apiService.isGithubRepo(repository)" src="../assets/GitHub-Mark-32px.png" alt="github">
<a class="MediumBody2 repoLink" id="github_{{'repository_'+i}}" (click)="selectRepository(repository);" >{{repository.value}}</a>
<mat-icon class="set-name-button setting-icon" id="edit_{{'repository_'+i}}" (click)="workGroupEdit(repository)" data-uk-tooltip title="Edit project">settings</mat-icon>
<li class="projectListItem" *ngIf="this.apiService.isGithubRepo(repository)">
<div class="db-item-list">
<img class="repo_img" *ngIf="this.apiService.isGithubRepo(repository)" src="../assets/GitHub-Mark-32px.png" alt="github">
<a class="MediumBody2 repoLink" id="github_{{'repository_'+i}}" (click)="selectRepository(repository);" >{{repository.value}}</a>
</div>
<span class="flex-end-item">
<mat-icon class="set-name-button setting-icon" id="edit_{{'repository_'+i}}" (click)="workGroupEdit(repository)" data-uk-tooltip title="Edit project">settings</mat-icon>
</span>
</li>
</ng-container>
</ul>
Expand Down Expand Up @@ -165,11 +169,15 @@ <h2 class="LargeHeadline3">Jira</h2>
<label class="MediumHeadline5">Jira Projects:</label>
<ul class="uk-list">
<ng-container *ngFor="let repository of repositories; let i = index">
<li *ngIf="this.apiService.isJiraRepo(repository)">
<img class="repo_img" *ngIf="this.apiService.isJiraRepo(repository)" src="../assets/[email protected]" alt="jira">
<a class="MediumBody2 repoLink" id="jira_{{'repository_'+i}}" (click)="selectRepository(repository);" >{{repository.value}}</a>
<mat-icon class="set-name-button setting-icon" id="edit_{{'repository_'+i}}" (click)="workGroupEdit(repository)" data-uk-tooltip title="Edit project">settings</mat-icon>
</li>
<li class="projectListItem" *ngIf="this.apiService.isJiraRepo(repository)">
<div class="db-item-list">
<img class="repo_img" *ngIf="this.apiService.isJiraRepo(repository)" src="../assets/jira-icon.png" alt="jira">
<a class="MediumBody2 repoLink" id="jira_{{'repository_'+i}}" (click)="selectRepository(repository);" >{{repository.value}}</a>
</div>
<span class="flex-end-item">
<mat-icon class="set-name-button setting-icon" id="edit_{{'repository_'+i}}" (click)="workGroupEdit(repository)" data-uk-tooltip title="Edit project">settings</mat-icon>
</span>
</li>
</ng-container>
</ul>
</div>
Expand Down
27 changes: 11 additions & 16 deletions frontend/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<img class="repo_img" *ngIf="this.apiService.isGithubRepo(repository)"
src="../assets/GitHub-Mark-32px.png" alt="github">
<img class="repo_img" *ngIf="this.apiService.isJiraRepo(repository)"
src="../assets/jira-logo-gradient-blue@2x-300x177.png" alt="jira">
src="../assets/jira-icon.png" alt="jira">
<img class="repo_img" *ngIf="this.apiService.isCustomRepo(repository)"
src="../assets/database-5-32.png" alt="database">
<a id="{{'repository_' + i}}" (click)="selectRepository(repository)"
Expand Down Expand Up @@ -68,23 +68,18 @@ <h4 id="seedTest">
[ngClass]="{'mat-checked mat-slide-toggle-bar':isDark}" title="Switch to dark/light mode"></mat-slide-toggle>
<mat-icon>bedtime</mat-icon>
</div>
<div>
<div class="dropdown">
<button class="rightButton">Help</button>
<div #helpMenu [class.closedMenu]="closed">
<div class="dropdown-list">
<a rel="noopener noreferrer" href="https://github.com/adessoAG/Seed-Test/wiki/Tutorial_deu"
target="_blank">Tutorial (german)</a>
<a rel="noopener noreferrer" href="https://github.com/adessoAG/Seed-Test/wiki/Tutorial_eng"
target="_blank">Tutorial (english)</a>
<a rel="noopener noreferrer" href="../assets/documentation/index.html"
target="_blank">Dokumentation (german)</a>
</div>
<div class="dropdown">
<button class="rightButton">Help</button>
<div #helpMenu [class.closedMenu]="closed">
<div class="dropdown-list">
<a rel="noopener noreferrer" href="https://github.com/adessoAG/Seed-Test/wiki/Tutorial_deu"
target="_blank">Tutorial (german)</a>
<a rel="noopener noreferrer" href="https://github.com/adessoAG/Seed-Test/wiki/Tutorial_eng"
target="_blank">Tutorial (english)</a>
<a rel="noopener noreferrer" href="../assets/documentation/index.html"
target="_blank">Dokumentation (german)</a>
</div>
</div>
<a routerLink="/feedback">
<button class="rightButton">Feedback</button>
</a>
</div>
</div>
</div>
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { EditableOnEnterDirective } from "./directives/edit-on-enter.directive";
import { FocusableDirective } from "./editable/focusable.directive";
import { DragDropModule } from "@angular/cdk/drag-drop";
import { NgbModule } from "@ng-bootstrap/ng-bootstrap";
import { FeedbackComponent } from "./feedback/feedback.component";
import { TermsComponent } from "./terms/terms.component";
import { StoryEditorComponent } from "./story-editor/story-editor.component";
import { AccountManagementComponent } from "./account-management/account-management.component";
Expand Down Expand Up @@ -104,7 +103,6 @@ import {MatCheckboxModule} from '@angular/material/checkbox';
EditableComponent,
FocusableDirective,
EditableOnEnterDirective,
FeedbackComponent,
TermsComponent,
AccountManagementComponent,
StoryEditorComponent,
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/app/base-editor/base-editor.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -506,11 +506,11 @@ input.background {
}

.origin-container {
margin-left: 10px;
padding: 5px 5px;
margin-left: 5px;
padding: 0px 5px 0px 2px;
border: 3px solid var(--ocean-blue);
font-size: 12px;
border-radius: 10px;
font-size: 16px;
border-radius: 20px;
display: inline-block;
background-color: #f9f9f9;
font-style: italic;
Expand All @@ -522,11 +522,11 @@ input.background {
align-items: center;
padding: 10px 10px;
border-radius: 5px;
cursor: pointer;
font-size: 13px;
/* cursor: pointer; */
font-size: 14px;
font-weight: bold;
font-style: italic;
color: var(--ocean-blue);
color: #2ab34b;
margin-right: 10px;
}

Expand Down
19 changes: 15 additions & 4 deletions frontend/src/app/base-editor/base-editor.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</div>
<div class="scenarioButtonGroup SmallHeadline5">
<button *ngIf="name === 'scenario' && this.selectedScenario.testKey" class="xray-button">
<span>Sync with</span>
<span>Synced with</span>
<img src="../../assets/xray-logo.png" alt="XRay Logo">
</button>
<button type="button" class="scenarioButton" [class.disabled]="this.clipboardBlock === null"
Expand Down Expand Up @@ -113,7 +113,7 @@
</ng-container>
<ng-template #steps let-sd let-i="index" let-stepDefs="stepDefs" , let-name="templateName">
<div class="stepsListContainer SmallHeadline5">
<div *ngIf="sd === 'given'">{{i+1}}. Given (Precondition)</div>
<div *ngIf="sd === 'given'">{{i+1}}. Given (Pre-Condition)</div>
<div *ngIf="sd === 'when'">{{i+1}}. When (Action)</div>
<div *ngIf="sd === 'then'">{{i+1}}. Then (Result)</div>
</div>
Expand Down Expand Up @@ -279,8 +279,19 @@
</ng-container>
</div>
</div>
<div *ngIf="this.selectedScenario.testKey" class="origin-container">
<!-- congrunt / Irigoin Button -->
<div *ngIf="this.selectedScenario.testKey">
<div *ngIf="currentStep.origin === 'congruent'" class="origin-container" style="border: 3px solid #2ab34b; ">
<img src="../../assets/xray-icon.png" alt="XRay origin" style="max-width: 18px; margin-top: -2px;">
Xray
</div>
<div *ngIf="currentStep.origin === 'created-by-user'" class="origin-container">
<img src="../../assets/icon-quad.png" alt="XRay origin" style="max-width: 18px; margin-top: -2px;">
Seed
</div>
<div *ngIf="currentStep.origin !== 'congruent' && currentStep.origin !== 'created-by-user'" class="origin-container">
{{ currentStep.origin || 'Unknown Origin' }}
</div>
</div>
<div *ngIf="currentStep.selectionValue==2">
<mat-form-field appearance="standard">
Expand Down Expand Up @@ -313,7 +324,7 @@
{{ currentStep.values[index].indexOf('<') !== -1 && currentStep.values[index].indexOf('>') !== -1 ? '< ' + currentStep.values[index].replace('<', '').replace('>', '') + ' >' : currentStep.values[index]}}
</div>
</div>
<button *ngIf="name!=='block-editor'"
<button *ngIf="name!=='block-editor' && this.selectedScenario.multipleScenarios[0] !== undefined"
class="scenarioTitle" (click)="addIsExample('example', j, index, currentStep.stepType)"
uk-tooltip="title: Use Multiple Scenarios; pos: right">
&nbsp;<p class="exampleButton">1+</p>&nbsp;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/base-editor/base-editor.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let stories : Story[]= [{"story_id": 123,"_id":2,"storySource":"github", "backgr

const scenarios:Scenario[] = [{scenario_id: 2, name: 'my first scenario', stepDefinitions: {"when":[{"_id":'5dce728851e70f2894a170b4',"id": 6, "stepType":"when", "type" :"HoverOverAndSelect", "pre":"I hover over the element", "mid":"and select the option","values":["",""], "post":"", "isExample":[]}], "given":[{"_id":'5dce728851e70f2894a170b4',"id": 6, "stepType":"when", "type" :"HoverOverAndSelect", "pre":"I hover over the element", "mid":"and select the option","values":["",""], "post":"", "isExample":[]}],"then":[], "example": []},
comment: 'write some words about this scenario', lastTestPassed: false,
saved: true, daisyAutoLogout: true, stepWaitTime: 200, browser: 'chrome'}]
saved: true, stepWaitTime: 200, browser: 'chrome'}]

describe('BaseEditorComponent', () => {
let component: BaseEditorComponent;
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/app/feedback/feedback.component.css

This file was deleted.

5 changes: 0 additions & 5 deletions frontend/src/app/feedback/feedback.component.html

This file was deleted.

25 changes: 0 additions & 25 deletions frontend/src/app/feedback/feedback.component.spec.ts

This file was deleted.

27 changes: 0 additions & 27 deletions frontend/src/app/feedback/feedback.component.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<div>
<img class="repo_img" alt="Database Project" *ngIf="element.source ==='db'" src="../assets/database-5-32.png">
<img class="repo_img" alt="Github Project" *ngIf="element.source ==='github'" src="../assets/GitHub-Mark-32px.png">
<img class="repo_img" alt="Jira Project" *ngIf="element.source === 'jira'" src="../assets/jira-logo-gradient-blue@2x-300x177.png">
<img class="repo_img" alt="Jira Project" *ngIf="element.source === 'jira'" src="../assets/jira-icon.png">
<a class="MediumBody2 repoLink" id="db_{{'element_'+i}}" (click)="selectRepository(element);" >{{element.value}}</a>
</div>
</li>
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/app/model/Scenario.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ export interface Scenario {
*/
saved?: boolean;

/**
* If the daisy Auto Logout is active
*/
daisyAutoLogout?: boolean;

/**
* Wait time between the steps
*/
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/parent/parent.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const story:Story = {_id: 1, issue_number: 36523, story_id: 37727, storySource:
state: '', assignee: 'alice', assignee_avatar_url: 'url/to/my/photo', lastTestPassed: false};

const scenario: Scenario = {scenario_id: 3, name: 'my scenario', stepDefinitions: undefined,
comment: 'i leave a few words here', lastTestPassed: false, saved: true, daisyAutoLogout: true,
comment: 'i leave a few words here', lastTestPassed: false, saved: true,
stepWaitTime: 40, browser: 'chrome'};


Expand Down
Loading

0 comments on commit 64048ef

Please sign in to comment.