...
 
Commits (8)
......@@ -25,6 +25,7 @@
[dndDraggable]="item"
[dndEffectAllowed]="'move'"
[dndDragImageOffsetFunction]="dragImageOffsetRight"
[dndDisableIf]="disabled"
class="m-draggableList__listItem"
>
<ng-container
......
......@@ -22,6 +22,7 @@ export class DraggableListComponent {
@Input() dndEffectAllowed: EffectAllowed = 'copyMove';
@Input() id: string;
@Input() headers: string[];
@Input() disabled: boolean;
@ContentChild(TemplateRef, { static: false }) template: TemplateRef<any>;
@Output() emptyListHeaderRowClicked: EventEmitter<any> = new EventEmitter();
@Output() arrayChanged: EventEmitter<any> = new EventEmitter();
......@@ -77,4 +78,19 @@ export class DraggableListComponent {
y: event.offsetY + 10,
};
};
/**
* If input is focused then disable dragging
*/
onFocusIn(e: FocusEvent | MouseEvent) {
this.disabled = true;
}
/**
* Re-enable when input not focused
* TODO: Make this smarter.. what if something else disabled the dragging?
*/
onFocusOut(e: FocusEvent | MouseEvent) {
this.disabled = false;
}
}
......@@ -148,6 +148,10 @@ export class ChannelSortedComponent implements OnInit {
return;
}
if (activity.time_created > Date.now() / 1000) {
this.scheduledCount += 1;
}
this.entities.unshift(activity);
let feedItem = {
......
......@@ -117,7 +117,9 @@
>
<div
class="m-media-content--play-count"
*ngIf="entity['play:count'] || entity['play:count'] === 0"
*ngIf="
(false && entity['play:count']) || entity['play:count'] === 0
"
>
<span i18n="@@MINDS__MEDIA__PLAYS_COUNTER"
>{{ entity['play:count'] | number }} plays</span
......
......@@ -559,6 +559,7 @@
[id]="'tag'"
(emptyListHeaderRowClicked)="addBlankTag()"
(arrayChanged)="setTags($event)"
#hashtagDraggable
>
<ng-template let-tag="item" let-i="i">
<ng-container [formGroupName]="i">
......@@ -569,6 +570,10 @@
[name]="'tag[' + i + '][label]'"
formControlName="label"
autofocus
(focusin)="hashtagDraggable.onFocusIn($event)"
(focusout)="hashtagDraggable.onFocusOut($event)"
(mouseover)="hashtagDraggable.onFocusIn($event)"
(mouseout)="hashtagDraggable.onFocusOut($event)"
/>
<input
class="m-draggableList__cell form-control"
......@@ -576,6 +581,10 @@
[id]="'tag-tag-' + i"
[name]="'tag[' + i + '][tag]'"
formControlName="tag"
(focusin)="hashtagDraggable.onFocusIn($event)"
(focusout)="hashtagDraggable.onFocusOut($event)"
(mouseover)="hashtagDraggable.onFocusIn($event)"
(mouseout)="hashtagDraggable.onFocusOut($event)"
/>
</ng-container>
</ng-template>
......@@ -622,6 +631,7 @@
[id]="'title'"
(emptyListHeaderRowClicked)="addBlankFooterLink()"
(arrayChanged)="setFooterLinks($event)"
#footerDraggable
>
<ng-template let-link="item" let-i="i">
<ng-container [formGroupName]="i">
......@@ -632,6 +642,10 @@
[name]="'footer_link[' + i + '][title]'"
formControlName="title"
autofocus
(focusin)="footerDraggable.onFocusIn($event)"
(focusout)="footerDraggable.onFocusOut($event)"
(mouseover)="footerDraggable.onFocusIn($event)"
(mouseout)="footerDraggable.onFocusOut($event)"
/>
<input
......@@ -640,6 +654,10 @@
[id]="'footer_link-href-' + i"
[name]="'footer_link[' + i + '][href]'"
formControlName="href"
(focusin)="footerDraggable.onFocusIn($event)"
(focusout)="footerDraggable.onFocusOut($event)"
(mouseover)="footerDraggable.onFocusIn($event)"
(mouseout)="footerDraggable.onFocusOut($event)"
/>
</ng-container>
</ng-template>
......
......@@ -69,5 +69,157 @@ const fakeData = {
},
],
},
token_transactions: {
current_total: 25.0,
filters: [
{
id: 'transaction_types',
label: 'Transaction Types',
options: [
{
id: 'all',
label: 'All',
selected: true,
},
{
id: 'offchain_wire',
label: 'Off-Chain Wire',
selected: false,
},
{
id: 'onchain_wire',
label: 'On-Chain Wire',
selected: false,
},
{
id: 'rewards',
label: 'Rewards',
selected: false,
},
{
id: 'purchases',
label: 'Purchases',
selected: false,
},
{
id: 'boost',
label: 'Boost',
selected: false,
},
{
id: 'onchain_transfer',
label: 'On-Chain Transfer',
selected: false,
},
],
},
],
pending: {
total_points: 7,
contributions: [
{ id: 'checkins', label: 'Check-ins', occurrences: 1, points: 2 },
{ id: 'comments', label: 'Comments', occurrences: 2, points: 4 },
{ id: 'votes', label: 'Votes', occurrences: 1, points: 1 },
],
},
days: [
{
ts_ms: 1567296000000, // today's date
transactions: [
{
ts_ms: 1567296000090, // time of tx
type_id: 'boosts',
type_label: 'Boosts',
diff: -5.0,
running_total: 25.0,
},
{
ts_ms: 1567296000080,
type_id: 'rewards',
type_label: 'Rewards',
diff: 0.4,
running_total: 30.0,
details: {
total_points: 10,
contributions: [
{
id: 'checkins',
label: 'Check-ins',
occurrences: 4,
points: 8,
},
{
id: 'comments',
label: 'Comments',
occurrences: 1,
points: 2,
},
],
},
},
{
ts_ms: 1567296000070,
type_id: 'wires',
type_label: 'Wires', // make sure we have the label field bc this eventually needs to change to 'Pay'
diff: -1.5,
running_total: 29.6,
subtype_id: 'offchain_wires_outbound',
entity: {
user_guid: 123,
username: 'my_wire_recipient',
//...etc...
},
},
{
ts_ms: 1567296000060,
type_id: 'wires',
type_label: 'Wires',
diff: 2.0,
running_total: 30.1,
subtype_id: 'offchain_wires_inbound',
entity: {
user_guid: 456,
username: 'whoever_wired_me',
//...etc...
},
},
],
},
{
ts_ms: 1567295000000, // yesterday's date
transactions: [
{
ts_ms: 1567295000090,
type_id: 'purchases',
type_label: 'Purchases',
diff: -10.0,
running_total: 28.1,
subtype_id: 'minds_pro_membership',
},
{
ts_ms: 1567295000080,
type_id: 'rewards',
type_label: 'Rewards',
diff: 0.9,
running_total: 38.1,
details: {
total_points: 50,
contributions: [
{
id: 'jury_duty',
label: 'Jury Duty',
occurrences: 2,
points: 50,
},
],
},
},
],
},
// days go on...
],
load_next: '',
status: 'success',
},
};
export default fakeData;
......@@ -4,7 +4,14 @@ export class Storage {
}
get(key: string) {
return window.localStorage.getItem(key);
try {
return window.localStorage.getItem(key);
} catch (err) {
// We are catching here as some browser block localstorege.
// TODO: Extend to .set and .destroy once this is verified as fix
console.log(err);
return null;
}
}
set(key: string, value: any) {
return window.localStorage.setItem(key, value);
......