Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
planner-team-one
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
21
Issues
21
List
Board
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
Евгений Положенцев
planner-team-one
Commits
ad861ff7
Commit
ad861ff7
authored
Nov 28, 2022
by
Евгений Положенцев
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#69
fix fixtures
parent
296994dc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
17 deletions
+9
-17
fixtures.ts
planner-api/src/fixtures.ts
+9
-17
No files found.
planner-api/src/fixtures.ts
View file @
ad861ff7
...
...
@@ -8,11 +8,12 @@ import { Member, MemberRole } from "./models/Member";
import
{
DateTimeTask
}
from
"./models/DateTimeTask"
;
function
randomIntFromInterval
(
min
:
number
,
max
:
number
)
{
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
+
1
)
+
min
)
min
=
Math
.
ceil
(
min
);
max
=
Math
.
floor
(
max
);
return
Math
.
floor
(
Math
.
random
()
*
(
max
-
min
)
+
min
);
}
let
countUsers
=
0
let
countMembers
=
0
let
countProjects
=
0
let
countRolesProject
=
0
const
cycleThroughObject
=
(
countKey
:
number
,
objectObserve
:
any
):
MemberRole
=>
{
...
...
@@ -35,15 +36,6 @@ const cycleArrayOfMembers=(countIndex:number, members:Member[]):Member=>{
}
const
cycleArrayOfProjects
=
(
countIndex
:
number
,
projects
:
Project
[]):
Project
=>
{
let
project
=
projects
[
countIndex
]
countIndex
++
if
(
countIndex
===
projects
.
length
-
1
){
countIndex
=
0
}
return
project
}
const
loadFixtures
=
async
()
=>
{
myDataSource
.
initialize
()
...
...
@@ -86,10 +78,10 @@ const loadFixtures = async () => {
for
(
let
i
=
0
;
i
<
20
;
i
++
)
{
let
dateOfMonth
=
randomIntFromInterval
(
20
,
30
)
let
deadLineDateOfMonth
=
randomIntFromInterval
(
1
,
1
5
)
let
startDateTime
=
new
Date
(
2022
,
1
1
,
dateOfMonth
,
randomIntFromInterval
(
10
,
15
),
0
,
0
);
let
dueDateTime
=
new
Date
(
2022
,
1
1
,
dateOfMonth
,
randomIntFromInterval
(
16
,
20
),
0
,
0
);
let
deadLine
=
new
Date
(
2022
,
1
2
,
deadLineDateOfMonth
,
0
,
0
,
0
);
let
deadLineDateOfMonth
=
randomIntFromInterval
(
1
,
1
0
)
let
startDateTime
=
new
Date
(
2022
,
1
0
,
dateOfMonth
,
randomIntFromInterval
(
16
,
21
),
0
,
0
);
let
dueDateTime
=
new
Date
(
2022
,
1
0
,
dateOfMonth
,
randomIntFromInterval
(
22
,
22
),
0
,
0
);
let
deadLine
=
new
Date
(
2022
,
1
1
,
deadLineDateOfMonth
,
0
,
0
,
0
);
const
newDateTimeTask
=
new
DateTimeTask
()
newDateTimeTask
.
dateTimeStart
=
startDateTime
;
newDateTimeTask
.
dateTimeDue
=
dueDateTime
;
...
...
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