Skip to content

Commit

Permalink
Revert "Merge pull request #10990 from archesproject/10838-cbyrd-upgr…
Browse files Browse the repository at this point in the history
…ade-primevue"

This reverts commit 65a5b0c, reversing
changes made to 326af3f.
  • Loading branch information
jacobtylerwalls committed Jun 17, 2024
1 parent 99f1749 commit 2182db2
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 24 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ repos:
name: eslint
entry: npm run eslint:fix
language: system
files: arches/app/src
- id: typescript
name: typescript
entry: npm run ts:check
Expand Down
29 changes: 7 additions & 22 deletions arches/app/media/js/utils/create-vue-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,39 @@ import FocusTrap from 'primevue/focustrap';
import StyleClass from 'primevue/styleclass';
import ToastService from 'primevue/toastservice';
import Tooltip from 'primevue/tooltip';

import Aura from 'primevue/themes/aura';
import arches from 'arches';

import { createApp } from 'vue';
import { createGettext } from "vue3-gettext";

import arches from 'arches';

const DEFAULT_THEME = {
theme: {
preset: Aura,
options: {
prefix: 'p',
darkModeSelector: 'system',
cssLayer: false
}
}
};

export default async function createVueApplication(vueComponent, themeConfiguration) {
export default async function createVueApplication(vueComponent){
/**
* This wrapper allows us to maintain a level of control inside arches-core
* over Vue apps. For instance this allows us to abstract i18n setup/config
* away from app initialization, and also allows us to ensure any plugins
* we'd like to use across the Arches ecosystem will be available. This also
* Vue apps more easily extensible if we choose to add plugins or logic in
* the future.
**/
**/

/**
* TODO: cbyrd #10501 - we should add an event listener that will re-fetch i18n data
* and rebuild the app when a specific event is fired from the LanguageSwitcher component.
**/
return fetch(arches.urls.api_get_frontend_i18n_data).then(function(resp) {
**/
return fetch(arches.urls.api_get_frontend_i18n_data).then(resp => {
if (!resp.ok) {
throw new Error(resp.statusText);
}
return resp.json();
}).then(function(respJSON) {
}).then(respJSON => {
const gettext = createGettext({
availableLanguages: respJSON['enabled_languages'],
defaultLanguage: respJSON['language'],
translations: respJSON['translations'],
});

const app = createApp(vueComponent);

app.use(PrimeVue, themeConfiguration || DEFAULT_THEME);
app.use(PrimeVue);
app.use(gettext);
app.use(ConfirmationService);
app.use(DialogService);
Expand Down
2 changes: 1 addition & 1 deletion arches/app/media/js/views/plugin-standalone.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineAsyncComponent } from 'vue';
import createVueApplication from 'utils/create-vue-application';

import pluginData from 'views/plugin-data';
const pluginData = require('views/plugin-data');

// workaround for webpack failures surrounding dynamic imports
const vuePluginPath = pluginData['component'].replace('src/', '').replace('.vue', '');
Expand Down
2 changes: 2 additions & 0 deletions arches/app/templates/base.htm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
<link rel="apple-touch-icon" sizes="180x180" href="{% webpack_static 'favicons/apple-touch-icon-180x180.png' %}" />

{% block css %}
<!-- POC rough out of PrimeVue theme switcher -->
<link rel="stylesheet" href="{% webpack_static 'node_modules/primevue/resources/themes/mdc-light-indigo/theme.css' %}" />
{% render_bundle 'css/arches' 'css' %}
{% render_bundle 'css/core' 'css' %}

Expand Down
2 changes: 2 additions & 0 deletions arches/app/templates/views/plugin-standalone.htm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
<link rel="apple-touch-icon" sizes="180x180" href="{% webpack_static 'favicons/apple-touch-icon-180x180.png' %}" />

{% block css %}
<!-- POC rough out of PrimeVue theme switcher -->
<link rel="stylesheet" href="{% webpack_static 'node_modules/primevue/resources/themes/mdc-light-indigo/theme.css' %}" />
<link rel="stylesheet" href="{% webpack_static 'node_modules/font-awesome/css/font-awesome.min.css' %}" />
{% endblock css %}
</head>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"moment": "^2.29.4",
"nouislider": "11.0.3",
"numeral": "^2.0.6",
"primevue": "4.0.0-beta.3",
"primevue": "^3.51.0",
"proj4": "^2.3.15",
"regenerator-runtime": "^0.14.1",
"requirejs": "~2.3.2",
Expand Down

0 comments on commit 2182db2

Please sign in to comment.