import SubPage from './subpage'; erpnext.hub.Profile = class Profile extends SubPage { make_wrapper() { super.make_wrapper(); } refresh() { this.get_hub_seller_profile(this.keyword) .then(profile => this.render(profile)); } get_hub_seller_profile() { return hub.call('get_hub_seller_profile', { hub_seller: hub.settings.company_email }); } render(profile) { const p = profile; const content_by_log_type = this.get_content_by_log_type(); let activity_logs = (p.hub_seller_activity || []).sort((a, b) => { return new Date(b.creation) - new Date(a.creation); }); const timeline_items_html = activity_logs .map(log => { const stats = JSON.parse(log.stats); const no_of_items = stats && stats.push_update || ''; const content = content_by_log_type[log.type]; const message = content.get_message(no_of_items); const icon = content.icon; return this.get_timeline_log_item(log.pretty_date, message, icon); }) .join(''); const profile_html = `
${p.country}
${p.site_name}
${p.company_description}
` : `__('No description')