Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1a52a014
Commit
1a52a014
authored
Jul 06, 2021
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate analytics dateformat methods to ce
Moves the shared analytics dateFormat functions to CE for reuse.
parent
93a5f2a6
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
22 additions
and
21 deletions
+22
-21
app/assets/javascripts/analytics/shared/constants.js
app/assets/javascripts/analytics/shared/constants.js
+9
-0
ee/app/assets/javascripts/analytics/cycle_analytics/components/duration_chart.vue
...s/analytics/cycle_analytics/components/duration_chart.vue
+1
-1
ee/app/assets/javascripts/analytics/cycle_analytics/store/getters.js
...ts/javascripts/analytics/cycle_analytics/store/getters.js
+1
-1
ee/app/assets/javascripts/analytics/cycle_analytics/utils.js
ee/app/assets/javascripts/analytics/cycle_analytics/utils.js
+1
-1
ee/app/assets/javascripts/analytics/merge_request_analytics/components/app.vue
...ipts/analytics/merge_request_analytics/components/app.vue
+1
-1
ee/app/assets/javascripts/analytics/merge_request_analytics/components/throughput_table.vue
...s/merge_request_analytics/components/throughput_table.vue
+1
-1
ee/app/assets/javascripts/analytics/merge_request_analytics/utils.js
...ts/javascripts/analytics/merge_request_analytics/utils.js
+1
-1
ee/app/assets/javascripts/analytics/productivity_analytics/components/app.vue
...ripts/analytics/productivity_analytics/components/app.vue
+1
-1
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/filters/getters.js
...s/productivity_analytics/store/modules/filters/getters.js
+1
-1
ee/app/assets/javascripts/analytics/productivity_analytics/utils.js
...ets/javascripts/analytics/productivity_analytics/utils.js
+1
-1
ee/app/assets/javascripts/analytics/shared/components/scatterplot.vue
...s/javascripts/analytics/shared/components/scatterplot.vue
+2
-1
ee/app/assets/javascripts/analytics/shared/constants.js
ee/app/assets/javascripts/analytics/shared/constants.js
+0
-9
ee/app/assets/javascripts/analytics/shared/utils.js
ee/app/assets/javascripts/analytics/shared/utils.js
+1
-1
ee/app/assets/javascripts/threat_monitoring/components/constants.js
...ets/javascripts/threat_monitoring/components/constants.js
+1
-1
No files found.
app/assets/javascripts/analytics/shared/constants.js
View file @
1a52a014
import
{
masks
}
from
'
dateformat
'
;
export
const
DATE_RANGE_LIMIT
=
180
;
export
const
OFFSET_DATE_BY_ONE
=
1
;
export
const
PROJECTS_PER_PAGE
=
50
;
const
{
isoDate
,
mediumDate
}
=
masks
;
export
const
dateFormats
=
{
isoDate
,
defaultDate
:
mediumDate
,
defaultDateTime
:
'
mmm d, yyyy h:MMtt
'
,
};
ee/app/assets/javascripts/analytics/cycle_analytics/components/duration_chart.vue
View file @
1a52a014
<
script
>
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
mapActions
,
mapState
,
mapGetters
}
from
'
vuex
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
__
}
from
'
~/locale
'
;
import
ChartSkeletonLoader
from
'
~/vue_shared/components/resizable_chart/skeleton_loader.vue
'
;
import
Scatterplot
from
'
../../shared/components/scatterplot.vue
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
StageDropdownFilter
from
'
./stage_dropdown_filter.vue
'
;
export
default
{
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/store/getters.js
View file @
1a52a014
import
dateFormat
from
'
dateformat
'
;
import
{
isNumber
}
from
'
lodash
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
OVERVIEW_STAGE_ID
}
from
'
~/cycle_analytics/constants
'
;
import
{
pathNavigationData
as
basePathNavigationData
}
from
'
~/cycle_analytics/store/getters
'
;
import
{
filterStagesByHiddenStatus
}
from
'
~/cycle_analytics/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
httpStatus
from
'
~/lib/utils/http_status
'
;
import
{
filterToQueryObject
}
from
'
~/vue_shared/components/filtered_search_bar/filtered_search_utils
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
{
DEFAULT_VALUE_STREAM_ID
,
OVERVIEW_STAGE_CONFIG
,
PAGINATION_TYPE
}
from
'
../constants
'
;
export
const
hasNoAccessError
=
(
state
)
=>
state
.
errorCode
===
httpStatus
.
FORBIDDEN
;
...
...
ee/app/assets/javascripts/analytics/cycle_analytics/utils.js
View file @
1a52a014
import
dateFormat
from
'
dateformat
'
;
import
{
isNumber
}
from
'
lodash
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
OVERVIEW_STAGE_ID
}
from
'
~/cycle_analytics/constants
'
;
import
{
medianTimeToParsedSeconds
}
from
'
~/cycle_analytics/utils
'
;
import
createFlash
,
{
hideFlash
}
from
'
~/flash
'
;
...
...
@@ -7,7 +8,6 @@ import { convertObjectPropsToCamelCase } from '~/lib/utils/common_utils';
import
{
newDate
,
dayAfter
,
secondsToDays
,
getDatesInRange
}
from
'
~/lib/utils/datetime_utility
'
;
import
httpStatus
from
'
~/lib/utils/http_status
'
;
import
{
convertToSnakeCase
,
slugify
}
from
'
~/lib/utils/text_utility
'
;
import
{
dateFormats
}
from
'
../shared/constants
'
;
import
{
toYmd
}
from
'
../shared/utils
'
;
const
EVENT_TYPE_LABEL
=
'
label
'
;
...
...
ee/app/assets/javascripts/analytics/merge_request_analytics/components/app.vue
View file @
1a52a014
<
script
>
import
dateFormat
from
'
dateformat
'
;
import
DateRange
from
'
~/analytics/shared/components/daterange.vue
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
UrlSync
from
'
~/vue_shared/components/url_sync.vue
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
{
DEFAULT_NUMBER_OF_DAYS
}
from
'
../constants
'
;
import
FilterBar
from
'
./filter_bar.vue
'
;
import
ThroughputChart
from
'
./throughput_chart.vue
'
;
...
...
ee/app/assets/javascripts/analytics/merge_request_analytics/components/throughput_table.vue
View file @
1a52a014
...
...
@@ -13,10 +13,10 @@ import {
}
from
'
@gitlab/ui
'
;
import
dateFormat
from
'
dateformat
'
;
import
{
mapState
}
from
'
vuex
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
approximateDuration
,
differenceInSeconds
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
s__
,
n__
}
from
'
~/locale
'
;
import
{
filterToQueryObject
}
from
'
~/vue_shared/components/filtered_search_bar/filtered_search_utils
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
{
THROUGHPUT_TABLE_STRINGS
,
MERGE_REQUEST_ID_PREFIX
,
...
...
ee/app/assets/javascripts/analytics/merge_request_analytics/utils.js
View file @
1a52a014
import
dateFormat
from
'
dateformat
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
getMonthNames
,
getDateInPast
,
getDayDifference
,
secondsToDays
,
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
dateFormats
}
from
'
../shared/constants
'
;
import
{
THROUGHPUT_CHART_STRINGS
,
DEFAULT_NUMBER_OF_DAYS
,
UNITS
}
from
'
./constants
'
;
/**
...
...
ee/app/assets/javascripts/analytics/productivity_analytics/components/app.vue
View file @
1a52a014
...
...
@@ -12,10 +12,10 @@ import {
import
{
GlColumnChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
import
{
mapState
,
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
beginOfDayTime
,
endOfDayTime
}
from
'
~/lib/utils/datetime_utility
'
;
import
featureFlagsMixin
from
'
~/vue_shared/mixins/gl_feature_flags_mixin
'
;
import
Scatterplot
from
'
../../shared/components/scatterplot.vue
'
;
import
{
dateFormats
}
from
'
../../shared/constants
'
;
import
urlSyncMixin
from
'
../../shared/mixins/url_sync_mixin
'
;
import
{
chartKeys
}
from
'
../constants
'
;
import
MetricChart
from
'
./metric_chart.vue
'
;
...
...
ee/app/assets/javascripts/analytics/productivity_analytics/store/modules/filters/getters.js
View file @
1a52a014
import
dateFormat
from
'
dateformat
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
getDateInPast
,
beginOfDayTime
,
endOfDayTime
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
dateFormats
}
from
'
../../../../shared/constants
'
;
import
{
chartKeys
,
scatterPlotAddonQueryDays
}
from
'
../../../constants
'
;
/**
...
...
ee/app/assets/javascripts/analytics/productivity_analytics/utils.js
View file @
1a52a014
import
dateFormat
from
'
dateformat
'
;
import
{
flatten
}
from
'
lodash
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
getDayDifference
,
getDateInPast
}
from
'
~/lib/utils/datetime_utility
'
;
import
{
median
}
from
'
~/lib/utils/number_utils
'
;
import
{
dateFormats
}
from
'
../shared/constants
'
;
/**
* Gets the labels endpoint for a given group or project
...
...
ee/app/assets/javascripts/analytics/shared/components/scatterplot.vue
View file @
1a52a014
<
script
>
import
{
GlDiscreteScatterChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
dateFormat
from
'
dateformat
'
;
import
{
scatterChartLineProps
,
dateFormats
}
from
'
../constants
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
scatterChartLineProps
}
from
'
../constants
'
;
export
default
{
components
:
{
...
...
ee/app/assets/javascripts/analytics/shared/constants.js
View file @
1a52a014
import
{
masks
}
from
'
dateformat
'
;
import
{
DEFAULT_DEBOUNCE_AND_THROTTLE_MS
}
from
'
~/lib/utils/constants
'
;
const
{
isoDate
,
mediumDate
}
=
masks
;
export
const
dateFormats
=
{
isoDate
,
defaultDate
:
mediumDate
,
defaultDateTime
:
'
mmm d, yyyy h:MMtt
'
,
};
export
const
scatterChartLineProps
=
{
default
:
{
type
:
'
line
'
,
...
...
ee/app/assets/javascripts/analytics/shared/utils.js
View file @
1a52a014
import
dateFormat
from
'
dateformat
'
;
import
{
dateFormats
}
from
'
~/analytics/shared/constants
'
;
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
{
capitalizeFirstCharacter
}
from
'
~/lib/utils/text_utility
'
;
import
{
dateFormats
}
from
'
./constants
'
;
export
const
toYmd
=
(
date
)
=>
dateFormat
(
date
,
dateFormats
.
isoDate
);
...
...
ee/app/assets/javascripts/threat_monitoring/components/constants.js
View file @
1a52a014
...
...
@@ -19,7 +19,7 @@ export const COLORS = {
// Reuse existing definitions rather than defining them again here,
// otherwise they could get out of sync.
// See https://gitlab.com/gitlab-org/gitlab-ui/issues/554.
export
{
dateFormats
as
DATE_FORMATS
}
from
'
ee
/analytics/shared/constants
'
;
export
{
dateFormats
as
DATE_FORMATS
}
from
'
~
/analytics/shared/constants
'
;
export
const
POLICY_KINDS
=
{
ciliumNetwork
:
'
CiliumNetworkPolicy
'
,
...
...
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