Compare commits

...

5 Commits

6 changed files with 53 additions and 22 deletions

View File

@ -195,17 +195,17 @@ export class BoardPage extends React.Component<BoardPageProps> {
<div className="level-item">
<span className="tag is-primary is-light is-normal">{lane.cards.length}</span>
</div>
<h3 className="level-item is-size-5">
{lane.title}
</h3>
<button className="button is-light level-item is-small expand"
onClick={this.onMinimizeColumn}>
<span className="icon">
<i className="fas fa-chevron-right" aria-hidden="true"></i>
</span>
</button>
<h3 className="level-item is-size-5">
{lane.title}
</h3>
</div>
<div className="level-right">
<div className="level-right is-show-expand">
<button className="button is-light level-item is-small"
onClick={this.onNewCardClick.bind(this, lane.id)}>
<span className="icon">
@ -228,7 +228,7 @@ export class BoardPage extends React.Component<BoardPageProps> {
e.currentTarget.closest('.react-kanban-column').classList.toggle('minimized');
}
onCardDragEnd(b: any, card: any, source: any, dest: any) {
onCardDragEnd(card: any, source: any, dest: any) {
const { board } = this.props;
this.props.dispatch(moveCard(
board.id,

View File

@ -101,23 +101,41 @@
scrollbar-color: $grey-lighter, #f1f1f1;
scrollbar-width: 5px;
.kanboard-card {
display: block;
}
&.minimized {
max-width: 40px;
min-width: 40px;
max-width: 70px;
min-width: 70px;
writing-mode: vertical-rl;
text-orientation: sideways-right;
.level-item {
margin-right: 0;
}
.level-left {
margin-right: 0;
}
.level-right.is-show-expand {
display: none;
}
.kanboard-lane {
margin-right: -1em;
/*margin-right: -1em;*/
h3 {
margin-top: .5em;
margin-right: -.5em;
/*margin-right: -.5em;*/
}
.tag {
margin-right: -1em;
writing-mode: horizontal-tb;
}
.expand {
@ -125,8 +143,13 @@
margin-top: .5em;
}
}
.kanboard-card {
display: none;
}
}
&::-webkit-scrollbar {
width: 5px;

View File

@ -37,22 +37,22 @@ function handleMoveCard(state: any, action: any) {
const kanboard = state.byID[boardID];
const lanes = [ ...kanboard.columns ];
const fromLane = lanes[fromLaneID];
const toLane = lanes[toLaneID];
const columns = [ ...kanboard.columns ];
const fromLane = columns[fromLaneID];
const toLane = columns[toLaneID];
const card = fromLane.cards[fromPosition];
const fromCards = [ ...fromLane.cards ];
if (fromLaneID !== toLaneID) {
fromCards.splice(fromPosition, 1);
lanes[fromLaneID] = {
columns[fromLaneID] = {
...fromLane,
cards: fromCards,
};
const toCards = [ ...toLane.cards ];
toCards.splice(toPosition, 0, card);
lanes[toLaneID] = {
columns[toLaneID] = {
...toLane,
cards: toCards,
};
@ -67,7 +67,7 @@ function handleMoveCard(state: any, action: any) {
...state.byID,
[boardID]: {
...state.byID[boardID],
lanes,
columns,
},
}
};

View File

@ -22,7 +22,7 @@ export function* moveCardSaga(action: any) {
}
});
const toLane = kanboard.lanes[toLaneID];
const toLane = kanboard.columns[toLaneID];
const card = toLane.cards[toPosition];
if (!card) return;

View File

@ -3,10 +3,18 @@ import { FETCH_PROJECTS_SUCCESS, FETCH_PROJECTS_FAILURE } from '../actions/proje
import { gitea } from '../../util/gitea';
export function* fetchProjectsSaga() {
let projects;
let projects = [];
try {
projects = yield call(gitea.fetchUserProjects.bind(gitea))
let page = 1;
while(true) {
let pageProjects = yield call(gitea.fetchUserProjects.bind(gitea), page);
if (pageProjects.length === 0) {
break;
}
projects.push(...pageProjects);
page++;
}
} catch(error) {
yield put({ type: FETCH_PROJECTS_FAILURE, error });
return;

View File

@ -16,8 +16,8 @@ export class GiteaClient {
;
}
fetchUserProjects() {
return fetch(`/gitea/api/v1/user/repos`)
fetchUserProjects(page = 1) {
return fetch(`/gitea/api/v1/user/repos?page=${page}`)
.then(this.assertAuthorization)
.then(this.assertOk)
.then(res => res.json())