Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
Lamarts mobile app angular
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Arko Dey Bhowmick
Lamarts mobile app angular
Commits
04bae104
Commit
04bae104
authored
Apr 03, 2025
by
achinta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: routine add with file upload
parent
8c8724bd
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
164 additions
and
0 deletions
+164
-0
src/app/component-library/file-input/file-input.component.html
...pp/component-library/file-input/file-input.component.html
+29
-0
src/app/component-library/file-input/file-input.component.scss
...pp/component-library/file-input/file-input.component.scss
+0
-0
src/app/component-library/file-input/file-input.component.spec.ts
...component-library/file-input/file-input.component.spec.ts
+23
-0
src/app/component-library/file-input/file-input.component.ts
src/app/component-library/file-input/file-input.component.ts
+30
-0
src/app/portal/service/mat-dialog-config.service.spec.ts
src/app/portal/service/mat-dialog-config.service.spec.ts
+16
-0
src/app/portal/service/mat-dialog-config.service.ts
src/app/portal/service/mat-dialog-config.service.ts
+19
-0
src/app/raintree/transmission/file-upload-transmission.service.spec.ts
...ree/transmission/file-upload-transmission.service.spec.ts
+16
-0
src/app/raintree/transmission/file-upload-transmission.service.ts
...raintree/transmission/file-upload-transmission.service.ts
+31
-0
No files found.
src/app/component-library/file-input/file-input.component.html
0 → 100644
View file @
04bae104
<!-- <mat-form-field style="width: 100%;" appearance="fill">
<mat-label>{{ label }}</mat-label>
<button mat-icon-button matPrefix (click)="fileInput.click()">
<mat-icon>attach_file</mat-icon>
</button>
<input type="file" multiple #fileInput (change)="onFileSelected($event)" style="display: none;" />
<mat-hint *ngIf="selectedFiles().length">
Selected: {{ selectedFiles().length }} file(s)
</mat-hint>
<mat-error *ngIf="!selectedFiles().length">This field is required</mat-error>
</mat-form-field> -->
<mat-form-field
style=
"width: 100%;"
>
<mat-label>
{{ label }}
</mat-label>
<button
mat-icon-button
matPrefix
(click)=
"f_input.click()"
>
<mat-icon>
attach_file
</mat-icon>
</button>
<input
type=
"text"
readonly
matInput
/>
<input
type=
"file"
multiple
#f_input
(change)=
"onFileSelected($event)"
/>
<mat-hint
*ngIf=
"selectedFiles().length"
>
Selected: {{ selectedFiles().length }} file(s)
</mat-hint>
<mat-error
*ngIf=
"!selectedFiles().length"
>
This field is required
</mat-error>
</mat-form-field>
\ No newline at end of file
src/app/component-library/file-input/file-input.component.scss
0 → 100644
View file @
04bae104
src/app/component-library/file-input/file-input.component.spec.ts
0 → 100644
View file @
04bae104
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
FileInputComponent
}
from
'
./file-input.component
'
;
describe
(
'
FileInputComponent
'
,
()
=>
{
let
component
:
FileInputComponent
;
let
fixture
:
ComponentFixture
<
FileInputComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
imports
:
[
FileInputComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
FileInputComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/component-library/file-input/file-input.component.ts
0 → 100644
View file @
04bae104
import
{
CommonModule
}
from
'
@angular/common
'
;
import
{
Component
,
EventEmitter
,
Input
,
Output
,
signal
}
from
'
@angular/core
'
;
import
{
MatIconModule
}
from
'
@angular/material/icon
'
;
import
{
MatInputModule
}
from
'
@angular/material/input
'
;
@
Component
({
selector
:
'
app-file-input
'
,
imports
:
[
CommonModule
,
MatInputModule
,
MatIconModule
],
templateUrl
:
'
./file-input.component.html
'
,
styleUrl
:
'
./file-input.component.scss
'
})
export
class
FileInputComponent
{
selectedFiles
=
signal
<
File
[]
>
([]);
@
Input
()
label
:
string
=
'
Upload Files
'
;
@
Output
()
filesChange
=
new
EventEmitter
<
File
[]
>
();
// Triggered when files are selected
onFileSelected
(
event
:
Event
):
void
{
const
input
=
event
.
target
as
HTMLInputElement
;
if
(
input
.
files
)
{
this
.
selectedFiles
.
set
(
Array
.
from
(
input
.
files
));
// Update the signal
this
.
filesChange
.
emit
(
this
.
selectedFiles
());
// Emit the event
}
}
}
src/app/portal/service/mat-dialog-config.service.spec.ts
0 → 100644
View file @
04bae104
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
MatDialogConfigService
}
from
'
./mat-dialog-config.service
'
;
describe
(
'
MatDialogConfigService
'
,
()
=>
{
let
service
:
MatDialogConfigService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
MatDialogConfigService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/portal/service/mat-dialog-config.service.ts
0 → 100644
View file @
04bae104
import
{
Injectable
}
from
'
@angular/core
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
MatDialogConfigService
{
constructor
()
{
}
public
matModalConfig
()
{
return
{
width
:
'
98vw
'
,
height
:
'
auto
'
,
maxWidth
:
'
70vw
'
,
maxHeight
:
'
70vh
'
,
}
}
}
src/app/raintree/transmission/file-upload-transmission.service.spec.ts
0 → 100644
View file @
04bae104
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
FileUploadTransmissionService
}
from
'
./file-upload-transmission.service
'
;
describe
(
'
FileUploadTransmissionService
'
,
()
=>
{
let
service
:
FileUploadTransmissionService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
FileUploadTransmissionService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
src/app/raintree/transmission/file-upload-transmission.service.ts
0 → 100644
View file @
04bae104
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
RaintreeResponse
}
from
'
../interface/raintree-response
'
;
import
{
TransmissionService
}
from
'
./transmission.service
'
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
FileUploadTransmissionService
extends
TransmissionService
{
public
uploadFile
(
url
:
string
,
payload
:
any
,
onPreExecute
:
()
=>
void
,
onPostExecute
:
(
response
:
RaintreeResponse
)
=>
void
,
onSuccess
:
(
response
:
RaintreeResponse
)
=>
void
,
onFailure
:
(
error
:
string
)
=>
void
,
onComplete
:
()
=>
void
):
void
{
this
.
executePostPayload
(
url
,
payload
,
onPreExecute
,
onPostExecute
,
onSuccess
,
onFailure
,
onComplete
,
true
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment