Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
867
Issues
867
List
Boards
Labels
Service Desk
Milestones
Merge Requests
53
Merge Requests
53
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
d986f5b2
Commit
d986f5b2
authored
1 hour ago
by
Olivia Madrid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat): Media modal - add feature flag
parent
44e3c610
feat/media-modal-1539
1 merge request
!467
[Sprint/KiltedKoala](feat): Media modal
Pipeline
#77154711
passed with stages
in 51 minutes and 10 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
41 deletions
+49
-41
activity.ts
src/app/modules/legacy/components/cards/activity/activity.ts
+21
-15
remind.ts
src/app/modules/legacy/components/cards/remind/remind.ts
+21
-16
modal.component.html
src/app/modules/media/modal/modal.component.html
+1
-1
modal.component.ts
src/app/modules/media/modal/modal.component.ts
+6
-9
No files found.
src/app/modules/legacy/components/cards/activity/activity.ts
View file @
d986f5b2
...
...
@@ -27,6 +27,7 @@ import { ActivityAnalyticsOnViewService } from "./activity-analytics-on-view.ser
import
{
NewsfeedService
}
from
"
../../../../newsfeed/services/newsfeed.service
"
;
import
{
ClientMetaService
}
from
"
../../../../../common/services/client-meta.service
"
;
import
{
AutocompleteSuggestionsService
}
from
"
../../../../suggestions/services/autocomplete-suggestions.service
"
;
import
{
FeaturesService
}
from
'
../../../../../services/features.service
'
;
import
isMobile
from
'
../../../../../helpers/is-mobile
'
;
@
Component
({
...
...
@@ -119,6 +120,7 @@ export class Activity implements OnInit {
protected
activityAnalyticsOnViewService
:
ActivityAnalyticsOnViewService
,
protected
newsfeedService
:
NewsfeedService
,
protected
clientMetaService
:
ClientMetaService
,
protected
featuresService
:
FeaturesService
,
public
suggestions
:
AutocompleteSuggestionsService
,
@
SkipSelf
()
injector
:
Injector
,
elementRef
:
ElementRef
,
...
...
@@ -448,25 +450,29 @@ export class Activity implements OnInit {
}
showMediaModal
()
{
// Mobile (not tablet) users go to media page instead of modal
if
(
isMobile
()
&&
Math
.
min
(
screen
.
width
,
screen
.
height
)
<
768
)
{
this
.
router
.
navigate
([
`/media/
${
this
.
activity
.
entity_guid
}
`
]);
}
if
(
this
.
featuresService
.
has
(
'
media-modal
'
))
{
// Mobile (not tablet) users go to media page instead of modal
if
(
isMobile
()
&&
Math
.
min
(
screen
.
width
,
screen
.
height
)
<
768
)
{
this
.
router
.
navigate
([
`/media/
${
this
.
activity
.
entity_guid
}
`
]);
}
if
(
this
.
activity
.
custom_type
===
'
video
'
)
{
this
.
activity
.
custom_data
.
dimensions
=
this
.
videoDimensions
;
}
else
{
// Image
// Set image dimensions if they're not already there
if
(
this
.
activity
.
custom_data
[
0
].
width
===
'
0
'
||
this
.
activity
.
custom_data
[
0
].
height
===
'
0
'
)
{
this
.
setImageDimensions
();
if
(
this
.
activity
.
custom_type
===
'
video
'
)
{
this
.
activity
.
custom_data
.
dimensions
=
this
.
videoDimensions
;
}
else
{
// Image
// Set image dimensions if they're not already there
if
(
this
.
activity
.
custom_data
[
0
].
width
===
'
0
'
||
this
.
activity
.
custom_data
[
0
].
height
===
'
0
'
)
{
this
.
setImageDimensions
();
}
}
}
this
.
activity
.
modal_source_url
=
this
.
router
.
url
;
this
.
activity
.
modal_source_url
=
this
.
router
.
url
;
this
.
overlayModal
.
create
(
MediaModalComponent
,
this
.
activity
,
{
class
:
'
m-overlayModal--media
'
}).
present
();
this
.
overlayModal
.
create
(
MediaModalComponent
,
this
.
activity
,
{
class
:
'
m-overlayModal--media
'
}).
present
();
}
else
{
this
.
router
.
navigate
([
`/media/
${
this
.
activity
.
entity_guid
}
`
]);
}
}
detectChanges
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/legacy/components/cards/remind/remind.ts
View file @
d986f5b2
...
...
@@ -16,7 +16,7 @@ import { Session } from '../../../../../services/session';
import
{
AttachmentService
}
from
'
../../../../../services/attachment
'
;
import
{
OverlayModalService
}
from
'
../../../../../services/ux/overlay-modal
'
;
import
{
MediaModalComponent
}
from
'
../../../../media/modal/modal.component
'
;
import
{
FeaturesService
}
from
'
../../../../../services/features.service
'
;
import
isMobile
from
'
../../../../../helpers/is-mobile
'
;
@
Component
({
...
...
@@ -60,6 +60,7 @@ export class Remind {
private
changeDetectorRef
:
ChangeDetectorRef
,
private
overlayModal
:
OverlayModalService
,
private
router
:
Router
,
protected
featuresService
:
FeaturesService
,
)
{
this
.
hideTabs
=
true
;
}
...
...
@@ -159,24 +160,28 @@ export class Remind {
}
showMediaModal
()
{
// Mobile (not tablet) users go to media page instead of modal
if
(
isMobile
()
&&
Math
.
min
(
screen
.
width
,
screen
.
height
)
<
768
)
{
this
.
router
.
navigate
([
`/media/
${
this
.
activity
.
entity_guid
}
`
]);
}
if
(
this
.
featuresService
.
has
(
'
media-modal
'
))
{
// Mobile (not tablet) users go to media page instead of modal
if
(
isMobile
()
&&
Math
.
min
(
screen
.
width
,
screen
.
height
)
<
768
)
{
this
.
router
.
navigate
([
`/media/
${
this
.
activity
.
entity_guid
}
`
]);
}
if
(
this
.
activity
.
custom_type
===
'
video
'
)
{
this
.
activity
.
custom_data
.
dimensions
=
this
.
videoDimensions
;
}
else
{
// Image
// Set image dimensions if they're not already there
if
(
!
this
.
activity
.
custom_data
[
0
].
width
||
!
this
.
activity
.
custom_data
[
0
].
height
)
{
this
.
setImageDimensions
();
if
(
this
.
activity
.
custom_type
===
'
video
'
)
{
this
.
activity
.
custom_data
.
dimensions
=
this
.
videoDimensions
;
}
else
{
// Image
// Set image dimensions if they're not already there
if
(
this
.
activity
.
custom_data
[
0
].
width
===
'
0
'
||
this
.
activity
.
custom_data
[
0
].
height
===
'
0
'
)
{
this
.
setImageDimensions
();
}
}
}
this
.
activity
.
modal_source_url
=
this
.
router
.
url
;
this
.
activity
.
modal_source_url
=
this
.
router
.
url
;
this
.
overlayModal
.
create
(
MediaModalComponent
,
this
.
activity
,
{
class
:
'
m-overlayModal--media
'
}).
present
();
this
.
overlayModal
.
create
(
MediaModalComponent
,
this
.
activity
,
{
class
:
'
m-overlayModal--media
'
}).
present
();
}
else
{
this
.
router
.
navigate
([
`/media/
${
this
.
activity
.
entity_guid
}
`
]);
}
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/media/modal/modal.component.html
View file @
d986f5b2
...
...
@@ -150,7 +150,7 @@
m-read-more
*ngIf=
"hasMessage"
[maxHeightAllowed]=
"136"
>
<span
class=
"m-mature-message-content"
[innerHtml]=
"
entity.
message | tags"
>
<span
class=
"m-mature-message-content"
[innerHtml]=
"message | tags"
>
</span>
<m-read-more--button></m-read-more--button>
</div>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/media/modal/modal.component.ts
View file @
d986f5b2
...
...
@@ -70,6 +70,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
ownerIconTime
:
string
=
''
;
permalinkGuid
:
string
=
''
;
hasMessage
:
boolean
=
true
;
message
:
string
=
''
;
// Used for backdrop click detection hack
isOpen
:
boolean
=
false
;
...
...
@@ -105,18 +106,18 @@ export class MediaModalComponent implements OnInit, OnDestroy {
this
.
boosted
=
this
.
entity
.
boosted
||
this
.
entity
.
p2p_boosted
;
// Set title
if
(
!
this
.
entity
.
title
)
{
if
(
!
this
.
entity
.
message
)
{
if
(
!
this
.
entity
.
title
)
{
if
(
!
this
.
entity
.
message
)
{
this
.
title
=
`
${
this
.
entity
.
ownerObj
.
name
}
's post`
;
this
.
hasMessage
=
false
;
}
else
{
this
.
title
=
this
.
entity
.
message
;
}
}
else
{
this
.
title
=
this
.
entity
.
title
;
this
.
hasMessage
=
false
;
}
this
.
entity
.
message
=
this
.
hasMessage
?
this
.
title
:
null
;
this
.
message
=
this
.
hasMessage
?
this
.
title
:
null
;
// Set ownerIconTime
const
session
=
this
.
session
.
getLoggedInUser
();
...
...
@@ -178,10 +179,6 @@ export class MediaModalComponent implements OnInit, OnDestroy {
this
.
aspectRatio
=
this
.
entity
.
width
/
this
.
entity
.
height
;
this
.
calculateDimensions
();
// ! TEMP
console
.
log
(
this
.
entity
);
}
// Re-calculate height/width when window resizes
...
...
@@ -409,7 +406,7 @@ export class MediaModalComponent implements OnInit, OnDestroy {
// * TABLETS ONLY: SHOW OVERLAY & VIDEO CONTROLS * -------------------------------------------
// Briefly display title overlay and video controls
for 3 secs
when finished loading and stage touch
// Briefly display title overlay and video controls when finished loading and stage touch
showOverlays
()
{
this
.
onMouseEnterStage
();
...
...
This diff is collapsed.
Click to expand it.
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