Skip to content

Commit 4018561

Browse files
committed
Fixes #103, re-adding clickurl to component view
1 parent ec18876 commit 4018561

File tree

4 files changed

+23
-15
lines changed

4 files changed

+23
-15
lines changed

src/Our.Umbraco.TheDashboard/Client/src/dashboard/the-dashboard.element.ts

+18-12
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,25 @@ export class TheDashboardDashboardElement extends UmbElementMixin(LitElement) {
165165
${when(this.counters,()=>html`
166166
${repeat(this.counters!.counters,
167167
(item)=>item.text,
168-
(counter)=>html`
169-
<div class="counter">
170-
<div>
171-
<span class="dot ${counter.style}">${counter.count}</span>
172-
</div>
173-
<div>
174-
<p>
175-
${when(counter.localizationKey,()=>html`${this.localize.term(counter.localizationKey)}`)}
176-
${when(!counter.localizationKey,()=>html`${counter.text}`)}
177-
</p>
168+
(counter)=>{
169+
170+
const text = counter.localizationKey != '' ? this.localize.term(counter.localizationKey) : counter.text;
171+
172+
return html`
173+
<div class="counter">
174+
<div>
175+
<span class="dot ${counter.style}">${counter.count}</span>
176+
</div>
177+
<div>
178+
<p>
179+
${when(counter.clickUrl,
180+
()=>html`<a href=${counter.clickUrl}>${text}</a>`,
181+
()=>html`${text}`
182+
)}
183+
</p>
184+
</div>
178185
</div>
179-
</div>
180-
`)}
186+
`})}
181187
`)}
182188
</div>
183189
</div>

src/Our.Umbraco.TheDashboard/Counters/DashboardCounterModel.cs

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ public DashboardCounterModel()
2626
public string ClickUrl { get; set; }
2727

2828
/// <summary>
29-
/// Provides a way to "click" on a element in the backoffice UI by providing a CSS selector. Ie. *[data-element=tab-contentIntro] > a to show the intro dashboard.
29+
/// Provides a way to "click" on an element in the backoffice UI by providing a CSS selector.
30+
/// Ie. *[data-element=tab-contentIntro] > a to show the intro dashboard.
3031
/// </summary>
32+
[Obsolete("This not in use since v14, will be removed in the future")]
3133
public string ClickElement { get; set; }
3234

3335
public string Style { get; set; }

src/Our.Umbraco.TheDashboard/Counters/Implement/MembersNewLastWeekDashboardCounter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public DashboardCounterModel GetModel(IScope scope)
1919
{
2020
LocalizationKey = "theDashboard_newMembersLastWeek",
2121
Count = count,
22-
ClickUrl = "section/member-management",
22+
ClickUrl = "section/member-management/workspace/member-root",
2323
Style = DashboardCounterModel.CounterStyles.Selected
2424
};
2525
}

src/Our.Umbraco.TheDashboard/Counters/Implement/MembersTotalDashboardCounter.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public DashboardCounterModel GetModel(IScope scope)
1616
{
1717
LocalizationKey = "theDashboard_membersOnWebsite",
1818
Count = count,
19-
ClickUrl = "section/member-management",
19+
ClickUrl = "section/member-management/workspace/member-root",
2020
Style = DashboardCounterModel.CounterStyles.Selected
2121
};
2222
}

0 commit comments

Comments
 (0)