Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
868
Issues
868
List
Boards
Labels
Service Desk
Milestones
Merge Requests
45
Merge Requests
45
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
0889ccd9
Commit
0889ccd9
authored
1 hour ago
by
Juan Manuel Solaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(feat) set window title for pro settings and pro channel
parent
056abd51
epic/minds-pro
1 merge request
!459
WIP: (feat): Minds Pro (development branch)
Pipeline
#74982543
failed with stages
in 34 minutes and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
10 deletions
+24
-10
channel.component.ts
src/app/modules/pro/channel/channel.component.ts
+20
-10
settings.component.ts
src/app/modules/pro/settings/settings.component.ts
+4
-0
No files found.
src/app/modules/pro/channel/channel.component.ts
View file @
0889ccd9
...
...
@@ -12,7 +12,7 @@ import { Session } from "../../../services/session";
import
{
Subscription
}
from
"
rxjs
"
;
import
{
MindsUser
}
from
"
../../../interfaces/entities
"
;
import
{
Client
}
from
"
../../../services/api/client
"
;
import
{
Title
}
from
"
@angular/platform-browser
"
;
import
{
MindsTitle
}
from
'
../../../services/ux/title
'
;
import
{
ProChannelService
}
from
'
./channel.service
'
;
@
Component
({
...
...
@@ -48,7 +48,7 @@ export class ProChannelComponent implements OnInit, OnDestroy {
protected
session
:
Session
,
protected
channelService
:
ProChannelService
,
protected
client
:
Client
,
protected
title
:
Title
,
protected
title
:
Minds
Title
,
protected
router
:
Router
,
protected
route
:
ActivatedRoute
,
protected
cd
:
ChangeDetectorRef
,
...
...
@@ -69,6 +69,7 @@ export class ProChannelComponent implements OnInit, OnDestroy {
}
this
.
currentURL
=
navigationEvent
.
urlAfterRedirects
;
this
.
setTitle
();
}
}
catch
(
e
)
{
console
.
error
(
'
Minds: router hook(SearchBar)
'
,
e
);
...
...
@@ -86,6 +87,22 @@ export class ProChannelComponent implements OnInit, OnDestroy {
});
}
setTitle
()
{
const
urlFragments
=
this
.
router
.
url
.
split
(
'
/
'
);
const
fragmentIndex
=
urlFragments
.
findIndex
(
v
=>
v
===
"
juanmsolaro
"
)
+
1
;
let
title
=
this
.
channel
.
pro_settings
.
title
as
string
||
this
.
channel
.
name
;
if
(
this
.
channel
.
pro_settings
.
headline
)
{
title
+=
` -
${
this
.
channel
.
pro_settings
.
headline
}
`
;
}
if
(
urlFragments
[
fragmentIndex
])
{
title
+=
` -
${
urlFragments
[
fragmentIndex
]}
`
;
}
this
.
title
.
setTitle
(
title
);
}
ngOnDestroy
()
{
this
.
params$
.
unsubscribe
();
this
.
routerSubscription
.
unsubscribe
();
...
...
@@ -102,15 +119,8 @@ export class ProChannelComponent implements OnInit, OnDestroy {
try
{
this
.
channel
=
await
this
.
channelService
.
load
(
this
.
username
);
let
title
=
this
.
channel
.
pro_settings
.
title
as
string
||
this
.
channel
.
name
;
this
.
bindCssVariables
();
if
(
this
.
channel
.
pro_settings
.
headline
)
{
title
+=
` -
${
this
.
channel
.
pro_settings
.
headline
}
`
;
}
this
.
title
.
setTitle
(
title
);
this
.
setTitle
();
}
catch
(
e
)
{
this
.
error
=
e
.
getMessage
();
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/pro/settings/settings.component.ts
View file @
0889ccd9
...
...
@@ -2,6 +2,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@
import
{
ProService
}
from
'
../pro.service
'
;
import
{
Session
}
from
'
../../../services/session
'
;
import
{
Router
}
from
'
@angular/router
'
;
import
{
MindsTitle
}
from
'
../../../services/ux/title
'
;
@
Component
({
selector
:
'
m-pro--settings
'
,
...
...
@@ -23,6 +24,7 @@ export class ProSettingsComponent implements OnInit {
protected
session
:
Session
,
protected
router
:
Router
,
protected
cd
:
ChangeDetectorRef
,
protected
title
:
MindsTitle
)
{
}
...
...
@@ -43,6 +45,8 @@ export class ProSettingsComponent implements OnInit {
this
.
settings
=
settings
;
this
.
title
.
setTitle
(
'
Pro Settings
'
);
this
.
inProgress
=
false
;
this
.
detectChanges
();
}
...
...
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