Skip to content

Commit

Permalink
Upgrade to react-bootstrap V2 with Bootstrap V5 (#1394)
Browse files Browse the repository at this point in the history
The upgrade to bootstrap V5 required migrating from Less to Sass.
All CSS was updated to use variables instead of color literals,
leading to all colors being defined in _variables.scss.
Similar colors were also removed in order to improve consistency across
different pages and components.
  • Loading branch information
Antonio-Maranhao committed Mar 30, 2023
1 parent 9221a5f commit b0da14d
Show file tree
Hide file tree
Showing 369 changed files with 6,679 additions and 18,648 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ i18n.json
!i18n.json.default.json
test/test.config.js
app/initialize.js
assets/scss/_variable_overrides.scss
.module-cache
test/nightwatch_tests/nightwatch.json
test/nightwatch_tests/reports/*
Expand All @@ -45,5 +46,6 @@ test/dashboard.assets
# test coverage dir
coverage

# Jetbrains IDE
# IDEs
.idea/
.vscode
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ Fixes apache/couchdb#XXX (if there is a CouchDB project GH Issue)
Before you submit the Pull Request, please [run our test suite](#tests.md) and make sure that it passes.

We regularly check the PR list for Fauxton and should get back
to you with a code review. If no one has responded to you yet, you can find us on [Freenode IRC in #couchdb-dev][8].
Ping **garren**, **robertkowalski** or **michellep** though anyone in the room should be able to help you.
to you with a code review.

## Get in Touch

Expand Down
13 changes: 6 additions & 7 deletions app/addons/activetasks/__tests__/components.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// License for the specific language governing permissions and limitations under
// the License.
import TableHeader from '../components/tableheader';
import FilterTabs from '../components/filtertabs';
import {ActiveTasksFilterTabs, ActiveTasksFilter} from '../components/filtertabs';
import React from "react";
import {mount} from 'enzyme';
import sinon from "sinon";
Expand All @@ -31,7 +31,7 @@ describe('Active Tasks -- Components', () => {
radioTexts.forEach((text) => {
let spy = sinon.spy();
const tabs = mount(
<FilterTabs
<ActiveTasksFilterTabs
onRadioClick={spy}
selectedRadio={"All Tasks"}
radioNames={radioTexts}
Expand All @@ -46,12 +46,12 @@ describe('Active Tasks -- Components', () => {
it('should trigger change to search term', () => {
const spy = sinon.spy();
const tabs = mount(
<FilterTabs
<ActiveTasksFilter
onSearch={spy}
selectedRadio={"All Tasks"}
/>
);
tabs.find('.searchbox').simulate('change', {target: {value: 'searching'}});

tabs.find('input.form-control[name="search"]').simulate('change', {target: {value: 'searching'}});
expect(spy.calledOnce).toBeTruthy();
});
});
Expand All @@ -64,7 +64,6 @@ describe('Active Tasks -- Components', () => {
];

it('should trigger change to radio buttons', () => {

tableTexts.forEach((text) => {
let spy = sinon.spy();
const table = mount(
Expand All @@ -77,7 +76,7 @@ describe('Active Tasks -- Components', () => {
</table>
);

table.find(`.${text}`).simulate('click');
table.find(`.header-${text}`).simulate('click');
expect(spy.calledOnce).toBeTruthy();
});
});
Expand Down
155 changes: 0 additions & 155 deletions app/addons/activetasks/assets/less/activetasks.less

This file was deleted.

89 changes: 89 additions & 0 deletions app/addons/activetasks/assets/scss/activetasks.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
// http:https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.

@import '../../../../../assets/scss/variables';
@import '../../../../../assets/scss/mixins';

#active-tasks-page {
overflow: auto;

.inner {
overflow: auto;
height: 100%;
}

.table-active-tasks {
font-size: 0.875rem;
th {
cursor: pointer;

&.header-type {
width: 10%;
}

&.header-database {
width: 30%;
}

&.header-tarted-on {
width: 13%;
}

&.header-updated-on {
width: 13%;
}

&.header-pid {
width: 10%;
}

&.header-progress {
width: 23%;
}

.fonticon-up-dir,
.fonticon-down-dir {
color: $cf-brand-highlight;
}
}

p.multiline-active-tasks-message {
margin: 0;
line-height: 1.3;
margin-bottom: 3px;

&.time:nth-child(2) {
color: $cf-text01-muted;
}

&.to-from-database {
&:first-child {
border-bottom: 1px solid $cf-border-color01;
}
padding-bottom: 15px;
}
}
}

div#active-tasks-search {
margin-top:1.5rem;
padding: 0 30px;
}

.component-tab-element-wrapper {
#active-tasks-search-box {
display: inline;
width: 220px;
margin-left:8px;
}
}
}
2 changes: 1 addition & 1 deletion app/addons/activetasks/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import FauxtonAPI from "../../core/api";
import Activetasks from "./routes";
import "./assets/less/activetasks.less";
import "./assets/scss/activetasks.scss";
import reducers from './reducers';

Activetasks.initialize = function () {
Expand Down
12 changes: 10 additions & 2 deletions app/addons/activetasks/components/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// License for the specific language governing permissions and limitations under
// the License.
import React from 'react';
import ActiveTasksFilterTabs from './filtertabs';
import {ActiveTasksFilterTabs, ActiveTasksFilter} from './filtertabs';
import ActiveTaskTable from './table';

export default class ActiveTasksController extends React.Component {
Expand Down Expand Up @@ -42,8 +42,16 @@ export default class ActiveTasksController extends React.Component {
<ActiveTasksFilterTabs
searchTerm={searchTerm}
selectedRadio={selectedRadio}
onSearch={setSearchTerm}
onRadioClick={this.switchTab}/>

<div className="row">
<div id="active-tasks-search" className="col-12 col-md-6">
<ActiveTasksFilter
onSearch={setSearchTerm}
/>
</div>
</div>

<ActiveTaskTable
isLoading={isLoading}
tasks={tasks}
Expand Down
Loading

0 comments on commit b0da14d

Please sign in to comment.