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
866
Issues
866
List
Boards
Labels
Service Desk
Milestones
Merge Requests
55
Merge Requests
55
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
Compare Revisions
f89d3b67f03819d1250e15bd987afc786ad49035...10dd32d2fce51d6cbb400813aff20e1b64131b5b
Source
10dd32d2fce51d6cbb400813aff20e1b64131b5b
Select Git revision
...
Target
f89d3b67f03819d1250e15bd987afc786ad49035
Select Git revision
Compare
Commits (2)
(fix): Fix standalone vs Minds auth redir
· a23a1366
Emiliano Balbuena
authored
5 hours ago
a23a1366
(chore): Workaround for incompatible routing techniques
· 10dd32d2
Emiliano Balbuena
authored
16 minutes ago
10dd32d2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
7 deletions
+37
-7
channel-container.component.html
...odules/channel-container/channel-container.component.html
+1
-1
channel-container.component.ts
.../modules/channel-container/channel-container.component.ts
+14
-1
channel.component.ts
src/app/modules/pro/channel/channel.component.ts
+6
-1
channel.service.ts
src/app/modules/pro/channel/channel.service.ts
+10
-2
pro.module.ts
src/app/modules/pro/pro.module.ts
+4
-0
settings.component.html
src/app/modules/pro/settings/settings.component.html
+1
-1
settings.component.ts
src/app/modules/pro/settings/settings.component.ts
+1
-1
No files found.
src/app/modules/channel-container/channel-container.component.html
View file @
10dd32d2
<ng-container
*ngIf=
"channel; else loader"
>
<ng-container
*ngIf=
"!channel.pro; else isProChannel"
>
<ng-container
*ngIf=
"!channel.pro
|| isOwner
; else isProChannel"
>
<m-channel
#channelComponent
></m-channel>
</ng-container>
<ng-template
#isProChannel
>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channel-container/channel-container.component.ts
View file @
10dd32d2
import
{
ChangeDetectionStrategy
,
Component
,
OnDestroy
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
Observable
,
Subscription
}
from
'
rxjs
'
;
import
{
Client
}
from
'
../../services/api/client
'
;
import
{
MindsUser
}
from
'
../../interfaces/entities
'
;
import
{
MindsChannelResponse
}
from
'
../../interfaces/responses
'
;
import
{
ChannelComponent
}
from
'
../channels/channel.component
'
;
import
{
ProChannelComponent
}
from
'
../pro/channel/channel.component
'
;
import
{
Session
}
from
'
../../services/session
'
;
@
Component
({
selector
:
'
m-channel-container
'
,
...
...
@@ -28,7 +29,9 @@ export class ChannelContainerComponent implements OnInit, OnDestroy {
constructor
(
protected
route
:
ActivatedRoute
,
protected
router
:
Router
,
protected
client
:
Client
,
protected
session
:
Session
,
)
{
}
...
...
@@ -66,10 +69,20 @@ export class ChannelContainerComponent implements OnInit, OnDestroy {
try
{
const
response
:
MindsChannelResponse
=
await
this
.
client
.
get
(
`api/v1/channel/
${
this
.
username
}
`
)
as
MindsChannelResponse
;
this
.
channel
=
response
.
channel
;
// NOTE: Temporary workaround until channel component supports children routes
if
(
!
window
.
Minds
.
pro
&&
this
.
channel
.
pro
&&
!
this
.
isOwner
)
{
this
.
router
.
navigate
([
'
/pro
'
,
this
.
channel
.
username
],
{
replaceUrl
:
true
});
}
}
catch
(
e
)
{
console
.
error
(
e
);
}
this
.
inProgress
=
false
;
}
get
isOwner
()
{
const
currentUser
=
this
.
session
.
getLoggedInUser
();
return
this
.
channel
&&
currentUser
&&
this
.
channel
.
guid
==
currentUser
.
guid
;
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.component.ts
View file @
10dd32d2
...
...
@@ -186,7 +186,12 @@ export class ProChannelComponent implements OnInit, AfterViewInit, OnDestroy {
if
(
!
this
.
channel
.
subscribed
)
{
if
(
!
this
.
session
.
isLoggedIn
())
{
this
.
router
.
navigate
(
this
.
channelService
.
getRouterLink
(
'
signup
'
));
this
.
router
.
navigate
(
window
.
Minds
.
pro
?
this
.
channelService
.
getRouterLink
(
'
signup
'
)
:
[
'
/login
'
]
);
return
false
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/channel/channel.service.ts
View file @
10dd32d2
...
...
@@ -8,6 +8,7 @@ import { ProContentModalComponent } from './content-modal/modal.component';
import
{
OverlayModalService
}
from
'
../../../services/ux/overlay-modal
'
;
import
{
BlogView
}
from
"
../../blogs/view/view
"
;
import
{
Session
}
from
'
../../../services/session
'
;
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
export
type
RouterLinkToType
=
'
home
'
|
'
all
'
|
'
feed
'
|
'
videos
'
|
'
images
'
|
'
articles
'
|
'
communities
'
|
'
donate
'
|
'
signup
'
;
...
...
@@ -24,6 +25,7 @@ export class ProChannelService {
protected
client
:
Client
,
protected
entitiesService
:
EntitiesService
,
protected
session
:
Session
,
protected
route
:
ActivatedRoute
,
)
{
}
...
...
@@ -125,7 +127,13 @@ export class ProChannelService {
}
getRouterLink
(
to
:
RouterLinkToType
,
params
?:
{
[
key
:
string
]:
any
}):
any
[]
{
const
route
:
any
[]
=
[
'
/
'
];
let
root
=
'
/
'
;
if
(
this
.
route
.
parent
)
{
root
=
this
.
route
.
parent
.
pathFromRoot
.
map
(
route
=>
route
.
snapshot
.
url
.
map
(
urlSegment
=>
urlSegment
.
toString
()).
join
(
''
)).
join
(
'
/
'
);
}
const
route
:
any
[]
=
[
root
];
if
(
!
window
.
Minds
.
pro
)
{
route
.
push
(
this
.
currentChannel
.
username
);
...
...
@@ -154,7 +162,7 @@ export class ProChannelService {
break
;
case
'
signup
'
:
route
.
push
(
'
signup
'
);
route
.
push
(
'
login
'
);
break
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/pro.module.ts
View file @
10dd32d2
...
...
@@ -68,6 +68,10 @@ routes.push({
path
:
'
settings
'
,
component
:
ProSettingsComponent
,
},
{
path
:
'
:username
'
,
...
channelRoute
}
]
});
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/settings/settings.component.html
View file @
10dd32d2
...
...
@@ -290,7 +290,7 @@
class=
"m-btn m-link-btn m-btn--slim m-pro--settings--preview-btn"
[routerLink]=
"previewRoute"
i18n
>
Go to your
channel
</a>
>
View your Pro
channel
</a>
</div>
</form>
</ng-container>
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/settings/settings.component.ts
View file @
10dd32d2
...
...
@@ -96,7 +96,7 @@ export class ProSettingsComponent implements OnInit {
}
get
previewRoute
()
{
return
[
'
/
'
,
this
.
session
.
getLoggedInUser
().
username
];
return
[
'
/
pro
'
,
this
.
session
.
getLoggedInUser
().
username
];
}
onDragStart
(
event
:
DragEvent
)
{
...
...
This diff is collapsed.
Click to expand it.