Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RLG Maker
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Romain DELEAU
RLG Maker
Commits
04fdadf0
Commit
04fdadf0
authored
Dec 06, 2023
by
Romain DELEAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
error on duplicated role title + fix on duplicated identifier tasks error
parent
80620d5b
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
72 additions
and
16 deletions
+72
-16
app.module.ts
src/app/app.module.ts
+3
-1
identifier-snackbar.component.scss
...rs/identifier-snackbar/identifier-snackbar.component.scss
+3
-3
role-name-duplicate.component.html
...rs/role-name-duplicate/role-name-duplicate.component.html
+1
-0
role-name-duplicate.component.scss
...rs/role-name-duplicate/role-name-duplicate.component.scss
+6
-0
role-name-duplicate.component.spec.ts
...role-name-duplicate/role-name-duplicate.component.spec.ts
+23
-0
role-name-duplicate.component.ts
...bars/role-name-duplicate/role-name-duplicate.component.ts
+15
-0
role.component.html
src/app/pieces/role/role.component.html
+1
-1
role.component.ts
src/app/pieces/role/role.component.ts
+13
-1
annexe-task.component.html
src/app/pieces/tasks/annexe-task/annexe-task.component.html
+1
-1
annexe-task.component.ts
src/app/pieces/tasks/annexe-task/annexe-task.component.ts
+0
-1
final-task.component.html
src/app/pieces/tasks/final-task/final-task.component.html
+1
-1
final-task.component.ts
src/app/pieces/tasks/final-task/final-task.component.ts
+0
-1
optionnal-task.component.html
...pieces/tasks/optionnal-task/optionnal-task.component.html
+1
-1
optionnal-task.component.ts
...p/pieces/tasks/optionnal-task/optionnal-task.component.ts
+0
-1
random-event.component.html
...app/pieces/tasks/random-event/random-event.component.html
+1
-1
random-event.component.ts
src/app/pieces/tasks/random-event/random-event.component.ts
+0
-1
task.component.html
src/app/pieces/tasks/task/task.component.html
+1
-1
task.component.ts
src/app/pieces/tasks/task/task.component.ts
+0
-1
en.json
src/assets/lang/en.json
+1
-0
fr.json
src/assets/lang/fr.json
+1
-0
No files found.
src/app/app.module.ts
View file @
04fdadf0
...
...
@@ -50,6 +50,7 @@ import { TutorialComponent } from './components/tutorial/tutorial.component';
import
{
FinishTutorialComponent
}
from
'./components/snackbars/finish-tutorial/finish-tutorial.component'
;
import
{
VerifyGameFailSnackbarComponent
}
from
'./components/snackbars/verify-game-fail-snackbar/verify-game-fail-snackbar.component'
;
import
{
VerifyDialogComponent
}
from
'./components/dialogs/verify-dialog/verify-dialog.component'
;
import
{
RoleNameDuplicateComponent
}
from
'./components/snackbars/role-name-duplicate/role-name-duplicate.component'
;
export
function
HttpLoaderFactory
(
http
:
HttpClient
)
{
return
new
TranslateHttpLoader
(
http
);
...
...
@@ -91,7 +92,8 @@ export function HttpLoaderFactory(http: HttpClient) {
TutorialComponent
,
FinishTutorialComponent
,
VerifyGameFailSnackbarComponent
,
VerifyDialogComponent
VerifyDialogComponent
,
RoleNameDuplicateComponent
],
imports
:
[
BrowserModule
,
...
...
src/app/components/snackbars/identifier-snackbar/identifier-snackbar.component.scss
View file @
04fdadf0
::ng-deep
.mat-snack-bar-container
{
background-color
:
#
fec001
;
color
:
black
;
box-shadow
:
0px
0px
15px
5px
#
fec001
;
background-color
:
#
de3e44
;
color
:
white
;
box-shadow
:
0px
0px
15px
5px
#
de3e44
;
text-align
:
center
;
}
\ No newline at end of file
src/app/components/snackbars/role-name-duplicate/role-name-duplicate.component.html
0 → 100644
View file @
04fdadf0
<span
matSnackBarLabel
>
{{'snackbar_roleName' | translate}}
</span>
src/app/components/snackbars/role-name-duplicate/role-name-duplicate.component.scss
0 → 100644
View file @
04fdadf0
::ng-deep
.mat-snack-bar-container
{
background-color
:
#de3e44
;
color
:
white
;
box-shadow
:
0px
0px
15px
5px
#de3e44
;
text-align
:
center
;
}
\ No newline at end of file
src/app/components/snackbars/role-name-duplicate/role-name-duplicate.component.spec.ts
0 → 100644
View file @
04fdadf0
import
{
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
RoleNameDuplicateComponent
}
from
'./role-name-duplicate.component'
;
describe
(
'RoleNameDuplicateComponent'
,
()
=>
{
let
component
:
RoleNameDuplicateComponent
;
let
fixture
:
ComponentFixture
<
RoleNameDuplicateComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
RoleNameDuplicateComponent
]
})
.
compileComponents
();
fixture
=
TestBed
.
createComponent
(
RoleNameDuplicateComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/components/snackbars/role-name-duplicate/role-name-duplicate.component.ts
0 → 100644
View file @
04fdadf0
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'app-role-name-duplicate'
,
templateUrl
:
'./role-name-duplicate.component.html'
,
styleUrls
:
[
'./role-name-duplicate.component.scss'
]
})
export
class
RoleNameDuplicateComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
}
}
src/app/pieces/role/role.component.html
View file @
04fdadf0
...
...
@@ -25,7 +25,7 @@ matTooltipPosition="left" [matTooltipDisabled]="!tooltipService.activatedTooltip
<img
src=
"./assets/background-images/role2_opacity0.png"
draggable=
"false"
*
ngIf=
"i == 1"
/>
<div
class=
"piece-form-intitule"
>
<label
for=
"intitule"
>
{{'role_intitule_label' | translate}}
</label>
<input
name=
"intitule"
type=
"text"
[(
ngModel
)]="
role
.
intitule
"
(
change
)="
editTrace
($
event
,'
name
'
);
validTutorialPhase4
();"
[
placeholder
]="
translate
.
instant
('
role_intitule_placeholder
')"
<input
name=
"intitule"
type=
"text"
[(
ngModel
)]="
role
.
intitule
"
(
change
)="
changeIntitule
($
event
);
validTutorialPhase4
();"
[
placeholder
]="
translate
.
instant
('
role_intitule_placeholder
')"
[
matTooltip
]="
translate
.
instant
('
role_intitule_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
/>
</div>
...
...
src/app/pieces/role/role.component.ts
View file @
04fdadf0
...
...
@@ -21,6 +21,8 @@ import { Trace } from 'src/app/class/trace/trace';
import
{
MinimapService
}
from
'src/app/services/minimap/minimap.service'
;
import
{
TranslateService
}
from
'@ngx-translate/core'
;
import
{
TutorialService
}
from
'src/app/services/tutorial/tutorial.service'
;
import
{
MatSnackBar
}
from
'@angular/material/snack-bar'
;
import
{
RoleNameDuplicateComponent
}
from
'src/app/components/snackbars/role-name-duplicate/role-name-duplicate.component'
;
@
Component
({
selector
:
'app-role'
,
...
...
@@ -35,7 +37,7 @@ export class RoleComponent implements OnInit {
@
Input
()
i
:
number
=
0
;
@
Input
()
missionIndex
:
number
=
0
;
constructor
(
protected
pieceDetailsService
:
PieceDetailsService
,
protected
tooltipService
:
TooltipService
,
public
dialog
:
MatDialog
,
private
minimapService
:
MinimapService
,
protected
translate
:
TranslateService
,
private
tutorialService
:
TutorialService
)
{
}
constructor
(
protected
pieceDetailsService
:
PieceDetailsService
,
protected
tooltipService
:
TooltipService
,
public
dialog
:
MatDialog
,
private
minimapService
:
MinimapService
,
protected
translate
:
TranslateService
,
private
tutorialService
:
TutorialService
,
private
_snackBar
:
MatSnackBar
,
)
{
}
ngOnInit
():
void
{
this
.
mission
.
equalizeLengths
();
...
...
@@ -293,4 +295,14 @@ export class RoleComponent implements OnInit {
this
.
tutorialService
.
validPhase
();
}
}
changeIntitule
(
event
:
any
):
void
{
this
.
mission
.
roles
.
forEach
(
role
=>
{
if
(
role
!=
this
.
role
&&
role
.
intitule
==
this
.
role
.
intitule
)
{
this
.
_snackBar
.
openFromComponent
(
RoleNameDuplicateComponent
,
{
duration
:
5000
});
this
.
role
.
intitule
=
''
;
}
});
this
.
editTrace
(
event
,
'name'
);
}
}
src/app/pieces/tasks/annexe-task/annexe-task.component.html
View file @
04fdadf0
...
...
@@ -113,7 +113,7 @@
<div
class=
"piece-form"
>
<div
class=
"piece-form-top"
>
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
value
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
(
ngModel
)
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
[
matTooltip
]="
translate
.
instant
('
task_identifier_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
/>
<div
class=
"piece-form-top-title"
>
{{'annexeTask_title' | translate}}
</div>
...
...
src/app/pieces/tasks/annexe-task/annexe-task.component.ts
View file @
04fdadf0
...
...
@@ -265,7 +265,6 @@ export class AnnexeTaskComponent implements OnInit {
});
});
}
this
.
task
.
identifier
=
value
;
if
(
this
.
role
.
isAlreadyUsedIdentifier
(
this
.
task
.
identifier
))
{
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
...
...
src/app/pieces/tasks/final-task/final-task.component.html
View file @
04fdadf0
...
...
@@ -141,7 +141,7 @@
<div
class=
"piece-form"
>
<div
class=
"piece-form-top"
>
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
value
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
(
ngModel
)
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
[
matTooltip
]="
translate
.
instant
('
task_identifier_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
/>
<div
class=
"piece-form-top-title"
>
{{'finalTask_title' | translate}}
</div>
...
...
src/app/pieces/tasks/final-task/final-task.component.ts
View file @
04fdadf0
...
...
@@ -273,7 +273,6 @@ export class FinalTaskComponent implements OnInit {
});
});
}
this
.
task
.
identifier
=
value
;
if
(
this
.
role
.
isAlreadyUsedIdentifier
(
this
.
task
.
identifier
))
{
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
...
...
src/app/pieces/tasks/optionnal-task/optionnal-task.component.html
View file @
04fdadf0
...
...
@@ -142,7 +142,7 @@
<div
class=
"piece-form"
>
<div
class=
"piece-form-top"
>
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
value
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
(
ngModel
)
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
[
matTooltip
]="
translate
.
instant
('
task_identifier_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
/>
<div
class=
"piece-form-top-title"
>
{{'optionnalTask_title1' | translate}}
<br>
{{'optionnalTask_title2' | translate}}
</div>
...
...
src/app/pieces/tasks/optionnal-task/optionnal-task.component.ts
View file @
04fdadf0
...
...
@@ -290,7 +290,6 @@ export class OptionnalTaskComponent implements OnInit {
});
});
}
this
.
task
.
identifier
=
value
;
if
(
this
.
role
.
isAlreadyUsedIdentifier
(
this
.
task
.
identifier
))
{
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
...
...
src/app/pieces/tasks/random-event/random-event.component.html
View file @
04fdadf0
...
...
@@ -130,7 +130,7 @@
<div
class=
"piece-form"
>
<div
class=
"piece-form-top"
>
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
value
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
(
ngModel
)
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
[
matTooltip
]="
translate
.
instant
('
task_identifier_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
/>
<div
class=
"piece-form-top-title"
>
{{'randomEvent_title1' | translate}}
<br>
{{'randomEvent_title2' | translate}}
</div>
...
...
src/app/pieces/tasks/random-event/random-event.component.ts
View file @
04fdadf0
...
...
@@ -267,7 +267,6 @@ export class RandomEventComponent implements OnInit {
});
});
}
this
.
task
.
identifier
=
value
;
if
(
this
.
role
.
isAlreadyUsedIdentifier
(
this
.
task
.
identifier
))
{
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
...
...
src/app/pieces/tasks/task/task.component.html
View file @
04fdadf0
...
...
@@ -140,7 +140,7 @@
<div
class=
"piece-form"
>
<div
class=
"piece-form-top"
>
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
value
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
<input
class=
"piece-form-top-identifier"
name=
"identifier"
type=
"text"
[
(
ngModel
)
]="
task
.
identifier
"
(
change
)="
changeIdentifier
($
event
)"
placeholder=
"A"
min=
"1"
maxlength=
"5"
[
matTooltip
]="
translate
.
instant
('
task_identifier_tooltip
')"
matTooltipPosition=
"above"
[
matTooltipDisabled
]="!
tooltipService
.
activatedTooltips
"
/>
<div
class=
"piece-form-top-title"
>
{{'normalTask_title' | translate}}
</div>
...
...
src/app/pieces/tasks/task/task.component.ts
View file @
04fdadf0
...
...
@@ -307,7 +307,6 @@ export class TaskComponent implements OnInit {
});
});
}
this
.
task
.
identifier
=
value
;
if
(
this
.
role
.
isAlreadyUsedIdentifier
(
this
.
task
.
identifier
))
{
this
.
_snackBar
.
openFromComponent
(
IdentifierSnackbarComponent
,
{
duration
:
5000
});
this
.
task
.
identifier
=
''
;
...
...
src/assets/lang/en.json
View file @
04fdadf0
...
...
@@ -26,6 +26,7 @@
"snackbar_identifier"
:
"Attention, this identifier is already used in this Role."
,
"snackbar_loading_fail"
:
"File upload failed."
,
"snackbar_loading_success"
:
"File upload successful."
,
"snackbar_roleName"
:
"Attention, this title is already used in this Mission"
,
"siderTitle_game"
:
"Game"
,
"siderTitle_mission"
:
"Mission"
,
...
...
src/assets/lang/fr.json
View file @
04fdadf0
...
...
@@ -26,6 +26,7 @@
"snackbar_identifier"
:
"Attention, cet identifiant est déjà utilisé dans ce Rôle"
,
"snackbar_loading_fail"
:
"Chargement du fichier échoué"
,
"snackbar_loading_success"
:
"Chargement du fichier réussi"
,
"snackbar_roleName"
:
"Attention, cet intitulé est déjà utilisé dans cette Mission"
,
"siderTitle_game"
:
"Jeu"
,
"siderTitle_mission"
:
"Mission"
,
...
...
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