Skip to content

Commit

Permalink
Merge branch 'release/4.0.0-alpha.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuddy committed Jul 2, 2024
2 parents 28d1ae3 + cbd88c0 commit 83fd16d
Show file tree
Hide file tree
Showing 49 changed files with 2,933 additions and 76 deletions.
9 changes: 9 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@

## How can it be tested?

## Impacted packages

Check the packages that require a new publication or release:

- [ ] @mnfst/manifest
- [ ] @mnfst/types
- [ ] @mnfst/admin
- [ ] doc

## Check list before submitting

- [ ] I have performed a self-review of my code (no debugs, no commented code, good naming, etc.)
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
- name: Install dependencies
run: npm ci
working-directory: ./packages/core/manifest
# Enure that we are using the latest version of the types package (even if it is not published yet).
- name: Link local types
run: npm run link-local-types
working-directory: ./packages/core/manifest
- name: Build App
run: npm run build
working-directory: ./packages/core/manifest
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"metas",
"mnfst",
"nestjs",
"openapi",
"typeorm",
"uniqid"
],
Expand Down
8 changes: 4 additions & 4 deletions packages/core/admin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions packages/core/admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mnfst/admin",
"version": "0.1.0-alpha.4",
"version": "0.1.0-alpha.5",
"homepage": "https://manifest.build",
"keywords": [
"admin",
Expand Down Expand Up @@ -28,7 +28,8 @@
"start": "ng serve",
"build": "ng build --configuration production",
"watch": "ng build --watch --configuration development",
"test": "ng test"
"test": "ng test",
"link-local-types": "cd ../types && npm install && npm run build && npm link && cd ../manifest && npm link @mnfst/types"
},
"private": false,
"license": "MIT",
Expand All @@ -42,7 +43,7 @@
"@angular/platform-browser-dynamic": "^17.3.1",
"@angular/router": "^17.3.1",
"@auth0/angular-jwt": "^5.2.0",
"@mnfst/types": "^0.1.0-alpha.3",
"@mnfst/types": "^0.1.0-alpha.4",
"bulma": "^0.9.4",
"bulma-tooltip": "^3.0.2",
"rxjs": "~7.5.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { SelectInputComponent } from './select-input/select-input.component'
import { TextInputComponent } from './text-input/text-input.component'
import { TextareaInputComponent } from './textarea-input/textarea-input.component'
import { UrlInputComponent } from './url-input/url-input.component'
import { TimestampInputComponent } from './timestamp-input/timestamp-input.component'

@Component({
selector: 'app-input',
Expand All @@ -30,6 +31,7 @@ import { UrlInputComponent } from './url-input/url-input.component'
BooleanInputComponent,
CurrencyInputComponent,
DateInputComponent,
TimestampInputComponent,
EmailInputComponent,
UrlInputComponent,
MultiSelectInputComponent,
Expand Down Expand Up @@ -111,6 +113,14 @@ import { UrlInputComponent } from './url-input/url-input.component'
*ngIf="prop?.type === PropType.Date"
>
</app-date-input>
<app-timestamp-input
[prop]="prop"
[value]="value"
[isError]="isError"
(valueChanged)="onChange($event)"
*ngIf="prop?.type === PropType.Timestamp"
>
</app-timestamp-input>
<app-password-input
[prop]="prop"
[value]="value"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TimestampInputComponent } from './timestamp-input.component';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [TimestampInputComponent]
})
.compileComponents();

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { NgClass } from '@angular/common'
import {
Component,
ElementRef,
EventEmitter,
Input,
Output,
ViewChild
} from '@angular/core'
import { PropertyManifest } from '@mnfst/types'

@Component({
selector: 'app-timestamp-input',
standalone: true,
imports: [NgClass],
template: `<label [for]="prop.name">{{ prop.name }}</label>
<input
class="input"
[ngClass]="{ 'is-danger': isError }"
type="datetime-local"
[value]="value"
(change)="onChange($event)"
#input
/>`
})
export class TimestampInputComponent {
@Input() prop: PropertyManifest
@Input() value: string
@Input() isError: boolean

@Output() valueChanged: EventEmitter<number> = new EventEmitter()

@ViewChild('input', { static: true }) input: ElementRef

ngOnInit(): void {
if (this.value !== undefined) {
this.input.nativeElement.value = this.value
}
}

onChange(event: any) {
this.valueChanged.emit(event.target.value)
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { CommonModule } from '@angular/common'
import { DatePipe, NgIf } from '@angular/common'
import { Component, Input } from '@angular/core'

@Component({
selector: 'app-date-yield',
standalone: true,
imports: [CommonModule],
imports: [DatePipe, NgIf],
template: `<span class="is-nowrap">{{ value | date : 'MM/dd/yy' }}</span>
<span class="is-nowrap" *ngIf="!value"> - </span> `,
styleUrls: ['./date-yield.component.scss']
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TimestampYieldComponent } from './timestamp-yield.component';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [TimestampYieldComponent]
})
.compileComponents();

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

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { DatePipe } from '@angular/common'
import { Component, Input } from '@angular/core'

@Component({
selector: 'app-timestamp-yield',
standalone: true,
imports: [DatePipe],
template: `<span class="is-nowrap">{{
value | date : 'yyyy-MM-dd HH:mm:ss'
}}</span>`
})
export class TimestampYieldComponent {
@Input() value: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { LocationYieldComponent } from './location-yield/location-yield.componen
import { NumberYieldComponent } from './number-yield/number-yield.component'
import { ProgressBarYieldComponent } from './progress-bar-yield/progress-bar-yield.component'
import { TextYieldComponent } from './text-yield/text-yield.component'
import { TimestampYieldComponent } from './timestamp-yield/timestamp-yield.component'

@Component({
selector: 'app-yield',
Expand All @@ -22,6 +23,7 @@ import { TextYieldComponent } from './text-yield/text-yield.component'
BooleanYieldComponent,
CurrencyYieldComponent,
DateYieldComponent,
TimestampYieldComponent,
EmailYieldComponent,
NumberYieldComponent,
LinkYieldComponent,
Expand All @@ -45,22 +47,23 @@ import { TextYieldComponent } from './text-yield/text-yield.component'
[value]="value"
[compact]="compact"
></app-link-yield>
<app-boolean-yield
*ngIf="prop.type === PropType.Boolean"
[value]="value"
></app-boolean-yield>
<app-currency-yield
*ngIf="prop.type === PropType.Money"
[currency]="prop.options?.['currency']"
[value]="value"
></app-currency-yield>
<app-date-yield
*ngIf="prop.type === PropType.Date"
[value]="value"
></app-date-yield>
<app-timestamp-yield
*ngIf="prop.type === PropType.Timestamp"
[value]="value"
></app-timestamp-yield>
<app-email-yield
*ngIf="prop.type === PropType.Email"
[value]="value"
Expand Down
5 changes: 5 additions & 0 deletions packages/core/admin/src/styles/components/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
color: $input-placeholder-color !important;
}

input[type="datetime-local"] {
display: block;
padding-right: 12px;
}

label:not(.file-label):not(.checkbox):not(.image-label):not(.is-boxed) {
font-size: $size-6;
font-weight: $weight-bold;
Expand Down
13 changes: 13 additions & 0 deletions packages/core/manifest/e2e/assets/mock-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,22 @@ entities:
- { name: email, type: email }

Dog:
# Testing all property types.
properties:
- name
- { name: description, type: text }
- { name: age, type: number }
- { name: website, type: link }
- { name: price, type: money, options: { currency: EUR } }
- { name: birthdate, type: date }
- { name: isGoodBoy, type: boolean }
- { name: acquiredAt, type: timestamp }
- { name: password, type: password }
- { name: email, type: email }
- {
name: favoriteToy,
type: choice,
options: { values: [ball, bone, frisbee] }
}
belongsTo:
- Owner
6 changes: 6 additions & 0 deletions packages/core/manifest/e2e/jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { INestApplication } from '@nestjs/common'
import supertest from 'supertest'
import { load } from 'js-yaml'
import fs from 'fs'
import { SwaggerModule } from '@nestjs/swagger'
import { OpenApiService } from '../src/open-api/services/open-api.service'

let app: INestApplication

Expand Down Expand Up @@ -35,6 +37,10 @@ beforeAll(async () => {
// Store request object in global scope to use in tests.
global.request = supertest(app.getHttpServer())

// Set the SwaggerModule to serve the OpenAPI doc.
const openApiService = app.get(OpenApiService)
SwaggerModule.setup('api', app, openApiService.generateOpenApiObject())

await app.init()
})

Expand Down
Loading

0 comments on commit 83fd16d

Please sign in to comment.