Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions .github/workflows/dotnet-core-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,32 @@ on:
- '.github/**'

jobs:
angular-unit-test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
path: eform-angular-workflow-plugin
- name: Preparing Frontend checkout
uses: actions/checkout@v4
with:
repository: microting/eform-angular-frontend
ref: ${{ github.ref_name }}
path: eform-angular-frontend
- name: Copy dependencies
run: |
cp -av eform-angular-workflow-plugin/eform-client/src/app/plugins/modules/workflow-pn eform-angular-frontend/eform-client/src/app/plugins/modules/workflow-pn
cd eform-angular-frontend/eform-client && ../../eform-angular-workflow-plugin/testinginstallpn.sh
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Enable Corepack
run: corepack enable
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
- name: Unit tests
run: cd eform-angular-frontend/eform-client && npx ng test --watch=false --include='src/app/plugins/modules/workflow-pn/**/*.spec.ts'
workflow-build:
runs-on: ubuntu-latest
steps:
Expand All @@ -34,8 +60,6 @@ jobs:
cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-settings eform-angular-frontend/eform-client/e2e/Tests/workflow-settings
cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-general eform-angular-frontend/eform-client/e2e/Tests/workflow-general
cp -av eform-angular-workflow-plugin/eform-client/e2e/Page\ objects/Workflow eform-angular-frontend/eform-client/e2e/Page\ objects/Workflow
cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts
cp -av eform-angular-workflow-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-workflow-plugin/testinginstallpn.sh
- name: Button conventions
Expand Down Expand Up @@ -107,8 +131,6 @@ jobs:
cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-settings eform-angular-frontend/eform-client/e2e/Tests/workflow-settings
cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-general eform-angular-frontend/eform-client/e2e/Tests/workflow-general
cp -av eform-angular-workflow-plugin/eform-client/e2e/Page\ objects/Workflow eform-angular-frontend/eform-client/e2e/Page\ objects/Workflow
cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts
cp -av eform-angular-workflow-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-workflow-plugin/testinginstallpn.sh
- name: Start the newly build Docker container
Expand All @@ -120,6 +142,8 @@ jobs:
run: cat docker_run_log
- name: Pretest changes to work with Docker container
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
- name: Enable Corepack
run: corepack enable
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
- name: DB Configuration
Expand Down Expand Up @@ -238,6 +262,8 @@ jobs:
run: cat docker_run_log
- name: Pretest changes to work with Docker container
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
- name: Enable Corepack
run: corepack enable
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
- name: Install Playwright browsers
Expand Down
40 changes: 33 additions & 7 deletions .github/workflows/dotnet-core-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,32 @@ on:
- '.github/**'

jobs:
angular-unit-test:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
path: eform-angular-workflow-plugin
- name: Preparing Frontend checkout
uses: actions/checkout@v4
with:
repository: microting/eform-angular-frontend
ref: ${{ github.base_ref }}
path: eform-angular-frontend
- name: Copy dependencies
run: |
cp -av eform-angular-workflow-plugin/eform-client/src/app/plugins/modules/workflow-pn eform-angular-frontend/eform-client/src/app/plugins/modules/workflow-pn
cd eform-angular-frontend/eform-client && ../../eform-angular-workflow-plugin/testinginstallpn.sh
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Enable Corepack
run: corepack enable
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
- name: Unit tests
run: cd eform-angular-frontend/eform-client && npx ng test --watch=false --include='src/app/plugins/modules/workflow-pn/**/*.spec.ts'
workflow-build:
runs-on: ubuntu-latest
steps:
Expand All @@ -19,7 +45,7 @@ jobs:
with:
fetch-depth: 0
repository: microting/eform-angular-frontend
ref: stable
ref: ${{ github.base_ref }}
path: eform-angular-frontend
- name: Copy dependencies
run: |
Expand All @@ -31,8 +57,6 @@ jobs:
cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-settings eform-angular-frontend/eform-client/e2e/Tests/workflow-settings
cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-general eform-angular-frontend/eform-client/e2e/Tests/workflow-general
cp -av eform-angular-workflow-plugin/eform-client/e2e/Page\ objects/Workflow eform-angular-frontend/eform-client/e2e/Page\ objects/Workflow
cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts
cp -av eform-angular-workflow-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-workflow-plugin/testinginstallpn.sh
- name: Button conventions
Expand Down Expand Up @@ -83,7 +107,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: microting/eform-angular-frontend
ref: stable
ref: ${{ github.base_ref }}
path: eform-angular-frontend
- name: Sleep 15 seconds
run: sleep 15
Expand All @@ -101,8 +125,6 @@ jobs:
cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-settings eform-angular-frontend/eform-client/e2e/Tests/workflow-settings
cp -av eform-angular-workflow-plugin/eform-client/e2e/Tests/workflow-general eform-angular-frontend/eform-client/e2e/Tests/workflow-general
cp -av eform-angular-workflow-plugin/eform-client/e2e/Page\ objects/Workflow eform-angular-frontend/eform-client/e2e/Page\ objects/Workflow
cp -av eform-angular-workflow-plugin/eform-client/wdio-headless-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-headless-plugin-step2.conf.ts
cp -av eform-angular-workflow-plugin/eform-client/wdio-plugin-step2.conf.ts eform-angular-frontend/eform-client/wdio-plugin-step2.conf.ts
mkdir -p eform-angular-frontend/eFormAPI/eFormAPI.Web/Plugins
cd eform-angular-frontend/eform-client && ../../eform-angular-workflow-plugin/testinginstallpn.sh
- name: Start the newly build Docker container
Expand All @@ -114,6 +136,8 @@ jobs:
run: cat docker_run_log
- name: Pretest changes to work with Docker container
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
- name: Enable Corepack
run: corepack enable
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
- name: DB Configuration
Expand Down Expand Up @@ -202,7 +226,7 @@ jobs:
uses: actions/checkout@v3
with:
repository: microting/eform-angular-frontend
ref: stable
ref: ${{ github.base_ref }}
path: eform-angular-frontend
- name: Sleep 15 seconds
run: sleep 15
Expand All @@ -229,6 +253,8 @@ jobs:
run: cat docker_run_log
- name: Pretest changes to work with Docker container
run: sed -i 's/localhost/mariadbtest/g' eform-angular-frontend/eform-client/e2e/Constants/DatabaseConfigurationConstants.ts
- name: Enable Corepack
run: corepack enable
- name: yarn install
run: cd eform-angular-frontend/eform-client && yarn install
- name: Install Playwright browsers
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ FROM node:22-bookworm-slim as node-env
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY eform-angular-frontend/eform-client ./
RUN corepack enable
RUN yarn install
RUN npm run build
RUN yarn build

FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS build-env
WORKDIR /app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ export * from './workflow-cases';
export * from './settings/workflow-settings/workflow-settings.component';
export * from './settings/workflow-folders-modal/workflow-folders-modal.component';
export * from './settings/settings-add-site-modal/settings-add-site-modal.component';
// export * from './settings/settings-remove-site-modal/settings-remove-site-modal.component';
Original file line number Diff line number Diff line change
@@ -1,25 +1,42 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { SettingsAddSiteModalComponent } from './settings-add-site-modal.component';

describe('SettingsAddSiteModalComponent', () => {
let component: SettingsAddSiteModalComponent;
let fixture: ComponentFixture<SettingsAddSiteModalComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SettingsAddSiteModalComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(SettingsAddSiteModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { TranslateModule } from '@ngx-translate/core';
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { WorkflowPnSettingsService } from '../../../services';
import { SettingsAddSiteModalComponent } from './settings-add-site-modal.component';

describe('SettingsAddSiteModalComponent', () => {
let component: SettingsAddSiteModalComponent;
let fixture: ComponentFixture<SettingsAddSiteModalComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [SettingsAddSiteModalComponent, TranslateModule.forRoot()],
providers: [
provideNoopAnimations(),
{ provide: WorkflowPnSettingsService, useValue: { addSiteToSettings: vi.fn() } },
{ provide: MatDialogRef, useValue: { close: vi.fn() } },
{
provide: MAT_DIALOG_DATA,
useValue: {
sites: [{ siteUId: 1, siteName: 'A' }, { siteUId: 2, siteName: 'B' }],
assignedSites: [{ siteUId: 1, siteName: 'A' }],
},
},
],
}).compileComponents();

fixture = TestBed.createComponent(SettingsAddSiteModalComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});

it('should only offer sites that are not assigned yet', () => {
expect(component.availableSites.map((s) => s.siteUId)).toEqual([2]);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@ import {Subscription} from 'rxjs';
import {WorkflowPnSettingsService} from '../../../services';
import {eqBy, prop, symmetricDifferenceWith} from 'ramda';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {MatDialogTitle, MatDialogContent, MatDialogActions} from '@angular/material/dialog';
import {MatFormField, MatLabel} from '@angular/material/form-field';
import {MtxSelect} from '@ng-matero/extensions/select';
import {FormsModule} from '@angular/forms';
import {TranslatePipe} from '@ngx-translate/core';

@AutoUnsubscribe()
@Component({
selector: 'app-settings-add-site-modal',
templateUrl: './settings-add-site-modal.component.html',
styleUrls: ['./settings-add-site-modal.component.scss'],
standalone: false
imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatFormField, MatLabel, MtxSelect, FormsModule, TranslatePipe],
})
export class SettingsAddSiteModalComponent implements OnInit, OnDestroy {
private settingsService = inject(WorkflowPnSettingsService);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading