Skip to content

Commit

Permalink
chore: Reverts tailwind and LSO Homepage (#7007)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmartel authored Jan 31, 2025
1 parent fe6d0c4 commit 61b9bbe
Show file tree
Hide file tree
Showing 90 changed files with 459 additions and 5,914 deletions.
141 changes: 0 additions & 141 deletions Dockerfile.development

This file was deleted.

3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ docker-run-dev:
docker-migrate-dev:
docker compose run app python3 /label-studio/label_studio/manage.py migrate

docker-collectstatic-dev:
docker compose run app python3 /label-studio/label_studio/manage.py collectstatic

# Install modules
frontend-install:
cd web && yarn install --frozen-lockfile;
Expand Down
3 changes: 0 additions & 3 deletions label_studio/core/templates/home/home.html

This file was deleted.

9 changes: 3 additions & 6 deletions label_studio/core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pandas as pd
import requests
from core import utils
from core.feature_flags import all_flags, flag_set, get_feature_file_path
from core.feature_flags import all_flags, get_feature_file_path
from core.label_config import generate_time_series_json
from core.utils.common import collect_versions
from core.utils.io import find_file
Expand All @@ -27,7 +27,7 @@
HttpResponseServerError,
JsonResponse,
)
from django.shortcuts import redirect, render, reverse
from django.shortcuts import redirect, reverse
from django.template import loader
from django.utils._os import safe_join
from django.views.decorators.csrf import csrf_exempt
Expand Down Expand Up @@ -55,10 +55,7 @@ def main(request):
return redirect(reverse('user-login'))

# business mode access
if flag_set('fflag_all_feat_dia_1777_ls_homepage_short'):
return render(request, 'home/home.html')
else:
return redirect(reverse('projects:project-index'))
return redirect(reverse('projects:project-index'))

# not authenticated
return redirect(reverse('user-login'))
Expand Down
10 changes: 2 additions & 8 deletions label_studio/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ def user_signup(request):

# checks if the URL is a safe redirection.
if not next_page or not url_has_allowed_host_and_scheme(url=next_page, allowed_hosts=request.get_host()):
if flag_set('fflag_all_feat_dia_1777_ls_homepage_short'):
next_page = reverse('main')
else:
next_page = reverse('projects:project-index')
next_page = reverse('projects:project-index')

user_form = forms.UserSignupForm()
organization_form = OrganizationSignupForm()
Expand Down Expand Up @@ -104,10 +101,7 @@ def user_login(request):

# checks if the URL is a safe redirection.
if not next_page or not url_has_allowed_host_and_scheme(url=next_page, allowed_hosts=request.get_host()):
if flag_set('fflag_all_feat_dia_1777_ls_homepage_short'):
next_page = reverse('main')
else:
next_page = reverse('projects:project-index')
next_page = reverse('projects:project-index')

login_form = load_func(settings.USER_LOGIN_FORM)
form = login_form()
Expand Down
1 change: 0 additions & 1 deletion web/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ tmp

# dependencies
node_modules
dist

# IDEs and editors
/.idea
Expand Down
4 changes: 1 addition & 3 deletions web/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"extends": ["stylelint-config-tailwindcss/scss", "stylelint-config-standard-scss"],
"extends": "stylelint-config-standard-scss",
"rules": {
"selector-class-pattern": null,
"custom-property-pattern": null,
"no-descending-specificity": null,
"function-no-unknown": null,
"scss/no-global-function-names": null,
"scss/function-no-unknown": null,
"selector-pseudo-class-no-unknown": [
true,
{
Expand Down
12 changes: 0 additions & 12 deletions web/apps/labelstudio/src/app/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,9 @@ import { RootPage } from "./RootPage";
import { FF_OPTIC_2, FF_UNSAVED_CHANGES, FF_PRODUCT_TOUR, isFF } from "../utils/feature-flags";
import { TourProvider } from "@humansignal/core";
import { ToastProvider, ToastViewport } from "@humansignal/ui";
import "@humansignal/ui/src/tailwind.css";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { JotaiProvider, JotaiStore } from "../utils/jotai-store";

const baseURL = new URL(APP_SETTINGS.hostname || location.origin);
export const UNBLOCK_HISTORY_MESSAGE = "UNBLOCK_HISTORY";
const queryClient = new QueryClient({
defaultOptions: {
queries: {
refetchOnWindowFocus: false,
},
},
});

const browserHistory = createBrowserHistory({
basename: baseURL.pathname || "/",
Expand Down Expand Up @@ -66,8 +56,6 @@ const App = ({ content }) => {
<Router history={browserHistory}>
<MultiProvider
providers={[
<JotaiProvider key="jotai" store={JotaiStore} />,
<QueryClientProvider key="query" client={queryClient} />,
<AppStoreProvider key="app-store" />,
<ApiProvider key="api" />,
<ConfigProvider key="config" />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,4 @@
opacity: 0.5;
top: 1px;
position: relative;
display: inline;
vertical-align: baseline;
}
}
6 changes: 2 additions & 4 deletions web/apps/labelstudio/src/components/Menubar/Menubar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import "./Menubar.scss";
import "./MenuContent.scss";
import "./MenuSidebar.scss";
import { ModelsPage } from "../../pages/Organization/Models/ModelsPage";
import { FF_DIA_835, FF_HOMEPAGE, isFF } from "../../utils/feature-flags";
import { IconHome } from "@humansignal/ui";
import { FF_DIA_835, isFF } from "../../utils/feature-flags";

export const MenubarContext = createContext();

Expand Down Expand Up @@ -133,7 +132,7 @@ export const Menubar = ({ enabled, defaultOpened, defaultPinned, children, onSid
<div className={menubarClass}>
<Dropdown.Trigger dropdown={menuDropdownRef} closeOnClickOutside={!sidebarPinned}>
<div className={`${menubarClass.elem("trigger")} main-menu-trigger`}>
<img src={absoluteURL("/static/icons/logo.svg")} alt="Label Studio Logo" style={{ height: 22 }} />
<img src={absoluteURL("/static/icons/logo.svg")} alt="Label Studio Logo" height="22" />
<Hamburger opened={sidebarOpened} />
</div>
</Dropdown.Trigger>
Expand Down Expand Up @@ -184,7 +183,6 @@ export const Menubar = ({ enabled, defaultOpened, defaultPinned, children, onSid
style={{ width: 240 }}
>
<Menu>
{isFF(FF_HOMEPAGE) && <Menu.Item label="Home" to="/" icon={<IconHome />} data-external exact />}
<Menu.Item label="Projects" to="/projects" icon={<IconFolder />} data-external exact />
<Menu.Item label="Organization" to="/organization" icon={<IconPersonInCircle />} data-external exact />
{isFF(FF_DIA_835) && <Menu.Item label="Models" to={ModelsPage.path} icon={<IconModel />} exact />}
Expand Down
4 changes: 2 additions & 2 deletions web/apps/labelstudio/src/components/Modal/ModalPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ Modal.Header = ({ children, divided }) => (
</Elem>
);

Modal.Footer = ({ children, bare, style, className }) => (
<Elem name="footer" mod={{ bare }} mix={className} style={style}>
Modal.Footer = ({ children, bare }) => (
<Elem name="footer" mod={{ bare }}>
{children}
</Elem>
);
Expand Down
14 changes: 6 additions & 8 deletions web/apps/labelstudio/src/pages/CreateProject/Config/Config.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ const ConfigureControl = ({ control, template }) => {
<form className={configClass.elem("add-labels")} action="">
<h4>{tagname === "Choices" ? "Add choices" : "Add label names"}</h4>
<span>Use new line as a separator to add multiple labels</span>
<textarea name="labels" id="" cols="50" rows="5" ref={refLabels} onKeyPress={onKeyPress} />
<Button type="button" size="compact" onClick={onAddLabels}>
Add
</Button>
<textarea name="labels" id="" cols="30" rows="5" ref={refLabels} onKeyPress={onKeyPress} />
<input type="button" value="Add" onClick={onAddLabels} />
</form>
<div className={configClass.elem("current-labels")}>
<h3>
Expand Down Expand Up @@ -166,7 +164,7 @@ const ConfigureSettings = ({ template }) => {
<li key={key}>
<label>
{options.title}{" "}
<select className="border" value={value} onChange={onChange}>
<select value={value} onChange={onChange}>
{options.type.map((option) => (
<option key={option} value={option}>
{option}
Expand Down Expand Up @@ -284,7 +282,7 @@ const ConfigureColumn = ({ template, obj, columns }) => {
{template.objects > 1 && ` for ${obj.getAttribute("name")}`}
{" from "}
{columns?.length > 0 && columns[0] !== DEFAULT_COLUMN && "field "}
<select className="border" onChange={selectValue} value={isManual ? "-" : value}>
<select onChange={selectValue} value={isManual ? "-" : value}>
{columns?.map((column) => (
<option key={column} value={column}>
{column === DEFAULT_COLUMN ? "<imported file>" : `$${column}`}
Expand Down Expand Up @@ -470,9 +468,9 @@ const Configurator = ({
<div className={configClass.elem("container")}>
<h1>Labeling Interface{hasChanges ? " *" : ""}</h1>
<header>
<Button type="button" data-leave={true} onClick={onBrowse} size="compact">
<button type="button" data-leave={true} onClick={onBrowse}>
Browse Templates
</Button>
</button>
<ToggleItems items={{ code: "Code", visual: "Visual" }} active={configure} onSelect={onSelect} />
</header>
<div className={configClass.elem("editor")}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ $scroll-width: 5px;
}

&__info-icon {
margin-right: 8px;
vertical-align: -5px;
height: 20px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,13 @@ export const TemplatesList = ({ selectedGroup, selectedRecipe, onCustomTemplate,
{!templates && <Spinner style={{ width: "100%", height: 200 }} />}
<TemplatesInGroup templates={templates || []} group={selected} onSelectRecipe={onSelectRecipe} />
</main>
<footer className="flex items-center justify-center gap-1">
<footer>
<IconInfo className={listClass.elem("info-icon")} width="20" height="20" />
<span>
See the documentation to{" "}
<a href="https://labelstud.io/guide" target="_blank" rel="noreferrer">
contribute a template
</a>
.
</span>
See the documentation to{" "}
<a href="https://labelstud.io/guide" target="_blank" rel="noreferrer">
contribute a template
</a>
.
</footer>
</div>
);
Expand Down
Loading

0 comments on commit 61b9bbe

Please sign in to comment.