Skip to content

Commit

Permalink
split code base for UI from dpo-voyager
Browse files Browse the repository at this point in the history
  • Loading branch information
sdumetz committed Jan 5, 2024
1 parent 51267d3 commit 611b530
Show file tree
Hide file tree
Showing 46 changed files with 1,279 additions and 666 deletions.
61 changes: 0 additions & 61 deletions source/ui/Logo.ts

This file was deleted.

27 changes: 6 additions & 21 deletions source/ui/MainView.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { LitElement, html, customElement } from 'lit-element';

import Notification from "@ff/ui/Notification";

import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!./styles.scss';
import styles from '!lit-css-loader?{"specifier":"lit-element"}!sass-loader!./styles/main.scss';

import "./styles/globals.scss";

import "./globals.scss";

import "./composants/UploadButton";
import "./composants/navbar/NavLink";
Expand All @@ -19,28 +19,13 @@ import "./screens/UserSettings";
import "./screens/Home"
import "./composants/Modal";

import Notification from "./composants/Notification";

import { updateLogin, withUser } from './state/auth';
import Modal from './composants/Modal';
import i18n from './state/translate';
import { route, router } from './state/router';

/**
* Simplified from path-to-regex for our simple use-case
* @see https://github.com/pillarjs/path-to-regexp
*/
function toRegex(path:string|RegExp){
if(path instanceof RegExp) return path;
const matcher = `[^\/#\?]+`
let parts = path.split("/")
.filter(p=>p)
.map( p =>{
let param = /:(\w+)/.exec(p);
if(!param) return p;
return `(?<${param[1]}>${matcher})`;
})
return new RegExp(`^/${parts.join("/")}\/?$`,"i")
}


@customElement("ecorpus-main")
export default class MainView extends router(i18n(withUser(LitElement))){
Expand All @@ -57,7 +42,7 @@ export default class MainView extends router(i18n(withUser(LitElement))){

connectedCallback(): void {
super.connectedCallback();
Notification.shadowRootNode = this.shadowRoot;
// FIXME : configure notifications
updateLogin().catch(e => {
Modal.show({header: "Error", body: e.message});
});
Expand Down
Binary file added source/ui/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions source/ui/assets/images/defaultSprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 611b530

Please sign in to comment.