Skip to content

Commit

Permalink
Merge pull request #3228 from SEED-platform/3218-feat/refresh_metadata
Browse files Browse the repository at this point in the history
3218 feat/refresh metadata
  • Loading branch information
nllong committed May 4, 2022
2 parents 6cd5c7b + f40a1ca commit 971b185
Show file tree
Hide file tree
Showing 17 changed files with 221 additions and 30 deletions.
Binary file modified locale/en_US/LC_MESSAGES/django.mo
Binary file not shown.
9 changes: 9 additions & 0 deletions locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ msgstr "Error: New column name cannot match previous name."
msgid "COLUMN_NAME_EXISTS_WARNING"
msgstr "Warning: Column name already exists."

msgid "COL_CHANGE_DESCRIPTION"
msgstr "Provides a description of the column to assist in remembering the meaning of the column. This defaults to the display name if available, otherwise the column name is utilized."

msgid "COL_CHANGE_DISPLAY"
msgstr "Change the display name (that appears throughout the program) of a column. This is user-defined and can be any value (?)"

Expand Down Expand Up @@ -2028,6 +2031,9 @@ msgstr "Recognize Empty"
msgid "Record from Source"
msgstr "Record from Source"

msgid "Refresh Metadata of Selected Properties and Tax Lots"
msgstr "Refresh Metadata of Selected Properties and Tax Lots"

#: src/django-tos-master/tos/templates/tos/tos_check.html:18
msgid "Reject"
msgstr "Reject"
Expand Down Expand Up @@ -3108,6 +3114,9 @@ msgstr "property"
msgid "red"
msgstr "red"

msgid "refresh metadata"
msgstr "Refresh Metadata"

msgid "save"
msgstr "save"

Expand Down
Binary file modified locale/fr_CA/LC_MESSAGES/django.mo
Binary file not shown.
9 changes: 9 additions & 0 deletions locale/fr_CA/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ msgstr "Erreur: Le nom de la nouvelle colonne ne peut pas correspondre au nom pr
msgid "COLUMN_NAME_EXISTS_WARNING"
msgstr "Attention: le nom de la colonne existe déjà."

msgid "COL_CHANGE_DESCRIPTION"
msgstr "Fournit une description de la colonne pour aider à se souvenir de la signification de la colonne. Il s'agit par défaut du nom d'affichage s'il est disponible, sinon le nom de la colonne est utilisé."

#, fuzzy
msgid "COL_CHANGE_DISPLAY"
msgstr "Changer le nom d'affichage d'une colonne"
Expand Down Expand Up @@ -2045,6 +2048,9 @@ msgstr "Reconnaître vide"
msgid "Record from Source"
msgstr "Enregistrement de la source"

msgid "Refresh Metadata of Selected Properties and Tax Lots"
msgstr "Actualiser les métadonnées des propriétés et terrains d'impôt sélectionnés"

#: src/django-tos-master/tos/templates/tos/tos_check.html:18
msgid "Reject"
msgstr "Rejeter"
Expand Down Expand Up @@ -3130,6 +3136,9 @@ msgstr "propriété"
msgid "red"
msgstr "rouge"

msgid "refresh metadata"
msgstr "Actualiser les métadonnées"

msgid "save"
msgstr "enregistrer"

Expand Down
17 changes: 17 additions & 0 deletions seed/static/seed/js/controllers/inventory_list_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,23 @@ angular.module('BE.seed.controller.inventory_list', [])
});
};

$scope.open_refresh_metadata_modal = function () {
$uibModal.open({
templateUrl: urls.static_url + 'seed/partials/refresh_metadata_modal.html',
controller: 'refresh_metadata_modal_controller',
backdrop: 'static',
resolve: {
ids: function () {
return _.map(_.filter($scope.gridApi.selection.getSelectedRows(), function (row) {
if ($scope.inventory_type === 'properties') return row.$$treeLevel == 0;
return !_.has(row, '$$treeLevel');
}), 'id');
},
inventory_type: _.constant($scope.inventory_type),
}
});
}

$scope.open_analyses_modal = function () {
const modalInstance = $uibModal.open({
templateUrl: urls.static_url + 'seed/partials/inventory_detail_analyses_modal.html',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**
* :copyright (c) 2014 - 2022, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from the U.S. Department of Energy) and contributors. All rights reserved.
* :author
*/
angular.module('BE.seed.controller.refresh_metadata_modal', []).controller('refresh_metadata_modal_controller', [
'$scope',
'$state',
'$uibModalInstance',
'ids',
'inventory_type',
'inventory_service',
'uploader_service',
function(
$scope,
$state,
$uibModalInstance,
ids,
inventory_type,
inventory_service,
uploader_service,

) {
$scope.id_count = ids.length
$scope.inventory_type = inventory_type
$scope.refresh_progress = {
progress: 0,
status_message: '',
};
$scope.refreshing = false

$scope.refresh_metadata = function () {
$scope.refreshing = true
inventory_service.start_refresh_metadata()
.then(data => {
uploader_service.check_progress_loop(data.data.progress_key, 0, 1,
function () { $scope.refresh_page()},
function () { },
$scope.refresh_progress);
return inventory_service.refresh_metadata(ids, inventory_type, data.data.progress_key);
})
}

$scope.refresh_page = function () {
$state.reload();
$uibModalInstance.dismiss('cancel');
};

$scope.cancel = function() {
$uibModalInstance.dismiss('cancel');
}
}]);
1 change: 1 addition & 0 deletions seed/static/seed/js/seed.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ angular.module('BE.seed.controllers', [
'BE.seed.controller.export_buildingsync_modal',
'BE.seed.controller.export_report_modal',
'BE.seed.controller.export_inventory_modal',
'BE.seed.controller.refresh_metadata_modal',
'BE.seed.controller.document_upload_modal',
'BE.seed.controller.geocode_modal',
'BE.seed.controller.green_button_upload_modal',
Expand Down
17 changes: 17 additions & 0 deletions seed/static/seed/js/services/inventory_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,23 @@ angular.module('BE.seed.service.inventory', []).factory('inventory_service', [
});
};

inventory_service.refresh_metadata = function (ids, inventory_type, progress_key) {
return $http.post(`/api/v3/tax_lot_properties/refresh_metadata/`, {
ids: ids,
inventory_type: inventory_type,
progress_key: progress_key,
organization_id: user_service.get_organization().id
});
};

inventory_service.start_refresh_metadata = function() {
return $http.get('/api/v3/tax_lot_properties/start_refresh_metadata/', {
params: {
organization_id: user_service.get_organization().id
}
});
};

return inventory_service;

}]);
18 changes: 3 additions & 15 deletions seed/static/seed/locales/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"Buildings": "Buildings",
"COLUMN_NAME_DUPLICATE_ERROR": "Error: New column name cannot match previous name.",
"COLUMN_NAME_EXISTS_WARNING": "Warning: Column name already exists.",
"COL_CHANGE_DESCRIPTION": "Provides a description of the column to assist in remembering the meaning of the column. This defaults to the display name if available, otherwise the column name is utilized.",
"COL_CHANGE_DISPLAY": "Change the display name (that appears throughout the program) of a column. This is user-defined and can be any value (?)",
"COL_CHANGE_NAME": "Specifies the underlying field name represented by the Display Name. These field names are not user defined, but are generated from imported user files as well as program-defined fields.",
"COL_CHANGE_NAME_EXT": "If a name has an “extra data” tag after it, these are fields that have been imported into SEED by the user from imported files. These fields cannot be used as matching fields under the Match Criteria section.",
Expand Down Expand Up @@ -381,11 +382,7 @@
"INVALID_EXTENSION_ALERT": "<strong>Sorry!<\/strong> SEED doesn't currently support that file format. Only <strong>.csv<\/strong>, <strong>.xls<\/strong>, <strong>.xlsx<\/strong>, and <strong>.xml<\/strong> files are supported.",
"INVALID_GEOJSON_EXTENSION_ALERT": "<strong>Sorry!<\/strong> SEED doesn't currently support that file format. Only <strong>.geojson<\/strong> and <strong>.json<\/strong> files are supported.",
"INVALID_XML_EXTENSION_ALERT": "<strong>Sorry!<\/strong> SEED doesn't currently support that file format. Only <strong>.xml<\/strong> files are supported.",
"INVALID_CSV_EXTENSION_ALERT": "<strong>Sorry!<\/strong> SEED doesn't currently support that file format. Only <strong>.csv<\/strong> files are supported.",
"NO_DATA_LOGGER_DISPLAY_NAME": "Please enter a display name.",
"NON_UNIQUE_DATA_LOGGER_DISPLAY_NAME": "Display name must be unique.",
"INVALID_XML_ZIP_EXTENSION_ALERT": "<strong>Sorry!<\/strong> SEED doesn't currently support that file format. Only <strong>.xml<\/strong> and <strong>.zip<\/strong> files are supported.",
"INVALID_DOC_FILE_EXTENSION_ALERT": "<strong>Sorry!<\/strong> SEED doesn't currently support that file format. Only <strong>.pdf<\/strong>, <strong>.osm<\/strong>, <strong>.idf<\/strong>, and <strong>.dxf<\/strong> files are supported.",
"IRREVERSIBLE_OPERATION_WARNING": "This operation is irreversible.",
"ITEMS_WILL_NOT_CHANGE": "these will not change",
"Ignored duplicates of existing properties": "Ignored duplicates of existing properties",
Expand Down Expand Up @@ -659,6 +656,7 @@
"Recent Sale Date": "Recent Sale Date",
"Recognize Empty": "Recognize Empty",
"Record from Source": "Record from Source",
"Refresh Metadata of Selected Properties and Tax Lots": "Refresh Metadata of Selected Properties and Tax Lots",
"Reject": "Reject",
"Related Properties": "Related Properties",
"Related Tax Lots": "Related Tax Lots",
Expand Down Expand Up @@ -707,8 +705,6 @@
"SEED doesn't currently support that file format": "SEED doesn't currently support that file format",
"SEED is easy, flexible, and cost effective software designed to help organizations clean, manage and share information about large portfolios of buildings. SEED is a free, open source web application that you can use privately. While SEED was originally designed to help cities and States implement benchmarking programs for public or private buildings, it has the potential to be useful for many other activities by public entities, efficiency programs and private companies.": "SEED is easy, flexible, and cost effective software designed to help organizations clean, manage and share information about large portfolios of buildings. SEED is a free, open source web application that you can use privately. While SEED was originally designed to help cities and States implement benchmarking programs for public or private buildings, it has the potential to be useful for many other activities by public entities, efficiency programs and private companies.",
"SELECT_DATA_SET_TITLE": "Select Data Set",
"SELECT_UPLOAD_FILE_TITLE": "Select File to Upload",
"SELECT_DOC_UPLOAD_TITLE": "Select Inventory Document File to Upload",
"SELECT_THE_TYPE_OF_FILE_TO_ADD_TO_DATASET": "Select the type of file(s) you would like to add to {dataset_name}.",
"SHARE DATA WITH": "SHARE DATA WITH",
"SHOWING_AVAILABLE_MATCHES": "Showing {start} to {end} of {total} available matches",
Expand Down Expand Up @@ -844,19 +840,10 @@
"UBID": "UBID",
"UPDATE_MANUALLY_GEOCODED_INSTRUCTIONS": "If the properties have been manually geocoded, then they will not be updated. To update geocoding, remove the lat\/long.",
"UPLOADING_FILE_TITLE": "Uploading File",
"UPLOADING_DOCUMENT_TITLE": "Uploading Inventory Document",
"UPLOADING_PROGRESS": "Uploading <strong>{dataset_filename}<\/strong> to cycle <strong>{cycle_name}<\/strong>",
"UPLOAD_COMPLETE_TITLE": "Upload Complete",
"UPLOAD_FILE": "Upload File",
"CONTINUE": "Continue",
"UPLOAD_GB_DATA_BUTTON": "Upload GreenButton Data",
"UPLOAD_DATA_LOGGER_BUTTON": "Create Data Logger",
"CREATE_DATA_LOGGER": "Create a Data Logger",
"UPLOAD_SENSORS_BUTTON": "Upload Sensors",
"UPLOAD_SENSOR_READINGS_BUTTON": "Upload Sensor Readings",
"SENSORS": "Sensors",
"SENSOR_READINGS": "Sensor Readings",
"DATA_LOGGERS": "Data Loggers",
"UPLOAD_INCOMPLETE_TITLE": "Upload Incomplete",
"UPLOAD_PM_READINGS_MODAL_TITLE": "Upload Portfolio Manager Meter Readings",
"USING_DEFAULT_UNITS_WARNING": "For columns with unit settings, default units will be used for conversions.",
Expand Down Expand Up @@ -1006,6 +993,7 @@
"project taxlot views": "project taxlot views",
"property": "property",
"red": "red",
"refresh metadata": "Refresh Metadata",
"save": "save",
"saving complete": "saving complete",
"saving data": "saving data",
Expand Down
17 changes: 3 additions & 14 deletions seed/static/seed/locales/fr_CA.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"Buildings": "Bâtiments",
"COLUMN_NAME_DUPLICATE_ERROR": "Erreur: Le nom de la nouvelle colonne ne peut pas correspondre au nom précédent.",
"COLUMN_NAME_EXISTS_WARNING": "Attention: le nom de la colonne existe déjà.",
"COL_CHANGE_DESCRIPTION": "Fournit une description de la colonne pour aider à se souvenir de la signification de la colonne. Il s'agit par défaut du nom d'affichage s'il est disponible, sinon le nom de la colonne est utilisé.",
"COL_CHANGE_DISPLAY": "Changer le nom d'affichage d'une colonne",
"COL_CHANGE_NAME": "Spécifie le nom de champ sous-jacent représenté par le nom d'affichage. Ces noms de champ ne sont pas définis par l'utilisateur, mais sont générés à partir de fichiers utilisateur importés ainsi que de champs définis par programme.",
"COL_CHANGE_NAME_EXT": "Si un nom a une balise «données supplémentaires» après, ce sont des champs qui ont été importés dans SEED par l'utilisateur à partir de fichiers importés. Ces champs ne peuvent pas être utilisés comme champs correspondants dans la section Critère de correspondance.",
Expand Down Expand Up @@ -382,7 +383,6 @@
"INVALID_GEOJSON_EXTENSION_ALERT": "<strong>Désolée!<\/strong> SEED ne supporte actuellement pas ce format de fichier. Seuls les fichiers <strong>.geojson<\/strong>, et <strong>.json<\/strong> sont pris en charge.",
"INVALID_XML_EXTENSION_ALERT": "<strong>Désolée!<\/strong> SEED ne supporte actuellement pas ce format de fichier. Seuls les fichiers <strong>.xml<\/strong> sont pris en charge.",
"INVALID_XML_ZIP_EXTENSION_ALERT": "<strong>Désolée!<\/strong> SEED ne supporte actuellement pas ce format de fichier. Seuls les fichiers <strong>.xml<\/strong> et <strong>.zip<\/strong> sont pris en charge.",
"INVALID_DOC_FILE_EXTENSION_ALERT": "<strong>Désolée!<\/strong> SEED ne supporte actuellement pas ce format de fichier. Seuls les fichiers <strong>.pdf<\/strong>, <strong>.osm<\/strong>, <strong>.idf<\/strong>, and <strong>.dxf<\/strong> sont pris en charge.",
"IRREVERSIBLE_OPERATION_WARNING": "Cette opération est irréversible.",
"ITEMS_WILL_NOT_CHANGE": "ceux-ci ne changeront pas",
"Ignored duplicates of existing properties": "Copies ignorées des propriétés existantes",
Expand Down Expand Up @@ -656,6 +656,7 @@
"Recent Sale Date": "Date de vente récente",
"Recognize Empty": "Reconnaître vide",
"Record from Source": "Enregistrement de la source",
"Refresh Metadata of Selected Properties and Tax Lots": "Actualiser les métadonnées des propriétés et terrains d'impôt sélectionnés",
"Reject": "Rejeter",
"Related Properties": "Propriétés connexes",
"Related Tax Lots": "Lots d'impôt connexes",
Expand Down Expand Up @@ -704,8 +705,6 @@
"SEED doesn't currently support that file format": "SEED ne prend pas actuellement en charge ce format de fichier",
"SEED is easy, flexible, and cost effective software designed to help organizations clean, manage and share information about large portfolios of buildings. SEED is a free, open source web application that you can use privately. While SEED was originally designed to help cities and States implement benchmarking programs for public or private buildings, it has the potential to be useful for many other activities by public entities, efficiency programs and private companies.": "SEED est un logiciel simple, flexible et rentable conçu pour aider les entreprises à nettoyer, gérer et partager des informations sur les grands portefeuilles de bâtiments. SEED est une application Web open source gratuite que vous pouvez utiliser en privé. Bien que SEED ait été conçue à l'origine pour aider les villes et les États à mettre en œuvre des programmes de benchmarking pour les bâtiments publics ou privés, il est susceptible d'être utile pour de nombreuses autres activités par des entités publiques, des programmes d'efficacité et des entreprises privées.",
"SELECT_DATA_SET_TITLE": "Sélectionner un ensemble de données",
"SELECT_UPLOAD_FILE_TITLE": "Sélectionner un fichier pour télécharger",
"SELECT_DOC_UPLOAD_TITLE": "Sélectionner un document d'inventaire pour télécharger",
"SELECT_THE_TYPE_OF_FILE_TO_ADD_TO_DATASET": "Sélectionnez le type de fichier(s) que vous souhaitez ajouter à {dataset_name}.",
"SHARE DATA WITH": "PARTAGE DE DONNÉES AVEC",
"SHOWING_AVAILABLE_MATCHES": "Affichage des {start} à {end} de {total} correspondances disponibles ",
Expand Down Expand Up @@ -841,21 +840,10 @@
"UBID": "UBID",
"UPDATE_MANUALLY_GEOCODED_INSTRUCTIONS": "Si les propriétés ont été géocodées manuellement, elles ne seront pas mises à jour. Pour mettre à jour le géocodage, supprimez le lat \/ long.",
"UPLOADING_FILE_TITLE": "Téléchargement de Fichier",
"UPLOADING_DOCUMENT_TITLE": "Téléchargement de Fichier Inventaire",
"UPLOADING_PROGRESS": "Importation de <strong> {dataset_filename} <\/strong> pour faire un cycle <strong> {cycle_name} <\/strong>",
"UPLOAD_COMPLETE_TITLE": "Téléchargement Complet",
"UPLOAD_FILE": "Téléverser un Fichier",
"CONTINUE": "Continuez",
"UPLOAD_GB_DATA_BUTTON": "Importer des Données GreenButton",
"UPLOAD_DATA_LOGGER_BUTTON": "Importer en Enregistreur de Données",
"CREATE_DATA_LOGGER": "Créer un Enregistreur de Données",
"NO_DATA_LOGGER_DISPLAY_NAME": "S'il vous plaît entrer un nom d'affichage.",
"NON_UNIQUE_DATA_LOGGER_DISPLAY_NAME": "Le nom à afficher doit être unique.",
"UPLOAD_SENSORS_BUTTON": "Importer des Capteurs",
"UPLOAD_SENSOR_READINGS_BUTTON": "Importer des relevés des Capteurs",
"SENSORS": "Capteurs",
"SENSOR_READINGS": "Relevés des Capteurs",
"DATA_LOGGERS": "Enregistreur de Données",
"UPLOAD_INCOMPLETE_TITLE": "Téléchargement incomplet",
"UPLOAD_PM_READINGS_MODAL_TITLE": "Importer des lectures de compteur Portfolio Manager",
"USING_DEFAULT_UNITS_WARNING": "Pour les colonnes avec des paramètres d'unité, les unités par défaut seront utilisées pour les conversions.",
Expand Down Expand Up @@ -1005,6 +993,7 @@
"project taxlot views": "vues taxlot de projet",
"property": "propriété",
"red": "rouge",
"refresh metadata": "Actualiser les métadonnées",
"save": "enregistrer",
"saving complete": "enregistrement complète",
"saving data": "enregistrant les données",
Expand Down
3 changes: 3 additions & 0 deletions seed/static/seed/partials/inventory_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ <h1>{$:: (inventory_type === 'taxlots' ? 'Tax Lots' : 'Properties') | translate
<li role="menuitem">
<a ng-click="open_analyses_modal()" ng-disabled="selectedCount === 0" translate>Run Analysis</a>
</li>
<li role="menuitem">
<a ng-click="open_refresh_metadata_modal()" ng-disabled="selectedCount === 0" translate>Refresh Metadata</a>
</li>
<li class="divider"></li>
<li role="menuitem">
<a ng-click="open_geocode_modal()" ng-disabled="selectedCount === 0" translate>Geocode Selected</a>
Expand Down

0 comments on commit 971b185

Please sign in to comment.