Skip to content

Commit

Permalink
WIP: /invites/:inviteId to /invites/users/* - citizenos/citizenos-fe#112
Browse files Browse the repository at this point in the history
  • Loading branch information
tiblu committed Nov 19, 2019
1 parent 39bcdc4 commit 6e22459
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
<![endif]-->
<link href="https://fonts.googleapis.com/css?family=Noto+Sans:300,400,700" rel="stylesheet">

<link href="styles/citizenos-fe.bundle.css?v=25e5def229fcc61c9241701f80822701" rel="stylesheet">
<link href="styles/citizenos-fe.bundle.css?v=d17a93e3ee852f2b7bade00e64f29bbc" rel="stylesheet">
<link href="config/styles/local.css?v=39bfb61dcdcd4d8ab583ebf2ecf68370" rel="stylesheet">
<script src="settings.js?v=4687d14bce865b6a80552d2909f7e09f"></script>
<script src="js/citizenos-fe.bundle.js?v=3ad0b8c9d527537ce81534f070315e43"></script>
<script src="js/citizenos-fe.bundle.js?v=6d7dfce920be4804c92b7fcbe5313b65"></script>

<meta name="theme-color" content="#1a1a1a">
<title ng-if="app.metainfo.title" translate="{{app.metainfo.title}}">Citizen OS - an e-decisionmaking platform for communities.</title>
Expand Down
6 changes: 3 additions & 3 deletions public/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,8 @@
parent: 'main',
controller: 'JoinCtrl'
})
.state('topicsTopicIdInvites', { // Cannot use dot notation (topics.topicId.invites) as that would make the page child of "topics" and we don't want that.
url: '/topics/:topicId/invites/:inviteId',
.state('topicsTopicIdInvitesUsers', { // Cannot use dot notation (topics.topicId.invites.users) as that would make the page child of "topics" and we don't want that.
url: '/topics/:topicId/invites/users/:inviteId',
parent: 'main',
templateUrl: '/views/home.html',
resolve: {
Expand Down Expand Up @@ -832,7 +832,7 @@
}

var dialog = ngDialog.open({
template: '/views/modals/topic_topicId_invites_inviteId.html',
template: '/views/modals/topic_topicId_invites_users_inviteId.html',
data: $stateParams,
scope: $scope, // pass on scope, so that modal has access to App scope ($scope.app)
controller: ['$scope', '$log', function ($scope, $log) {
Expand Down
6 changes: 3 additions & 3 deletions public/js/citizenos-fe.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/citizenos-fe.bundle.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/js/factories/TopicInviteUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ angular
$log.debug('citizenos.factory.TopicInviteUser');

var TopicInviteUser = $resource(
sLocation.getAbsoluteUrlApi('/api/users/self/topics/:topicId/invites/:inviteId'), // Actually Groups are added to Topic
sLocation.getAbsoluteUrlApi('/api/users/self/topics/:topicId/invites/users/:inviteId'), // Actually Groups are added to Topic
{
topicId: '@topicId',
inviteId: '@id'
Expand Down Expand Up @@ -46,7 +46,7 @@ angular
},
inviteId: '@id'
},
url: sLocation.getAbsoluteUrlApi('/api/users/self/topics/:topicId/invites/:inviteId/accept'),
url: sLocation.getAbsoluteUrlApi('/api/users/self/topics/:topicId/invites/users/:inviteId/accept'),
transformResponse: function (data, headersGetter, status) {
if (status > 0 && status < 400) { // TODO: think this error handling through....
return angular.fromJson(data).data;
Expand Down
5 changes: 3 additions & 2 deletions public/js/services/sActivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,16 +531,17 @@ angular
object = object[0];
}

console.error('activityType', activityType, activity);
if (activityType === 'Invite' && target['@type'] === 'User' && object['@type'] === 'Topic') { // https://github.com/citizenos/citizenos-fe/issues/112
// The invited user is viewing
if (sAuth.user.loggedIn && sAuth.user.id === target.id) {
stateName = 'topicsTopicIdInvites';
stateName = 'topicsTopicIdInvitesUsers';
params.topicId = object.id;
params.inviteId = target.inviteId; // HACKISH! Change once issue resolves - https://github.com/w3c/activitystreams/issues/506
} else {
// Creator of the invite or a person who has read permissions is viewing
stateName = 'topics.view';
params.topicId = object.topicId;
params.topicId = object.id;
}
} else if (object['@type'] === 'Topic') {
stateName = 'topics.view';
Expand Down
7 changes: 4 additions & 3 deletions public/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -901,9 +901,10 @@
"MSG_ERROR_GET_API_USERS_TOPICS_VOTES_STATUS_40016": "@:MSG_ERROR_GET_API_TOPICS_VOTES_STATUS_40016",
"MSG_ERROR_GET_API_USERS_TOPICS_VOTES_STATUS_40017": "@:MSG_ERROR_GET_API_TOPICS_VOTES_STATUS_40017",
"MSG_ERROR_GET_API_USERS_TOPICS_VOTES_STATUS_50001": "@:MSG_ERROR_GET_API_TOPICS_VOTES_STATUS_50001",
"MSG_ERROR_GET_API_USERS_TOPICS_INVITES_41001": "Sorry, the invite to a topic has been deleted.",
"MSG_ERROR_GET_API_USERS_TOPICS_INVITES_41002_HEADING": "Invitation expired",
"MSG_ERROR_GET_API_USERS_TOPICS_INVITES_41002": "We’re sorry! This invitation has expired in the meantime. We apologize for the inconvenience. You can re-request the access to this topic.",
"MSG_ERROR_GET_API_USERS_TOPICS_INVITES_USERS_41001": "Sorry, the invite to a topic has been deleted.",
"MSG_ERROR_GET_API_USERS_TOPICS_INVITES_USERS_41002_HEADING": "Invitation expired",
"MSG_ERROR_GET_API_USERS_TOPICS_INVITES_USERS_41002": "We’re sorry! This invitation has expired in the meantime. We apologize for the inconvenience. You can re-request the access to this topic.",
"MSG_ERROR_GET_API_USERS_TOPICS_INVITES_USERS_40400": "",
"MSG_ERROR_POST_API_USERS_TOPICS_EVENTS_40000_TEXT": "Text cannot be empty.",
"MSG_ERROR_HWCRYPTO_USER_CANCEL": "You have cancelled the login flow.",
"MSG_ERROR_HWCRYPTO_NO_CERTIFICATES": "No card in reader. Check if the ID-card is inserted correctly into the reader. New ID-cards have a chip on the back side of the card.",
Expand Down

0 comments on commit 6e22459

Please sign in to comment.