-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature coding camp framework #3728
base: master
Are you sure you want to change the base?
Changes from all commits
35e30db
b67c164
ce7b235
5aebfc4
7d8a9ec
af301a8
2853038
2e891a4
cb6ab44
70f2fa3
422f0bb
f3dce90
4c8cc50
4341bfd
a4d4fe3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""Add table for steps phase | ||
|
||
Revision ID: c18fb65697ee | ||
Revises: 417094192806 | ||
Create Date: 2024-11-14 09:12:12.236411 | ||
|
||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'c18fb65697ee' | ||
down_revision = '417094192806' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('stepsphase', | ||
sa.Column('id', sa.Integer(), nullable=False), | ||
sa.Column('document_id', sa.Integer(), nullable=False), | ||
sa.Column('user_working_group', sa.Integer(), nullable=False), | ||
sa.Column('user_group', sa.Integer(), nullable=False), | ||
sa.Column('name', sa.Text(), nullable=False), | ||
sa.Column('current_phase', sa.Integer(), nullable=False), | ||
sa.ForeignKeyConstraint(['user_group'], ['usergroup.id'], ), | ||
sa.PrimaryKeyConstraint('id') | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_table('stepsphase') | ||
# ### end Alembic commands ### |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* eslint no-underscore-dangle: ["error", { "allow": ["files_", "multipleElements_"] }] */ | ||
import type {QueryList} from "@angular/core"; | ||
import type {OnInit, QueryList} from "@angular/core"; | ||
import { | ||
ChangeDetectorRef, | ||
Component, | ||
|
@@ -433,7 +433,7 @@ export class FileSelectComponent { | |
[maxSize]="maxSize"> | ||
</file-select>`, | ||
}) | ||
export class FileSelectManagerComponent { | ||
export class FileSelectManagerComponent implements OnInit { | ||
// TODO: translations | ||
@Input() allowMultiple: boolean = true; | ||
@Input() dragAndDrop: boolean = true; | ||
|
@@ -461,6 +461,9 @@ export class FileSelectManagerComponent { | |
}[] = []; | ||
|
||
constructor(public cdr: ChangeDetectorRef) {} | ||
ngOnInit() { | ||
console.log("File select init."); | ||
} | ||
Comment on lines
+464
to
+466
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is potentially unnnecessary. |
||
|
||
get multipleElements() { | ||
return this.multipleElements_; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
@import "fields-box-common"; | ||
|
||
.form-control { | ||
display: block; | ||
width: 100%; | ||
} | ||
|
||
textarea.form-control { | ||
height: unset; | ||
|
||
} | ||
|
||
p { | ||
padding-top: 0px; | ||
padding-left: 0px; | ||
padding-bottom: 0px; | ||
margin-bottom: 0px; | ||
margin-top: 0px; | ||
} | ||
|
||
.timButton { | ||
margin-bottom: 5px; | ||
} | ||
|
||
.textfield input{ | ||
padding: .3em; | ||
margin: .5em 0 .5em 0; | ||
} | ||
|
||
.textfield textarea { | ||
padding: .3em; | ||
overflow:hidden; | ||
height: auto; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
/** | ||
* Defines the client-side implementation of textfield/label plugin. | ||
*/ | ||
import * as t from "io-ts"; | ||
import type { | ||
ApplicationRef, | ||
DoBootstrap, | ||
OnInit, | ||
SimpleChanges, | ||
OnChanges, | ||
} from "@angular/core"; | ||
import { | ||
Component, | ||
Output, | ||
Input, | ||
NgModule, | ||
NgZone, | ||
EventEmitter, | ||
} from "@angular/core"; | ||
import {HttpClient, HttpClientModule} from "@angular/common/http"; | ||
import {FormsModule} from "@angular/forms"; | ||
import {TooltipModule} from "ngx-bootstrap/tooltip"; | ||
import type {PluginJson} from "tim/plugin/angular-plugin-base.directive"; | ||
import {TimUtilityModule} from "tim/ui/tim-utility.module"; | ||
import {PurifyModule} from "tim/util/purify.module"; | ||
import {registerPlugin} from "tim/plugin/pluginRegistry"; | ||
import {CommonModule} from "@angular/common"; | ||
import {nullable} from "tim/plugin/attributes"; | ||
|
||
export const FieldContent = t.union([t.string, t.number, t.null]); | ||
export const FieldBasicData = t.type({ | ||
c: FieldContent, | ||
}); | ||
export const FieldDataWithStyles = t.intersection([ | ||
FieldBasicData, | ||
t.partial({ | ||
styles: nullable(t.record(t.string, t.string)), | ||
}), | ||
]); | ||
|
||
export type InputType = "TEXTAREA" | "TEXT"; | ||
|
||
@Component({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mietin että ei ehkä sittenkään ole kovin mielekästä pitää tätä erillisenä komponenttina. Ajatus oli että textfield-plugin ja tämä sekä tulevaisuudessa muut mahdolliset kentät voisi käyttää ns "yleiskäyttöistä" tekstiboksia, mutta nyt kun katsoo tarkemmin mitä tuo user-profile-component tuolla tekstilaatikoillaan tekee niin ehkä ylläpidon kannalta on selkeämpi vain jättää tämä pois. Sen sijaan profiilikomponentissa voisi suoraan käyttää ja <textarea>-elementtejä. Tällä hetkellä ainoa toisto mistä pääsisi eroon erillisellä komponentilla on nuo varoitusvärit, mutta niiden css-pätkien kopsiminen toiseen paikkaan ei ole kovin iso homma vrt. uuden komponentin ylläpito. Nuo nykyiset komponentin bindaukset saa helposti suoraan siihen -elementtiin, eikä silloin tarvitse kikkailla angularin inputtien ja eventtien kanssa. Esim valueChange voi olla suoraan ngModelChange-bindaus ja sisällön saa suoraan kaksisuuntaisella ngModel-bindauksella |
||
selector: "tim-standalone-textfield", | ||
standalone: true, | ||
styleUrls: ["standalone-textfield.component.scss"], | ||
imports: [FormsModule, TooltipModule, CommonModule], | ||
template: ` | ||
<div> | ||
<span class="textfield"> | ||
<input type="text" | ||
*ngIf="inputType == 'TEXT'" | ||
class="form-control textarea" | ||
[name]="name" | ||
[(ngModel)]="initialValue" | ||
(ngModelChange)="updateInput()" | ||
[ngModelOptions]="{standalone: true}" | ||
[tooltip]="errormessage" | ||
[placeholder]="placeholder" | ||
[class.warnFrame]="inputWarn"> | ||
<textarea | ||
*ngIf="inputType == 'TEXTAREA'" | ||
class="form-control textarea" | ||
[name]="name" | ||
[(ngModel)]="initialValue" | ||
[ngModelOptions]="{standalone: true}" | ||
(ngModelChange)="updateInput()" | ||
[tooltip]="errormessage" | ||
[placeholder]="placeholder" | ||
[class.warnFrame]="inputWarn"> | ||
</textarea> | ||
</span> | ||
</div> | ||
`, | ||
}) | ||
export class StandaloneTextfieldComponent | ||
implements OnInit, OnChanges, PluginJson | ||
{ | ||
@Input() inputType: InputType = "TEXT"; | ||
@Input() initialValue: string = "Your description."; | ||
@Input() placeholder: string = "Words are powerful."; | ||
@Input() name: string = ""; | ||
@Input() inputWarn: boolean | null = false; | ||
@Output() valueChange = new EventEmitter<string>(); | ||
isRunning = false; | ||
userword = ""; | ||
errormessage?: string; | ||
styles: Record<string, string> = {}; | ||
saveFailed = false; | ||
|
||
constructor(private http: HttpClient, private zone: NgZone) { | ||
this.json = "{}"; | ||
} | ||
|
||
ngOnInit() {} | ||
|
||
ngOnChanges(change: SimpleChanges) { | ||
console.log(change); | ||
} | ||
|
||
/** | ||
* Returns (user) content in string form. | ||
*/ | ||
getContent(): string { | ||
return this.userword; | ||
} | ||
|
||
updateInput() { | ||
this.valueChange.emit(this.initialValue); | ||
console.log(this.inputWarn); | ||
if (!this.inputWarn) { | ||
this.inputWarn = true; | ||
// this.hideSavedText = true; | ||
} | ||
} | ||
|
||
json: string; | ||
} | ||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
HttpClientModule, | ||
TimUtilityModule, | ||
FormsModule, | ||
PurifyModule, | ||
TooltipModule.forRoot(), | ||
StandaloneTextfieldComponent, | ||
], | ||
exports: [StandaloneTextfieldComponent], | ||
}) | ||
export class StandaloneTextfieldModule implements DoBootstrap { | ||
ngDoBootstrap(appRef: ApplicationRef) {} | ||
} | ||
|
||
registerPlugin( | ||
"standalone-textfield", | ||
StandaloneTextfieldModule, | ||
StandaloneTextfieldComponent | ||
); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ | |
"importData", | ||
"userSelect", | ||
"calendar", | ||
"steps", | ||
"timMenu", | ||
"symbolbutton", | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tein pakotetun puskun tässä välissä, Simon tekemät muutokset on temp haarassa tallessa.