Merge pull request #14 from tribalwarshelp/fix/members-table-is-not-100%-width
fix(extendedTribeProfile): the members table isn't 100% wide
This commit is contained in:
commit
64ba476507
7
dist/extendedTribeProfile.js
vendored
7
dist/extendedTribeProfile.js
vendored
|
@ -864,10 +864,11 @@
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$TRIBE_CHANGES_QUERY = "\n query tribeChanges($server: String!, $limit: Int, $offset: Int, $sort: [String!], $filter: TribeChangeFilter!) {\n tribeChanges(server: $server, offset: $offset, limit: $limit, sort: $sort, filter: $filter) {\n total\n items {\n player {\n id\n name\n }\n newTribe {\n id\n tag\n }\n createdAt\n }\n }\n }\n";
|
const $921f485217c0c6d00ec9dfbf07cee198$var$TRIBE_CHANGES_QUERY = "\n query tribeChanges($server: String!, $limit: Int, $offset: Int, $sort: [String!], $filter: TribeChangeFilter!) {\n tribeChanges(server: $server, offset: $offset, limit: $limit, sort: $sort, filter: $filter) {\n total\n items {\n player {\n id\n name\n }\n newTribe {\n id\n tag\n }\n createdAt\n }\n }\n }\n";
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$TRIBE_CHANGES_PAGINATION_CONTAINER_ID = 'tribeChangesPagination';
|
const $921f485217c0c6d00ec9dfbf07cee198$var$TRIBE_CHANGES_PAGINATION_CONTAINER_ID = 'tribeChangesPagination';
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$TRIBE_CHANGES_PER_PAGE = 15;
|
const $921f485217c0c6d00ec9dfbf07cee198$var$TRIBE_CHANGES_PER_PAGE = 15;
|
||||||
|
const $921f485217c0c6d00ec9dfbf07cee198$var$contentValue = document.querySelector('#content_value');
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$profileInfoTBody = document.querySelector('#content_value > table:nth-child(3) > tbody > tr > td:nth-child(1) > table > tbody');
|
const $921f485217c0c6d00ec9dfbf07cee198$var$profileInfoTBody = document.querySelector('#content_value > table:nth-child(3) > tbody > tr > td:nth-child(1) > table > tbody');
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$actionContainer = $921f485217c0c6d00ec9dfbf07cee198$var$profileInfoTBody;
|
const $921f485217c0c6d00ec9dfbf07cee198$var$actionContainer = $921f485217c0c6d00ec9dfbf07cee198$var$profileInfoTBody;
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$otherElementsContainer = document.querySelector('#content_value > table:nth-child(3) > tbody > tr > td:nth-child(2)');
|
const $921f485217c0c6d00ec9dfbf07cee198$var$otherElementsContainer = document.querySelector('#content_value > table:nth-child(3) > tbody > tr > td:nth-child(2)');
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$membersContainer = document.querySelector('#content_value h3').nextElementSibling.querySelector('tbody');
|
const $921f485217c0c6d00ec9dfbf07cee198$var$membersContainer = $921f485217c0c6d00ec9dfbf07cee198$var$contentValue.querySelector('h3').nextElementSibling.querySelector('tbody');
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$translations = $df85c597a30dfe85efd21eb9457ef85e$export$default();
|
const $921f485217c0c6d00ec9dfbf07cee198$var$translations = $df85c597a30dfe85efd21eb9457ef85e$export$default();
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$loadDataFromCache = () => {
|
const $921f485217c0c6d00ec9dfbf07cee198$var$loadDataFromCache = () => {
|
||||||
return $3d935538f644f492fe681e00121114a4$export$getItem($921f485217c0c6d00ec9dfbf07cee198$var$LOCAL_STORAGE_KEY);
|
return $3d935538f644f492fe681e00121114a4$export$getItem($921f485217c0c6d00ec9dfbf07cee198$var$LOCAL_STORAGE_KEY);
|
||||||
|
@ -932,6 +933,7 @@
|
||||||
};
|
};
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$extendMembersData = players => {
|
const $921f485217c0c6d00ec9dfbf07cee198$var$extendMembersData = players => {
|
||||||
$921f485217c0c6d00ec9dfbf07cee198$var$membersContainer.parentElement.style.width = '100%';
|
$921f485217c0c6d00ec9dfbf07cee198$var$membersContainer.parentElement.style.width = '100%';
|
||||||
|
$921f485217c0c6d00ec9dfbf07cee198$var$contentValue.append($921f485217c0c6d00ec9dfbf07cee198$var$membersContainer.parentElement);
|
||||||
const heading = $921f485217c0c6d00ec9dfbf07cee198$var$membersContainer.querySelector('tr:first-child');
|
const heading = $921f485217c0c6d00ec9dfbf07cee198$var$membersContainer.querySelector('tr:first-child');
|
||||||
if (heading.children.length !== 11) {
|
if (heading.children.length !== 11) {
|
||||||
[$921f485217c0c6d00ec9dfbf07cee198$var$translations.oda, $921f485217c0c6d00ec9dfbf07cee198$var$translations.odd, $921f485217c0c6d00ec9dfbf07cee198$var$translations.ods, $921f485217c0c6d00ec9dfbf07cee198$var$translations.od, $921f485217c0c6d00ec9dfbf07cee198$var$translations.dailyGrowth, $921f485217c0c6d00ec9dfbf07cee198$var$translations.playerLinks].forEach(v => {
|
[$921f485217c0c6d00ec9dfbf07cee198$var$translations.oda, $921f485217c0c6d00ec9dfbf07cee198$var$translations.odd, $921f485217c0c6d00ec9dfbf07cee198$var$translations.ods, $921f485217c0c6d00ec9dfbf07cee198$var$translations.od, $921f485217c0c6d00ec9dfbf07cee198$var$translations.dailyGrowth, $921f485217c0c6d00ec9dfbf07cee198$var$translations.playerLinks].forEach(v => {
|
||||||
|
@ -1143,7 +1145,7 @@
|
||||||
createDateLTE,
|
createDateLTE,
|
||||||
createDateGT
|
createDateGT
|
||||||
};
|
};
|
||||||
const data = await $3af05e958b2a20a26445518aba292c50$export$default({
|
return await $3af05e958b2a20a26445518aba292c50$export$default({
|
||||||
query: $921f485217c0c6d00ec9dfbf07cee198$var$TRIBE_MEMBERS_DAILY_STATS_QUERY,
|
query: $921f485217c0c6d00ec9dfbf07cee198$var$TRIBE_MEMBERS_DAILY_STATS_QUERY,
|
||||||
variables: {
|
variables: {
|
||||||
filter,
|
filter,
|
||||||
|
@ -1152,7 +1154,6 @@
|
||||||
server: $921f485217c0c6d00ec9dfbf07cee198$var$SERVER
|
server: $921f485217c0c6d00ec9dfbf07cee198$var$SERVER
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return data;
|
|
||||||
};
|
};
|
||||||
const $921f485217c0c6d00ec9dfbf07cee198$var$handleShowMembersGrowthClick = async e => {
|
const $921f485217c0c6d00ec9dfbf07cee198$var$handleShowMembersGrowthClick = async e => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
2
dist/quickbar/extendedTribeProfile.js
vendored
2
dist/quickbar/extendedTribeProfile.js
vendored
File diff suppressed because one or more lines are too long
|
@ -2,10 +2,10 @@ import differenceInDays from 'date-fns/differenceInDays';
|
||||||
import getTranslations from './i18n/extendedTribeProfile';
|
import getTranslations from './i18n/extendedTribeProfile';
|
||||||
import requestCreator from './libs/requestCreator';
|
import requestCreator from './libs/requestCreator';
|
||||||
import {
|
import {
|
||||||
setPage,
|
|
||||||
getPage,
|
|
||||||
generatePaginationItems,
|
generatePaginationItems,
|
||||||
getContainerStyles,
|
getContainerStyles,
|
||||||
|
getPage,
|
||||||
|
setPage,
|
||||||
} from './utils/pagination';
|
} from './utils/pagination';
|
||||||
import renderTodaysStats from './common/renderTodaysStats';
|
import renderTodaysStats from './common/renderTodaysStats';
|
||||||
import showEnnoblementsPopup from './common/showEnnoblementsPopup';
|
import showEnnoblementsPopup from './common/showEnnoblementsPopup';
|
||||||
|
@ -13,7 +13,7 @@ import showHistoryPopup from './common/showHistoryPopup';
|
||||||
import showPopup from './utils/showPopup';
|
import showPopup from './utils/showPopup';
|
||||||
import getIDFromURL from './utils/getIDFromURL';
|
import getIDFromURL from './utils/getIDFromURL';
|
||||||
import getCurrentServer from './utils/getCurrentServer';
|
import getCurrentServer from './utils/getCurrentServer';
|
||||||
import { setItem, getItem } from './utils/localStorage';
|
import { getItem, setItem } from './utils/localStorage';
|
||||||
import { formatDate } from './utils/date';
|
import { formatDate } from './utils/date';
|
||||||
import getServerVersionCode from './utils/getServerVersionCode';
|
import getServerVersionCode from './utils/getServerVersionCode';
|
||||||
import * as twstatsutils from './utils/twstats';
|
import * as twstatsutils from './utils/twstats';
|
||||||
|
@ -209,6 +209,7 @@ const TRIBE_CHANGES_QUERY = `
|
||||||
`;
|
`;
|
||||||
const TRIBE_CHANGES_PAGINATION_CONTAINER_ID = 'tribeChangesPagination';
|
const TRIBE_CHANGES_PAGINATION_CONTAINER_ID = 'tribeChangesPagination';
|
||||||
const TRIBE_CHANGES_PER_PAGE = 15;
|
const TRIBE_CHANGES_PER_PAGE = 15;
|
||||||
|
const contentValue = document.querySelector('#content_value');
|
||||||
const profileInfoTBody = document.querySelector(
|
const profileInfoTBody = document.querySelector(
|
||||||
'#content_value > table:nth-child(3) > tbody > tr > td:nth-child(1) > table > tbody'
|
'#content_value > table:nth-child(3) > tbody > tr > td:nth-child(1) > table > tbody'
|
||||||
);
|
);
|
||||||
|
@ -216,8 +217,8 @@ const actionContainer = profileInfoTBody;
|
||||||
const otherElementsContainer = document.querySelector(
|
const otherElementsContainer = document.querySelector(
|
||||||
'#content_value > table:nth-child(3) > tbody > tr > td:nth-child(2)'
|
'#content_value > table:nth-child(3) > tbody > tr > td:nth-child(2)'
|
||||||
);
|
);
|
||||||
const membersContainer = document
|
const membersContainer = contentValue
|
||||||
.querySelector('#content_value h3')
|
.querySelector('h3')
|
||||||
.nextElementSibling.querySelector('tbody');
|
.nextElementSibling.querySelector('tbody');
|
||||||
const translations = getTranslations();
|
const translations = getTranslations();
|
||||||
|
|
||||||
|
@ -288,6 +289,7 @@ const renderTr = ({ title, data, id }) => {
|
||||||
|
|
||||||
const extendMembersData = players => {
|
const extendMembersData = players => {
|
||||||
membersContainer.parentElement.style.width = '100%';
|
membersContainer.parentElement.style.width = '100%';
|
||||||
|
contentValue.append(membersContainer.parentElement);
|
||||||
const heading = membersContainer.querySelector('tr:first-child');
|
const heading = membersContainer.querySelector('tr:first-child');
|
||||||
if (heading.children.length !== 11) {
|
if (heading.children.length !== 11) {
|
||||||
[
|
[
|
||||||
|
@ -606,7 +608,7 @@ const loadMembersGrowthData = async ({ createDateLTE, createDateGT } = {}) => {
|
||||||
createDateLTE,
|
createDateLTE,
|
||||||
createDateGT,
|
createDateGT,
|
||||||
};
|
};
|
||||||
const data = await requestCreator({
|
return await requestCreator({
|
||||||
query: TRIBE_MEMBERS_DAILY_STATS_QUERY,
|
query: TRIBE_MEMBERS_DAILY_STATS_QUERY,
|
||||||
variables: {
|
variables: {
|
||||||
filter,
|
filter,
|
||||||
|
@ -615,7 +617,6 @@ const loadMembersGrowthData = async ({ createDateLTE, createDateGT } = {}) => {
|
||||||
server: SERVER,
|
server: SERVER,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return data;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleShowMembersGrowthClick = async e => {
|
const handleShowMembersGrowthClick = async e => {
|
||||||
|
|
Reference in New Issue
Block a user